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

Issue 1064963002: VideoCapture: add support for GpuMemoryBuffer allocation and lifetime mgmt in VideoCaptureBufferPool (Closed)

Created:
5 years, 8 months ago by mcasas
Modified:
5 years, 8 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

VideoCapture: add support for GpuMemoryBuffer allocation and lifetime mgmt in VideoCaptureBufferPool & relatives - This CL adds support for GpuMemoryBufferTracker in addition to the existing SharedMemTracker. - A GpuMemoryBufferTracker owns a GpuMemoryBuffer, which can only be accessed byte-wise between Map() and Unmap(). - For that reason, instead of making a VCBP::Tracker directly accessible via |void* data| and |size|, a BufferHandle abstraction is introduced. - VideoCaptureDeviceClient then defines its own AutoReleaseBuffer in terms of this new BufferHandle. This BufferHandle is supposed to stay Map()ed and ready to use for the duration of its lifetime. Summing up: * VideoCaptureBufferPool has a pool of Trackers, * from the VCBP we can get a BufferHandle per |buffer_id|, * from a BufferHandle we can obtain data(), valid and Map()ed as long as the BufferHandle itself exists. - VideoCaptureDevice::ReserveOutputBuffer() changes to return a scoped_ptr<Buffer> ISO a scoped_refptr. - Added VideoCaptureDevice::OnIncomingCapturedBuffer() to pass directly a Buffer with the capture contents. - video_capture_texture_wrapper.{cc,h} is removed and its contents are merged into VideoCaptureDeviceClient. - FakeVideoCaptureDevice learns how to produce GpuMemoryBuffers. Also, PIXEL_FORMAT_GPUMEMORYBUFFER is added. Summing up, VCDClient accepts: * memory backed buffers (the usual) * texture-backed buffers * GMB-backed buffers (these are wrapped into a Texture VideoFrame indistinguishable from the previous case) - VideoCaptureTextureWrapper files are gone and its contents folded into VideoCaptureDeviceClient. - Unittests are updated, and so is FakeVideoCaptureDevice. BUG=440843 Committed: https://crrev.com/abeb15fa955c570cd481accb04c2a677eb2865a9 Cr-Commit-Position: refs/heads/master@{#326171}

Patch Set 1 : #

Total comments: 14

Patch Set 2 : emircan@s and miu@s comments; necessary rebase #

Total comments: 22

Patch Set 3 : miu@s comments #

Total comments: 22

Patch Set 4 : miu@s comments (2) #

Patch Set 5 : miu@s nits #

Patch Set 6 : Reverted VCD::Client::~Buffer() implemented in .cc file #

Total comments: 1

Patch Set 7 : VideoCaptureDevice::Client::Buffer::~Buffer() pure virtual. Avoid using base::MessageLoopProxy::cur… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1085 lines, -1045 lines) Patch
M content/browser/BUILD.gn View 1 1 chunk +0 lines, -6 lines 0 comments Download
M content/browser/media/capture/content_video_capture_device_core.h View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/media/capture/content_video_capture_device_core.cc View 1 4 chunks +5 lines, -5 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_aura_unittest.cc View 1 2 1 chunk +21 lines, -7 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_unittest.cc View 1 2 1 chunk +21 lines, -7 lines 0 comments Download
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 4 chunks +44 lines, -40 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.h View 1 2 5 chunks +25 lines, -14 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.cc View 1 2 7 chunks +140 lines, -31 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 1 2 3 chunks +184 lines, -76 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 6 chunks +14 lines, -28 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 1 2 3 4 5 6 11 chunks +71 lines, -75 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client.h View 1 2 3 4 3 chunks +20 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client.cc View 1 2 3 4 9 chunks +376 lines, -74 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
D content/browser/renderer_host/media/video_capture_texture_wrapper.h View 1 chunk +0 lines, -62 lines 0 comments Download
D content/browser/renderer_host/media/video_capture_texture_wrapper.cc View 1 1 chunk +0 lines, -463 lines 0 comments Download
M content/content_browser.gypi View 1 1 chunk +0 lines, -6 lines 0 comments Download
M content/public/common/content_switches.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M content/public/common/content_switches.cc View 1 1 chunk +0 lines, -6 lines 0 comments Download
M media/base/video_capture_types.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M media/base/video_capture_types.cc View 1 2 chunks +5 lines, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
M media/video/capture/fake_video_capture_device.cc View 1 3 chunks +62 lines, -66 lines 0 comments Download
M media/video/capture/fake_video_capture_device_factory.cc View 1 2 chunks +6 lines, -5 lines 0 comments Download
M media/video/capture/fake_video_capture_device_unittest.cc View 1 4 chunks +32 lines, -27 lines 0 comments Download
M media/video/capture/video_capture_device.h View 1 2 3 4 5 6 3 chunks +17 lines, -13 lines 0 comments Download
M media/video/capture/video_capture_device.cc View 1 3 4 6 1 chunk +2 lines, -0 lines 0 comments Download
M media/video/capture/video_capture_device_unittest.cc View 1 3 chunks +31 lines, -17 lines 0 comments Download

Messages

Total messages: 51 (29 generated)
mcasas
miu@, emircan@ PTAL.
5 years, 8 months ago (2015-04-11 00:11:02 UTC) #13
mcasas
avi@: content/public/common/content_switches.{cc,h}, removing the test/experimental flag as promised.
5 years, 8 months ago (2015-04-11 00:12:37 UTC) #15
Avi (use Gerrit)
Flag removal LGTM; thank you!
5 years, 8 months ago (2015-04-13 21:11:10 UTC) #17
emircan
https://codereview.chromium.org/1064963002/diff/240001/content/browser/renderer_host/media/video_capture_buffer_pool.cc File content/browser/renderer_host/media/video_capture_buffer_pool.cc (right): https://codereview.chromium.org/1064963002/diff/240001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode55 content/browser/renderer_host/media/video_capture_buffer_pool.cc:55: gmb_->Map(&data_); Map() can fill multiple ptrs. Since you are ...
5 years, 8 months ago (2015-04-13 21:31:30 UTC) #18
miu
Initial design-level comments: https://codereview.chromium.org/1064963002/diff/240001/content/browser/media/capture/content_video_capture_device_core.cc File content/browser/media/capture/content_video_capture_device_core.cc (right): https://codereview.chromium.org/1064963002/diff/240001/content/browser/media/capture/content_video_capture_device_core.cc#newcode121 content/browser/media/capture/content_video_capture_device_core.cc:121: const scoped_ptr<media::DataHandle> scoped_data_handle( Why is the ...
5 years, 8 months ago (2015-04-15 19:12:40 UTC) #19
mcasas
miu@, emircan@ PTAL. (there are a few comments on my own), please ignore. https://codereview.chromium.org/1064963002/diff/240001/content/browser/media/capture/content_video_capture_device_core.cc File ...
5 years, 8 months ago (2015-04-16 03:11:22 UTC) #21
mcasas
On 2015/04/16 03:11:22, mcasas wrote: > miu@, emircan@ PTAL. > > (there are a few ...
5 years, 8 months ago (2015-04-16 03:13:15 UTC) #22
miu
Still reviewing, but looking good through to video_capture_controller.cc... https://codereview.chromium.org/1064963002/diff/280001/content/browser/media/capture/desktop_capture_device_aura_unittest.cc File content/browser/media/capture/desktop_capture_device_aura_unittest.cc (right): https://codereview.chromium.org/1064963002/diff/280001/content/browser/media/capture/desktop_capture_device_aura_unittest.cc#newcode61 content/browser/media/capture/desktop_capture_device_aura_unittest.cc:61: const ...
5 years, 8 months ago (2015-04-18 00:22:01 UTC) #23
mcasas
miu@ please continue review when ready. dalecurtis@: media/base/video_capture_types.* https://codereview.chromium.org/1064963002/diff/280001/content/browser/media/capture/desktop_capture_device_aura_unittest.cc File content/browser/media/capture/desktop_capture_device_aura_unittest.cc (right): https://codereview.chromium.org/1064963002/diff/280001/content/browser/media/capture/desktop_capture_device_aura_unittest.cc#newcode61 content/browser/media/capture/desktop_capture_device_aura_unittest.cc:61: const ...
5 years, 8 months ago (2015-04-20 17:25:48 UTC) #25
DaleCurtis
media/base lgtm
5 years, 8 months ago (2015-04-20 18:22:46 UTC) #27
miu
https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.cc File content/browser/renderer_host/media/video_capture_device_client.cc (right): https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.cc#newcode168 content/browser/renderer_host/media/video_capture_device_client.cc:168: //linked_ptr<gfx::GpuMemoryBuffer> memory_buffer, Please remove commented-out arg. https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.cc#newcode178 content/browser/renderer_host/media/video_capture_device_client.cc:178: const ...
5 years, 8 months ago (2015-04-20 20:34:57 UTC) #29
mcasas
miu@ PTAL https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.cc File content/browser/renderer_host/media/video_capture_device_client.cc (right): https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.cc#newcode168 content/browser/renderer_host/media/video_capture_device_client.cc:168: //linked_ptr<gfx::GpuMemoryBuffer> memory_buffer, On 2015/04/20 20:34:56, miu wrote: ...
5 years, 8 months ago (2015-04-20 22:24:08 UTC) #30
miu
lgtm https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.h File content/browser/renderer_host/media/video_capture_device_client.h (right): https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.h#newcode78 content/browser/renderer_host/media/video_capture_device_client.h:78: class TextureWrapperDelegate; On 2015/04/20 22:24:07, mcasas wrote: > ...
5 years, 8 months ago (2015-04-21 04:41:24 UTC) #33
mcasas
https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.h File content/browser/renderer_host/media/video_capture_device_client.h (right): https://codereview.chromium.org/1064963002/diff/340001/content/browser/renderer_host/media/video_capture_device_client.h#newcode78 content/browser/renderer_host/media/video_capture_device_client.h:78: class TextureWrapperDelegate; On 2015/04/21 04:41:24, miu wrote: > On ...
5 years, 8 months ago (2015-04-21 21:21:08 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1064963002/440001
5 years, 8 months ago (2015-04-21 21:22:12 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/57866)
5 years, 8 months ago (2015-04-21 21:34:07 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1064963002/460001
5 years, 8 months ago (2015-04-21 22:11:25 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1064963002/480001
5 years, 8 months ago (2015-04-21 22:33:30 UTC) #47
commit-bot: I haz the power
Committed patchset #7 (id:480001)
5 years, 8 months ago (2015-04-21 23:37:07 UTC) #48
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/abeb15fa955c570cd481accb04c2a677eb2865a9 Cr-Commit-Position: refs/heads/master@{#326171}
5 years, 8 months ago (2015-04-21 23:40:01 UTC) #49
magjed_chromium
A revert of this CL (patchset #7 id:480001) has been created in https://codereview.chromium.org/1090273006/ by magjed@chromium.org. ...
5 years, 8 months ago (2015-04-22 09:03:11 UTC) #50
magjed_chromium
5 years, 8 months ago (2015-04-22 10:42:37 UTC) #51
Message was sent while issue was closed.
Reverting this CL did fix the failing unittests so look into that before
relanding this CL.

Powered by Google App Engine
This is Rietveld 408576698