Chromium Code Reviews| Index: content/common/gpu/media/vaapi_video_decode_accelerator.cc |
| diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc |
| index b5f2b908f993e6cbcafca7b12a3edb93af25cb49..559c1c4cb0a41b7e46bd69c9afa4d116cdd94122 100644 |
| --- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc |
| +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc |
| @@ -15,6 +15,7 @@ |
| #include "media/base/bind_to_current_loop.h" |
| #include "media/video/picture.h" |
| #include "ui/gl/gl_bindings.h" |
| +#include "ui/gl/gl_image.h" |
| static void ReportToUMA( |
| content::VaapiH264Decoder::VAVDAH264DecoderFailure failure) { |
| @@ -72,7 +73,9 @@ VaapiPicture* VaapiVideoDecodeAccelerator::PictureById( |
| } |
| VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( |
| - const base::Callback<bool(void)>& make_context_current) |
| + const base::Callback<bool(void)>& make_context_current, |
| + const base::Callback<void(uint32, uint32, scoped_refptr<gfx::GLImage>)>& |
| + bind_image) |
|
Pawel Osciak
2015/01/24 00:58:54
Is this correct indentation?
|
| : make_context_current_(make_context_current), |
| state_(kUninitialized), |
| input_ready_(&lock_), |
| @@ -84,6 +87,7 @@ VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( |
| finish_flush_pending_(false), |
| awaiting_va_surfaces_recycle_(false), |
| requested_num_pics_(0), |
| + bind_image_(bind_image), |
| weak_this_factory_(this) { |
| weak_this_ = weak_this_factory_.GetWeakPtr(); |
| va_surface_release_cb_ = media::BindToCurrentLoop( |
| @@ -187,8 +191,9 @@ void VaapiVideoDecodeAccelerator::OutputPicture( |
| // TODO(posciak): Use visible size from decoder here instead |
| // (crbug.com/402760). |
| if (client_) |
| - client_->PictureReady( |
| - media::Picture(output_id, input_id, gfx::Rect(picture->size()))); |
| + client_->PictureReady(media::Picture(output_id, input_id, |
| + gfx::Rect(picture->size()), |
| + picture->allow_overlay())); |
| } |
| void VaapiVideoDecodeAccelerator::TryOutputSurface() { |
| @@ -526,6 +531,12 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers( |
| vaapi_wrapper_.get(), make_context_current_, buffers[i].id(), |
| buffers[i].texture_id(), requested_pic_size_)); |
| + scoped_refptr<gfx::GLImage> image = picture->GetImageToBind(); |
| + if (image) { |
| + bind_image_.Run(buffers[i].internal_texture_id(), |
|
Pawel Osciak
2015/01/24 00:58:54
Sorry, I'm confused, could you please explain why
achaulk
2015/01/27 18:36:48
It's roughly equivalent, but in the case where we
Pawel Osciak
2015/01/28 23:52:02
I think we can't create a GLImage from XPixmap?
|
| + VaapiPicture::GetGLTextureTarget(), image); |
| + } |
| + |
| RETURN_AND_NOTIFY_ON_FAILURE( |
| picture.get(), "Failed assigning picture buffer to a texture.", |
| PLATFORM_FAILURE, ); |