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

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: cc2a95fe Android fixes. Created 7 years 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 1c8d6008bcadd65892c23b85ef3435b5ddacdb79..d59d6c7c9e8befcf86bb95cd6a2021517f4092d5 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -421,14 +421,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,
@@ -436,8 +433,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) {
@@ -641,8 +637,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_loop_proxy_->BelongsToCurrentThread());
DVLOG(3) << "ReusePictureBuffer. id=" << picture_buffer_id;
@@ -666,7 +663,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