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

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 12157002: Adding YUVA support for enabling Alpha Playback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving VP8 Alpha Playback behind its own flag Created 7 years, 10 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 b5e4100b3fb5385d3180914021d2f9c91b82ab20..5a0afc86bd303f513952c9781053842d153247d0 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -387,6 +387,12 @@ void AVStreamToVideoDecoderConfig(
coded_size = natural_size;
}
+ AVDictionaryEntry *webm_alpha =
fgalligan1 2013/02/12 01:20:58 nit: Asterisk adjacent to the type per style in th
vigneshv 2013/02/14 19:06:14 Done.
+ av_dict_get(stream->metadata, "alpha_mode", NULL, 0);
fgalligan1 2013/02/12 01:20:58 4 space indent http://google-styleguide.googlecode
vigneshv 2013/02/14 19:06:14 Done.
+ if (webm_alpha && !strcmp(webm_alpha->value, "1")) {
+ format = VideoFrame::YV12A;
+ }
+
config->Initialize(codec,
profile,
format,
@@ -499,6 +505,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;
}
@@ -511,6 +519,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