diff options
author | achaulk <achaulk@chromium.org> | 2015-01-27 10:24:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-27 18:26:46 +0000 |
commit | 32c0609baa6c3eea2400c6fe899a0ff60a1358dd (patch) | |
tree | d0a91446044a57c25466fac614bc29619b4e6709 | |
parent | 0a2ee7e9da3f75249436f1b70e8ba99e371002ab (diff) | |
download | chromium_src-32c0609baa6c3eea2400c6fe899a0ff60a1358dd.zip chromium_src-32c0609baa6c3eea2400c6fe899a0ff60a1358dd.tar.gz chromium_src-32c0609baa6c3eea2400c6fe899a0ff60a1358dd.tar.bz2 |
Plumb allow_overlay flag for video path into cc
This will allow hardware video overlays to be enabled in the compositor
Review URL: https://codereview.chromium.org/806413004
Cr-Commit-Position: refs/heads/master@{#313310}
22 files changed, 103 insertions, 114 deletions
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc index d55fc86..6375057 100644 --- a/cc/resources/video_resource_updater.cc +++ b/cc/resources/video_resource_updater.cc @@ -388,6 +388,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes( TextureMailbox(mailbox_holder->mailbox, mailbox_holder->texture_target, mailbox_holder->sync_point)); + external_resources.mailboxes.back().set_allow_overlay( + video_frame->allow_overlay()); external_resources.release_callbacks.push_back( base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); return external_resources; diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index 24ffcd4..681ae4e 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -1061,24 +1061,18 @@ class LayerTreeHostContextTestDontUseLostResources color_video_frame_ = VideoFrame::CreateColorFrame( gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); - hw_video_frame_ = - VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder( - mailbox, GL_TEXTURE_2D, sync_point)), - media::VideoFrame::ReleaseMailboxCB(), - gfx::Size(4, 4), - gfx::Rect(0, 0, 4, 4), - gfx::Size(4, 4), - base::TimeDelta(), - VideoFrame::ReadPixelsCB()); - scaled_hw_video_frame_ = - VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder( - mailbox, GL_TEXTURE_2D, sync_point)), - media::VideoFrame::ReleaseMailboxCB(), - gfx::Size(4, 4), - gfx::Rect(0, 0, 3, 2), - gfx::Size(4, 4), - base::TimeDelta(), - VideoFrame::ReadPixelsCB()); + hw_video_frame_ = VideoFrame::WrapNativeTexture( + make_scoped_ptr( + new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), + media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), + gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(), + VideoFrame::ReadPixelsCB(), false); + scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( + make_scoped_ptr( + new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), + media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), + gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), + VideoFrame::ReadPixelsCB(), false); color_frame_provider_.set_frame(color_video_frame_); hw_frame_provider_.set_frame(hw_video_frame_); diff --git a/content/browser/media/capture/desktop_capture_device_aura.cc b/content/browser/media/capture/desktop_capture_device_aura.cc index 60e4d57..1b26d4c 100644 --- a/content/browser/media/capture/desktop_capture_device_aura.cc +++ b/content/browser/media/capture/desktop_capture_device_aura.cc @@ -362,11 +362,8 @@ bool DesktopVideoCaptureMachine::ProcessCopyOutputResponse( texture_mailbox.target(), texture_mailbox.sync_point())), base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), - result->size(), - gfx::Rect(result->size()), - result->size(), - base::TimeDelta(), - media::VideoFrame::ReadPixelsCB()); + result->size(), gfx::Rect(result->size()), result->size(), + base::TimeDelta(), media::VideoFrame::ReadPixelsCB(), false); capture_frame_cb.Run(video_frame, start_time, true); return true; } diff --git a/content/browser/renderer_host/media/video_capture_controller_unittest.cc b/content/browser/renderer_host/media/video_capture_controller_unittest.cc index 0a7ef21..9d2d4df 100644 --- a/content/browser/renderer_host/media/video_capture_controller_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_controller_unittest.cc @@ -145,13 +145,9 @@ class VideoCaptureControllerTest : public testing::Test { const media::VideoFrame::ReleaseMailboxCB& release_cb, gfx::Size dimensions) { return media::VideoFrame::WrapNativeTexture( - holder.Pass(), - release_cb, - dimensions, - gfx::Rect(dimensions), - dimensions, - base::TimeDelta(), - media::VideoFrame::ReadPixelsCB()); + holder.Pass(), release_cb, dimensions, gfx::Rect(dimensions), + dimensions, base::TimeDelta(), media::VideoFrame::ReadPixelsCB(), + false); } TestBrowserThreadBundle bundle_; diff --git a/content/common/gpu/client/gpu_video_decode_accelerator_host.cc b/content/common/gpu/client/gpu_video_decode_accelerator_host.cc index a784467..cef83f6 100644 --- a/content/common/gpu/client/gpu_video_decode_accelerator_host.cc +++ b/content/common/gpu/client/gpu_video_decode_accelerator_host.cc @@ -233,11 +233,13 @@ void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( void GpuVideoDecodeAcceleratorHost::OnPictureReady( int32 picture_buffer_id, int32 bitstream_buffer_id, - const gfx::Rect& visible_rect) { + const gfx::Rect& visible_rect, + bool allow_overlay) { DCHECK(CalledOnValidThread()); if (!client_) return; - media::Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect); + media::Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect, + allow_overlay); client_->PictureReady(picture); } diff --git a/content/common/gpu/client/gpu_video_decode_accelerator_host.h b/content/common/gpu/client/gpu_video_decode_accelerator_host.h index e70053d..d82da07 100644 --- a/content/common/gpu/client/gpu_video_decode_accelerator_host.h +++ b/content/common/gpu/client/gpu_video_decode_accelerator_host.h @@ -65,7 +65,8 @@ class GpuVideoDecodeAcceleratorHost void OnDismissPictureBuffer(int32 picture_buffer_id); void OnPictureReady(int32 picture_buffer_id, int32 bitstream_buffer_id, - const gfx::Rect& visible_rect); + const gfx::Rect& visible_rect, + bool allow_overlay); void OnFlushDone(); void OnResetDone(); void OnNotifyError(uint32 error); diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 09bc877..1494051 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -688,10 +688,11 @@ IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer, int32) /* Picture buffer ID */ // Decoder reports that a picture is ready. -IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderHostMsg_PictureReady, +IPC_MESSAGE_ROUTED4(AcceleratedVideoDecoderHostMsg_PictureReady, int32, /* Picture buffer ID */ int32, /* Bitstream buffer ID */ - gfx::Rect) /* Visible rectangle */ + gfx::Rect, /* Visible rectangle */ + bool) /* Buffer is HW overlay capable */ // Confirm decoder has been flushed. IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc index 8fbdeb1..f0929bb 100644 --- a/content/common/gpu/media/android_video_decode_accelerator.cc +++ b/content/common/gpu/media/android_video_decode_accelerator.cc @@ -373,11 +373,10 @@ void AndroidVideoDecodeAccelerator::SendCurrentSurfaceToClient( default_matrix); base::MessageLoop::current()->PostTask( - FROM_HERE, - base::Bind( - &AndroidVideoDecodeAccelerator::NotifyPictureReady, - weak_this_factory_.GetWeakPtr(), - media::Picture(picture_buffer_id, bitstream_id, gfx::Rect(size_)))); + FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyPictureReady, + weak_this_factory_.GetWeakPtr(), + media::Picture(picture_buffer_id, bitstream_id, + gfx::Rect(size_), false))); } void AndroidVideoDecodeAccelerator::Decode( diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc index 185e99d..342de2e 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc @@ -1241,9 +1241,8 @@ void DXVAVideoDecodeAccelerator::NotifyPictureReady( DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); // This task could execute after the decoder has been torn down. if (GetState() != kUninitialized && client_) { - media::Picture picture(picture_buffer_id, - input_buffer_id, - picture_buffer_size); + media::Picture picture(picture_buffer_id, input_buffer_id, + picture_buffer_size, false); client_->PictureReady(picture); } } diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc index 8f187fd..8042690 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc @@ -215,10 +215,9 @@ void GpuVideoDecodeAccelerator::PictureReady( } if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady( - host_route_id_, - picture.picture_buffer_id(), - picture.bitstream_buffer_id(), - picture.visible_rect()))) { + host_route_id_, picture.picture_buffer_id(), + picture.bitstream_buffer_id(), picture.visible_rect(), + picture.allow_overlay()))) { DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; } } diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc index b5f2b90..6b7959e 100644 --- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc +++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc @@ -188,7 +188,7 @@ void VaapiVideoDecodeAccelerator::OutputPicture( // (crbug.com/402760). if (client_) client_->PictureReady( - media::Picture(output_id, input_id, gfx::Rect(picture->size()))); + media::Picture(output_id, input_id, gfx::Rect(picture->size()), false)); } void VaapiVideoDecodeAccelerator::TryOutputSurface() { diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc index e18412c..af6f149 100644 --- a/content/common/gpu/media/vt_video_decode_accelerator.cc +++ b/content/common/gpu/media/vt_video_decode_accelerator.cc @@ -886,8 +886,8 @@ bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) { available_picture_ids_.pop_back(); picture_bindings_[picture_id] = frame.image; - client_->PictureReady(media::Picture( - picture_id, frame.bitstream_id, gfx::Rect(frame.coded_size))); + client_->PictureReady(media::Picture(picture_id, frame.bitstream_id, + gfx::Rect(frame.coded_size), false)); return true; } diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc index 1ff1c9c..c35007d 100644 --- a/content/renderer/media/android/webmediaplayer_android.cc +++ b/content/renderer/media/android/webmediaplayer_android.cc @@ -1181,16 +1181,14 @@ void WebMediaPlayerAndroid::DrawRemotePlaybackText( GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM(); scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( - make_scoped_ptr(new gpu::MailboxHolder( - texture_mailbox, texture_target, texture_mailbox_sync_point)), + make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox, texture_target, + texture_mailbox_sync_point)), media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, stream_texture_factory_, remote_playback_texture_id)), - canvas_size /* coded_size */, - gfx::Rect(canvas_size) /* visible_rect */, - canvas_size /* natural_size */, - base::TimeDelta() /* timestamp */, - VideoFrame::ReadPixelsCB()); + canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, + canvas_size /* natural_size */, base::TimeDelta() /* timestamp */, + VideoFrame::ReadPixelsCB(), false /* allow overlay */); SetCurrentFrameInternal(new_frame); } @@ -1221,15 +1219,12 @@ void WebMediaPlayerAndroid::ReallocateVideoFrame() { GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM(); scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( - make_scoped_ptr(new gpu::MailboxHolder( - texture_mailbox_, texture_target, texture_mailbox_sync_point)), + make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox_, texture_target, + texture_mailbox_sync_point)), media::BindToCurrentLoop(base::Bind( &OnReleaseTexture, stream_texture_factory_, texture_id_ref)), - natural_size_, - gfx::Rect(natural_size_), - natural_size_, - base::TimeDelta(), - VideoFrame::ReadPixelsCB()); + natural_size_, gfx::Rect(natural_size_), natural_size_, + base::TimeDelta(), VideoFrame::ReadPixelsCB(), false); SetCurrentFrameInternal(new_frame); } } diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc index 0cc66a7..ffa2536 100644 --- a/content/renderer/media/rtc_video_decoder.cc +++ b/content/renderer/media/rtc_video_decoder.cc @@ -445,18 +445,14 @@ scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame( base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue( base::checked_cast<uint64_t>(timestamp) * 1000 / 90); return media::VideoFrame::WrapNativeTexture( - make_scoped_ptr(new gpu::MailboxHolder( - pb.texture_mailbox(), decoder_texture_target_, 0)), - media::BindToCurrentLoop(base::Bind(&RTCVideoDecoder::ReleaseMailbox, - weak_factory_.GetWeakPtr(), - factories_, - picture.picture_buffer_id(), - pb.texture_id())), - pb.size(), - visible_rect, - visible_rect.size(), - timestamp_ms, - base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect)); + make_scoped_ptr(new gpu::MailboxHolder(pb.texture_mailbox(), + decoder_texture_target_, 0)), + media::BindToCurrentLoop(base::Bind( + &RTCVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), + factories_, picture.picture_buffer_id(), pb.texture_id())), + pb.size(), visible_rect, visible_rect.size(), timestamp_ms, + base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect), + picture.allow_overlay()); } void RTCVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) { diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc index 9688b46..7ae4b1a 100644 --- a/content/renderer/media/video_capture_impl.cc +++ b/content/renderer/media/video_capture_impl.cc @@ -278,16 +278,12 @@ void VideoCaptureImpl::OnMailboxBufferReceived( scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture( make_scoped_ptr(new gpu::MailboxHolder(mailbox_holder)), - media::BindToCurrentLoop( - base::Bind(&VideoCaptureImpl::OnClientBufferFinished, - weak_factory_.GetWeakPtr(), - buffer_id, - scoped_refptr<ClientBuffer>())), - last_frame_format_.frame_size, - gfx::Rect(last_frame_format_.frame_size), - last_frame_format_.frame_size, - timestamp - first_frame_timestamp_, - base::Bind(&NullReadPixelsCB)); + media::BindToCurrentLoop(base::Bind( + &VideoCaptureImpl::OnClientBufferFinished, weak_factory_.GetWeakPtr(), + buffer_id, scoped_refptr<ClientBuffer>())), + last_frame_format_.frame_size, gfx::Rect(last_frame_format_.frame_size), + last_frame_format_.frame_size, timestamp - first_frame_timestamp_, + base::Bind(&NullReadPixelsCB), false); for (ClientInfoMap::iterator it = clients_.begin(); it != clients_.end(); ++it) { diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc index 2aee847..2423274 100644 --- a/content/renderer/pepper/video_decoder_shim.cc +++ b/content/renderer/pepper/video_decoder_shim.cc @@ -539,8 +539,8 @@ void VideoDecoderShim::SendPictures() { GL_UNSIGNED_BYTE, &frame->argb_pixels.front()); - host_->PictureReady( - media::Picture(texture_id, frame->decode_id, frame->visible_rect)); + host_->PictureReady(media::Picture(texture_id, frame->decode_id, + frame->visible_rect, false)); pending_frames_.pop(); } diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 629d1a7..8d2a9abe 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc @@ -253,7 +253,8 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture( const gfx::Rect& visible_rect, const gfx::Size& natural_size, base::TimeDelta timestamp, - const ReadPixelsCB& read_pixels_cb) { + const ReadPixelsCB& read_pixels_cb, + bool allow_overlay) { scoped_refptr<VideoFrame> frame(new VideoFrame(NATIVE_TEXTURE, coded_size, visible_rect, @@ -263,6 +264,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture( false)); frame->mailbox_holder_release_cb_ = mailbox_holder_release_cb; frame->read_pixels_cb_ = read_pixels_cb; + frame->allow_overlay_ = allow_overlay; return frame; } @@ -685,7 +687,8 @@ VideoFrame::VideoFrame(VideoFrame::Format format, shared_memory_handle_(base::SharedMemory::NULLHandle()), timestamp_(timestamp), release_sync_point_(0), - end_of_stream_(end_of_stream) { + end_of_stream_(end_of_stream), + allow_overlay_(false) { DCHECK(IsValidConfig(format_, coded_size_, visible_rect_, natural_size_)); memset(&strides_, 0, sizeof(strides_)); diff --git a/media/base/video_frame.h b/media/base/video_frame.h index 605ff78..4215bae 100644 --- a/media/base/video_frame.h +++ b/media/base/video_frame.h @@ -114,7 +114,8 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { const gfx::Rect& visible_rect, const gfx::Size& natural_size, base::TimeDelta timestamp, - const ReadPixelsCB& read_pixels_cb); + const ReadPixelsCB& read_pixels_cb, + bool allow_overlay); #if !defined(MEDIA_FOR_CAST_IOS) // Read pixels from the native texture backing |*this| and write @@ -299,6 +300,8 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { // Returns the shared-memory handle, if present base::SharedMemoryHandle shared_memory_handle() const; + bool allow_overlay() const { return allow_overlay_; } + #if defined(OS_POSIX) // Returns backing dmabuf file descriptor for given |plane|, if present. int dmabuf_fd(size_t plane) const; @@ -410,6 +413,8 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { const bool end_of_stream_; + bool allow_overlay_; + DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); }; diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc index 38485c2..3bee635 100644 --- a/media/base/video_frame_unittest.cc +++ b/media/base/video_frame_unittest.cc @@ -255,11 +255,12 @@ TEST(VideoFrame, TextureNoLongerNeededCallbackIsCalled) { make_scoped_ptr( new gpu::MailboxHolder(gpu::Mailbox(), 5, 0 /* sync_point */)), base::Bind(&TextureCallback, &called_sync_point), - gfx::Size(10, 10), // coded_size - gfx::Rect(10, 10), // visible_rect - gfx::Size(10, 10), // natural_size - base::TimeDelta(), // timestamp - VideoFrame::ReadPixelsCB()); // read_pixels_cb + gfx::Size(10, 10), // coded_size + gfx::Rect(10, 10), // visible_rect + gfx::Size(10, 10), // natural_size + base::TimeDelta(), // timestamp + VideoFrame::ReadPixelsCB(), // read_pixels_cb + false); // allow_overlay } // Nobody set a sync point to |frame|, so |frame| set |called_sync_point| to 0 // as default value. @@ -296,11 +297,12 @@ TEST(VideoFrame, TextureNoLongerNeededCallbackAfterTakingAndReleasingMailbox) { scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTexture( make_scoped_ptr(new gpu::MailboxHolder(mailbox, target, sync_point)), base::Bind(&TextureCallback, &called_sync_point), - gfx::Size(10, 10), // coded_size - gfx::Rect(10, 10), // visible_rect - gfx::Size(10, 10), // natural_size - base::TimeDelta(), // timestamp - VideoFrame::ReadPixelsCB()); // read_pixels_cb + gfx::Size(10, 10), // coded_size + gfx::Rect(10, 10), // visible_rect + gfx::Size(10, 10), // natural_size + base::TimeDelta(), // timestamp + VideoFrame::ReadPixelsCB(), // read_pixels_cb + false); // allow_overlay const gpu::MailboxHolder* mailbox_holder = frame->mailbox_holder(); diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index 6601db8..fa4577a 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc @@ -450,16 +450,12 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) { scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( make_scoped_ptr(new gpu::MailboxHolder( pb.texture_mailbox(), decoder_texture_target_, 0 /* sync_point */)), - BindToCurrentLoop(base::Bind(&GpuVideoDecoder::ReleaseMailbox, - weak_factory_.GetWeakPtr(), - factories_, - picture.picture_buffer_id(), - pb.texture_id())), - pb.size(), - visible_rect, - natural_size, - timestamp, - base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect))); + BindToCurrentLoop(base::Bind( + &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), + factories_, picture.picture_buffer_id(), pb.texture_id())), + pb.size(), visible_rect, natural_size, timestamp, + base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect), + picture.allow_overlay())); CHECK_GT(available_pictures_, 0); --available_pictures_; bool inserted = diff --git a/media/video/picture.cc b/media/video/picture.cc index f051013..6b4c927 100644 --- a/media/video/picture.cc +++ b/media/video/picture.cc @@ -24,10 +24,12 @@ PictureBuffer::PictureBuffer(int32 id, Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id, - const gfx::Rect& visible_rect) + const gfx::Rect& visible_rect, + bool allow_overlay) : picture_buffer_id_(picture_buffer_id), bitstream_buffer_id_(bitstream_buffer_id), - visible_rect_(visible_rect) { + visible_rect_(visible_rect), + allow_overlay_(allow_overlay) { } } // namespace media diff --git a/media/video/picture.h b/media/video/picture.h index ec508ac..2fe10bf 100644 --- a/media/video/picture.h +++ b/media/video/picture.h @@ -57,7 +57,8 @@ class MEDIA_EXPORT Picture { public: Picture(int32 picture_buffer_id, int32 bitstream_buffer_id, - const gfx::Rect& visible_rect); + const gfx::Rect& visible_rect, + bool allow_overlay); // Returns the id of the picture buffer where this picture is contained. int32 picture_buffer_id() const { @@ -78,10 +79,13 @@ class MEDIA_EXPORT Picture { // Picture contained in the PictureBuffer. gfx::Rect visible_rect() const { return visible_rect_; } + bool allow_overlay() const { return allow_overlay_; } + private: int32 picture_buffer_id_; int32 bitstream_buffer_id_; gfx::Rect visible_rect_; + bool allow_overlay_; }; } // namespace media |