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

Unified Diff: content/browser/renderer_host/media/video_capture_device_client.cc

Issue 1117423002: media: Let VideoFrame carry more than one native texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's comments. Created 5 years, 7 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/browser/renderer_host/media/video_capture_device_client.cc
diff --git a/content/browser/renderer_host/media/video_capture_device_client.cc b/content/browser/renderer_host/media/video_capture_device_client.cc
index 3fdbca2279847bcc186e08b42b89eda43bfdd9b8..14c5d69400e4616841aac9062391be0ee2082c3c 100644
--- a/content/browser/renderer_host/media/video_capture_device_client.cc
+++ b/content/browser/renderer_host/media/video_capture_device_client.cc
@@ -549,25 +549,21 @@ VideoCaptureDeviceClient::TextureWrapHelper::OnIncomingCapturedGpuMemoryBuffer(
gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id);
}
- scoped_ptr<gpu::MailboxHolder> mailbox_holder(new gpu::MailboxHolder(
- gl_helper_->ProduceMailboxHolderFromTexture(texture_id)));
- DCHECK(!mailbox_holder->mailbox.IsZero());
- DCHECK(mailbox_holder->mailbox.Verify());
- DCHECK(mailbox_holder->texture_target);
- DCHECK(mailbox_holder->sync_point);
+ const gpu::MailboxHolder& mailbox_holder(
+ gl_helper_->ProduceMailboxHolderFromTexture(texture_id));
+ DCHECK(!mailbox_holder.mailbox.IsZero());
+ DCHECK(mailbox_holder.mailbox.Verify());
+ DCHECK(mailbox_holder.texture_target);
+ DCHECK(mailbox_holder.sync_point);
scoped_refptr<media::VideoFrame> video_frame =
media::VideoFrame::WrapNativeTexture(
- mailbox_holder.Pass(),
- media::BindToCurrentLoop(
- base::Bind(&VideoCaptureDeviceClient::TextureWrapHelper::
- ReleaseCallback,
- this, image_id, texture_id)),
- frame_format.frame_size,
- gfx::Rect(frame_format.frame_size),
- frame_format.frame_size,
- base::TimeDelta(),
- true /* allow_overlay */);
+ mailbox_holder,
+ media::BindToCurrentLoop(base::Bind(
+ &VideoCaptureDeviceClient::TextureWrapHelper::ReleaseCallback,
+ this, image_id, texture_id)),
+ frame_format.frame_size, gfx::Rect(frame_format.frame_size),
+ frame_format.frame_size, base::TimeDelta(), true /* allow_overlay */);
video_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE,
frame_format.frame_rate);

Powered by Google App Engine
This is Rietveld 408576698