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

Unified Diff: content/renderer/media/rtc_video_decoder.cc

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c301e01d Rebase. Created 6 years, 12 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: content/renderer/media/rtc_video_decoder.cc
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index aa32aae8a955c71b2c1ca71c2bb34737a7790615..7ea84059f3b8833729476d251899be5074eb3043 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -420,14 +420,11 @@ scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame(
base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue(
base::checked_numeric_cast<uint64_t>(timestamp) * 1000 / 90);
return media::VideoFrame::WrapNativeTexture(
- make_scoped_ptr(new media::VideoFrame::MailboxHolder(
- pb.texture_mailbox(),
- 0, // sync_point
- media::BindToCurrentLoop(
- base::Bind(&RTCVideoDecoder::ReusePictureBuffer,
- weak_this_,
- picture.picture_buffer_id())))),
- decoder_texture_target_,
+ make_scoped_ptr(new gpu::MailboxHolder(
+ pb.texture_mailbox(), decoder_texture_target_, 0)),
+ media::BindToCurrentLoop(base::Bind(&RTCVideoDecoder::ReusePictureBuffer,
+ weak_this_,
+ picture.picture_buffer_id())),
pb.size(),
visible_rect,
natural_size,
@@ -435,8 +432,7 @@ scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame(
base::Bind(&media::GpuVideoAcceleratorFactories::ReadPixels,
factories_,
pb.texture_id(),
- natural_size),
- base::Closure());
+ natural_size));
}
void RTCVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) {
@@ -640,8 +636,9 @@ void RTCVideoDecoder::ResetInternal() {
vda_->Reset();
}
-void RTCVideoDecoder::ReusePictureBuffer(int64 picture_buffer_id,
- uint32 sync_point) {
+void RTCVideoDecoder::ReusePictureBuffer(
+ int64 picture_buffer_id,
+ scoped_ptr<gpu::MailboxHolder> mailbox_holder) {
DCHECK(vda_task_runner_->BelongsToCurrentThread());
DVLOG(3) << "ReusePictureBuffer. id=" << picture_buffer_id;
@@ -665,7 +662,7 @@ void RTCVideoDecoder::ReusePictureBuffer(int64 picture_buffer_id,
return;
}
- factories_->WaitSyncPoint(sync_point);
+ factories_->WaitSyncPoint(mailbox_holder->sync_point);
vda_->ReusePictureBuffer(picture_buffer_id);
}

Powered by Google App Engine
This is Rietveld 408576698