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

Issue 1267883002: Pass GpuMemoryBuffer backed VideoFrame from browser to renderer processes (Closed)

Created:
5 years, 4 months ago by emircan
Modified:
5 years, 3 months ago
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, miu+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@gmbtracker-multiple
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Pass GpuMemoryBuffer backed VideoFrame from browser to renderer processes This is a CL for Video Capture using GpuMemoryBuffers plan[0]. The plans for future CLs can be seen on [1]. [0] https://docs.google.com/document/d/1lobWf168_Kq05TLNLX81gRQwY5oe4k2t3oP-XTBEpIo/edit#heading=h.lflt7hoq3oui [1] https://docs.google.com/document/d/1lobWf168_Kq05TLNLX81gRQwY5oe4k2t3oP-XTBEpIo/edit#heading=h.exy0h9917c1d - Changed VideoCaptureBufferPool::ShareToProcess() method to handle sharing both SharedMemory and GpuMemoryBuffer backed video frames. - Added VideoCaptureBufferPool::GpuMemoryBufferTracker::ShareToProcess() for sharing GMB backed buffers. - Added dimensions() method to media::VideoCaptureDevice::Client::Buffer and VideoCaptureBufferPool::BufferHandle interfaces as required by GMB mapping. Also, renamed size() to mapped_size() to avoid confusion. - Added OnGpuMemoryBufferCreated() calls between Browser and Renderer to notify the creation of GMB backed buffers and pass handles. - Added VideoCaptureImpl::ClientGpuMemoryBuffer on Renderer side to create&map new GMB client buffers. Also, buffer reuse and destruction is handled behind VideoCaptureDeviceClient::AutoReleaseBuffer like listed below: Buffer Creation *Browser VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread - ShareToProcess(Renderer) VideoCaptureHost::OnBufferCreated *Renderer VideoCaptureMessageFilter::OnBufferCreated VideoCaptureImpl::OnBufferCreated - Adds to client_buffers_ Buffer Reuse *Renderer VideoCaptureImpl::OnClientBufferFinished *Browser VideoCaptureHost::OnRendererFinishedWithBuffer VideoCaptureController::ReturnBuffer VideoCaptureBufferPool::RelinquishConsumerHold ~AutoReleaseBuffer VideoCaptureBufferPool::RelinquishProducerReservation BUG=440843, 503835 TEST= - Without the kUseGpuMemoryBuffersForCapture flag, AppRTC loopback runs as before. - With the flag, AppRTC loopback crashes in VideoCaptureHost::OnBufferReady as expected. Committed: https://crrev.com/b479059b5368c433bb6a321f53c54f67b0081433 Cr-Commit-Position: refs/heads/master@{#346414}

Patch Set 1 : #

Patch Set 2 : Rebase #

Total comments: 30

Patch Set 3 : mcasas comments. #

Patch Set 4 : reveman@ comment: rename functions #

Patch Set 5 : reveman@ comment: remove multiple textures. #

Total comments: 53

Patch Set 6 : reveman@ comments. #

Total comments: 11

Patch Set 7 : mcasas@ comments. #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+414 lines, -140 lines) Patch
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.h View 1 2 3 4 5 3 chunks +13 lines, -8 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.cc View 1 2 3 4 5 6 9 chunks +86 lines, -31 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 6 chunks +12 lines, -12 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 7 1 chunk +35 lines, -20 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_event_handler.h View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 1 2 3 4 5 7 chunks +13 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client.cc View 5 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_host.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.cc View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager_unittest.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/media/video_capture_messages.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M content/renderer/media/video_capture_impl.h View 1 2 3 4 5 3 chunks +26 lines, -13 lines 0 comments Download
M content/renderer/media/video_capture_impl.cc View 1 2 3 4 5 6 7 9 chunks +117 lines, -28 lines 0 comments Download
M content/renderer/media/video_capture_message_filter.h View 1 2 3 4 5 3 chunks +24 lines, -8 lines 0 comments Download
M content/renderer/media/video_capture_message_filter.cc View 1 2 3 4 5 2 chunks +23 lines, -1 line 0 comments Download
M content/renderer/media/video_capture_message_filter_unittest.cc View 1 2 3 4 5 2 chunks +9 lines, -4 lines 0 comments Download
M media/capture/content/thread_safe_capture_oracle.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/capture/video/fake_video_capture_device.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/capture/video/fake_video_capture_device_unittest.cc View 2 chunks +7 lines, -4 lines 0 comments Download
M media/capture/video/video_capture_device.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 46 (25 generated)
emircan
PTAL. reveman@, I am sharing GMB handles from GPU process to the Renderer on "content/browser/renderer_host/media/video_capture_buffer_pool.cc". ...
5 years, 4 months ago (2015-08-19 01:42:54 UTC) #13
reveman
A few high level questions. - Do we need both the shared memory capture buffer ...
5 years, 4 months ago (2015-08-19 16:16:09 UTC) #18
emircan
Thanks David. My reviewers are finally online and I got the first CLs in, so ...
5 years, 4 months ago (2015-08-19 18:05:38 UTC) #19
reveman
On 2015/08/19 at 18:05:38, emircan wrote: > Thanks David. My reviewers are finally online and ...
5 years, 4 months ago (2015-08-20 11:08:55 UTC) #20
emircan
On 2015/08/20 11:08:55, reveman wrote: > Can we instead start by replacing shared memory case ...
5 years, 4 months ago (2015-08-20 17:36:44 UTC) #21
chromium-reviews
I would recommend adding the GMB 3buffer next to the current ShMem case and not ...
5 years, 4 months ago (2015-08-20 18:39:40 UTC) #22
reveman
On 2015/08/20 at 17:36:44, emircan wrote: > On 2015/08/20 11:08:55, reveman wrote: > > Can ...
5 years, 4 months ago (2015-08-20 18:56:30 UTC) #23
mcasas
https://codereview.chromium.org/1267883002/diff/370001/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/1267883002/diff/370001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode238 content/browser/renderer_host/media/video_capture_buffer_pool.cc:238: const auto& cur_gmb_handle = gpu_memory_buffers_[plane]->GetHandle(); current_gmb_handle? https://codereview.chromium.org/1267883002/diff/370001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode242 content/browser/renderer_host/media/video_capture_buffer_pool.cc:242: case ...
5 years, 4 months ago (2015-08-21 03:57:25 UTC) #28
emircan
PTAL. mcasas@, I addressed your comments in PS#3. reveman@, I renamed the functions in PS#4 ...
5 years, 4 months ago (2015-08-22 03:13:27 UTC) #31
reveman
https://codereview.chromium.org/1267883002/diff/470001/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/1267883002/diff/470001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode126 content/browser/renderer_host/media/video_capture_buffer_pool.cc:126: process_handle, static_cast<base::SharedMemoryHandle*>(new_handle)); can you refactor this to avoid this ...
5 years, 3 months ago (2015-08-26 11:54:05 UTC) #32
emircan
PTAL https://codereview.chromium.org/1267883002/diff/470001/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/1267883002/diff/470001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode126 content/browser/renderer_host/media/video_capture_buffer_pool.cc:126: process_handle, static_cast<base::SharedMemoryHandle*>(new_handle)); On 2015/08/26 11:54:04, reveman wrote: > ...
5 years, 3 months ago (2015-08-26 21:23:12 UTC) #33
reveman
lgtm https://codereview.chromium.org/1267883002/diff/470001/content/browser/renderer_host/media/video_capture_host.cc File content/browser/renderer_host/media/video_capture_host.cc (right): https://codereview.chromium.org/1267883002/diff/470001/content/browser/renderer_host/media/video_capture_host.cc#newcode75 content/browser/renderer_host/media/video_capture_host.cc:75: if (entries_.find(controller_id) == entries_.end()) On 2015/08/26 at 21:23:11, ...
5 years, 3 months ago (2015-08-27 00:21:24 UTC) #34
mcasas
LGTM % comments/questions https://codereview.chromium.org/1267883002/diff/490001/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/1267883002/diff/490001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode248 content/browser/renderer_host/media/video_capture_buffer_pool.cc:248: gfx::GpuMemoryBufferHandle* const new_gmb_handle = Remove |new_gmb_handle| ...
5 years, 3 months ago (2015-08-27 18:26:56 UTC) #35
emircan
Thanks. https://codereview.chromium.org/1267883002/diff/490001/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/1267883002/diff/490001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode248 content/browser/renderer_host/media/video_capture_buffer_pool.cc:248: gfx::GpuMemoryBufferHandle* const new_gmb_handle = On 2015/08/27 18:26:55, mcasas ...
5 years, 3 months ago (2015-08-27 22:01:06 UTC) #36
emircan
wfh@chromium.org: Please review changes in content/common/media/video_capture_messages.h dalecurtis@chromium.org: Please review changes in content/renderer/* and content/browser/media/capture/web_contents_video_capture_device_unittest.cc
5 years, 3 months ago (2015-08-27 22:03:29 UTC) #38
DaleCurtis
rs lgtm
5 years, 3 months ago (2015-08-27 22:27:50 UTC) #39
Will Harris
The new IPC - VideoCaptureMsg_NewBuffer2 takes buffer from ShareToProcess2 which isn't implemented in this CL. ...
5 years, 3 months ago (2015-08-27 22:31:36 UTC) #40
emircan
On 2015/08/27 22:31:36, Will Harris wrote: > The new IPC - VideoCaptureMsg_NewBuffer2 takes buffer from ...
5 years, 3 months ago (2015-08-27 22:46:02 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1267883002/530001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1267883002/530001
5 years, 3 months ago (2015-08-31 17:47:42 UTC) #44
commit-bot: I haz the power
Committed patchset #8 (id:530001)
5 years, 3 months ago (2015-08-31 17:53:20 UTC) #45
commit-bot: I haz the power
5 years, 3 months ago (2015-08-31 17:54:03 UTC) #46
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/b479059b5368c433bb6a321f53c54f67b0081433
Cr-Commit-Position: refs/heads/master@{#346414}

Powered by Google App Engine
This is Rietveld 408576698