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

Unified Diff: cc/layers/video_layer_impl.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
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | media/base/decoder_buffer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/video_layer_impl.cc
diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc
index 94125d6735cd18c7ecd53cbd50c42929fbb45736..2449c08cdb375603101bbec6ad4a25b5be055aea 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -133,6 +133,7 @@ void VideoLayerImpl::WillDrawInternal(ResourceProvider* resource_provider) {
convert_yuv_ =
resource_provider->default_resource_type() == ResourceProvider::Bitmap &&
(format_ == media::VideoFrame::YV12 ||
+ format_ == media::VideoFrame::YV12A ||
format_ == media::VideoFrame::YV16);
if (convert_yuv_)
@@ -216,6 +217,25 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink,
quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>(), append_quads_data);
break;
}
+ case media::VideoFrame::YV12A: {
+ // YUV software decoder.
+ const FramePlane& y_plane = frame_planes_[media::VideoFrame::kYPlane];
+ const FramePlane& u_plane = frame_planes_[media::VideoFrame::kUPlane];
+ const FramePlane& v_plane = frame_planes_[media::VideoFrame::kVPlane];
+ const FramePlane& a_plane = frame_planes_[media::VideoFrame::kAPlane];
+ gfx::SizeF tex_scale(tex_width_scale, tex_height_scale);
+ scoped_ptr<YUVVideoDrawQuad> yuva_video_quad = YUVVideoDrawQuad::Create();
+ yuva_video_quad->SetNew(shared_quad_state,
+ quad_rect,
+ opaque_rect,
+ tex_scale,
+ y_plane,
+ u_plane,
+ v_plane,
+ a_plane);
+ quad_sink->Append(yuva_video_quad.PassAs<DrawQuad>(), append_quads_data);
+ break;
+ }
case media::VideoFrame::RGB32: {
// RGBA software decoder: a converted YUV frame (see: convert_yuv_).
const FramePlane& plane = frame_planes_[media::VideoFrame::kRGBPlane];
@@ -332,7 +352,9 @@ static gfx::Size VideoFrameDimension(media::VideoFrame* frame, int plane) {
gfx::Size dimensions = frame->coded_size();
switch (frame->format()) {
case media::VideoFrame::YV12:
- if (plane != media::VideoFrame::kYPlane) {
+ case media::VideoFrame::YV12A:
+ if (plane != media::VideoFrame::kYPlane &&
+ plane != media::VideoFrame::kAPlane) {
dimensions.set_width(dimensions.width() / 2);
dimensions.set_height(dimensions.height() / 2);
}
@@ -370,6 +392,7 @@ static GLenum ConvertVFCFormatToGLenum(const media::VideoFrame::Format format) {
switch (format) {
case media::VideoFrame::YV12:
case media::VideoFrame::YV16:
+ case media::VideoFrame::YV12A:
return GL_LUMINANCE;
case media::VideoFrame::RGB32:
return GL_RGBA;
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | media/base/decoder_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698