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

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 1561703002: media/vpx: Add support for VP9 alpha channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | media/test/data/bear-vp9a.webm » ('j') | media/test/pipeline_integration_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index 40814bb273ad5a3f5cc18e96ea9172f9fd4e929b..65d9742af10ea2bf75b2ece03d319eb1e8a112bd 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -380,11 +380,11 @@ bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
return false;
// These are the combinations of codec-pixel format supported in principle.
- // Note that VP9 does not support Alpha in the current implementation.
DCHECK(
(config.codec() == kCodecVP8 && config.format() == PIXEL_FORMAT_YV12) ||
(config.codec() == kCodecVP8 && config.format() == PIXEL_FORMAT_YV12A) ||
(config.codec() == kCodecVP9 && config.format() == PIXEL_FORMAT_YV12) ||
+ (config.codec() == kCodecVP9 && config.format() == PIXEL_FORMAT_YV12A) ||
(config.codec() == kCodecVP9 && config.format() == PIXEL_FORMAT_YV24));
#if !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
@@ -400,9 +400,10 @@ bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
if (!vpx_codec_)
return false;
- // Configure VP9 to decode on our buffers to skip a data copy on decoding.
- if (config.codec() == kCodecVP9) {
- DCHECK_NE(PIXEL_FORMAT_YV12A, config.format());
+ // Configure non-YV12A VP9 to decode on our buffers to skip a data copy on
DaleCurtis 2016/01/05 21:22:21 I guess we can't copy into one of the buffers sinc
vignesh 2016/01/06 00:07:49 The thing is that the Y, U and V planes come from
DaleCurtis 2016/01/06 00:18:02 Hmm, could you over allocate the first buffer and
vignesh 2016/01/08 17:53:40 Good point, i will try it out and update the CL.
vignesh 2016/01/08 19:21:33 ok, i looked into this and i'm a little confused.
DaleCurtis 2016/01/08 19:29:03 Yes, you'd need to add a WrapExternalYUVA method a
+ // decoding. We do not use our buffers for YV12A VP9 since it involves two
+ // different instances of the decoder.
+ if (config.codec() == kCodecVP9 && config.format() != PIXEL_FORMAT_YV12A) {
DCHECK(vpx_codec_get_caps(vpx_codec_->iface) &
VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER);
@@ -581,7 +582,7 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame(
if (memory_pool_.get()) {
DCHECK_EQ(kCodecVP9, config_.codec());
- DCHECK(!vpx_codec_alpha_) << "Uh-oh, VP9 and Alpha shouldn't coexist.";
+ DCHECK(!vpx_codec_alpha_);
*video_frame = VideoFrame::WrapExternalYuvData(
codec_format,
coded_size, gfx::Rect(visible_size), config_.natural_size(),
« no previous file with comments | « no previous file | media/test/data/bear-vp9a.webm » ('j') | media/test/pipeline_integration_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698