Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1428)

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 12263013: media: Add support for playback of VP8 Alpha video streams (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and fixes for comments on previous patchset Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 8a69a86ad66989dc501075ecd036e25027a36d0b..463c3d0f1c686d8c13521bb21a3d333b9f6cf110 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -382,6 +382,12 @@ void AVStreamToVideoDecoderConfig(
if (key)
is_encrypted = true;
+ AVDictionaryEntry* webm_alpha =
+ av_dict_get(stream->metadata, "alpha_mode", NULL, 0);
+ if (webm_alpha && !strcmp(webm_alpha->value, "1")) {
+ format = VideoFrame::YV12A;
+ }
+
config->Initialize(codec,
profile,
format,
@@ -490,6 +496,8 @@ VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUVJ420P:
return VideoFrame::YV12;
+ case PIX_FMT_YUVA420P:
+ return VideoFrame::YV12A;
default:
DVLOG(1) << "Unsupported PixelFormat: " << pixel_format;
}
@@ -502,6 +510,8 @@ PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format) {
return PIX_FMT_YUV422P;
case VideoFrame::YV12:
return PIX_FMT_YUV420P;
+ case VideoFrame::YV12A:
+ return PIX_FMT_YUVA420P;
default:
DVLOG(1) << "Unsupported VideoFrame::Format: " << video_format;
}

Powered by Google App Engine
This is Rietveld 408576698