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

Issue 1106563002: FakeVideoCaptureDevice: add support for capturing into Dma-Bufs using VGEM in CrOs (Closed)

Created:
5 years, 8 months ago by mcasas
Modified:
5 years, 1 month ago
Reviewers:
emircan, dshwang, marcheu
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

FakeVideoCaptureDevice: add support for capturing into Dma-Bufs using VGEM in CrOs This CL adds support in FakeVideoCaptureDevice such that if the Buffer returned from Client::ReserveOutputBuffer() is nullptr, then try to obtain it AsPlatformFile(). The returned PlatformFile is an |fd| and is mmap()ed via vgem dumb API. vgem+dumb is a kernel API present in CrOS and for certain DRM drivers, notably xf86 i915. This CL also adds an AsPlatformFile() method to VideoCaptureBufferPool::Handle and to VideoCaptureDevice::Client::Buffer. The idea is to give the VideoCaptureDevice the possibility to extract Buffer's underlying file descriptors if the data() coming out of a ReserveOutputBuffer() is nullptr. BUG=440843

Patch Set 1 #

Total comments: 9

Patch Set 2 : ermircan@ comments; removed GpuMemoryBuffer modifications (go in other CL) #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -8 lines) Patch
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.cc View 1 5 chunks +19 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M media/media.gyp View 1 1 chunk +5 lines, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device.cc View 1 5 chunks +129 lines, -3 lines 1 comment Download
M media/video/capture/fake_video_capture_device_unittest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M media/video/capture/video_capture_device.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M ui/gfx/gpu_memory_buffer.h View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 24 (18 generated)
mcasas
emircan@ please have a first critical reading. Does this coincide with your understandings?
5 years, 8 months ago (2015-04-22 23:28:12 UTC) #2
emircan
It is a good idea to add PlatformFile. Also, the use of dumb buffers looks ...
5 years, 8 months ago (2015-04-27 16:35:42 UTC) #4
mcasas
emircan@ please have another look. marcheu@ PTAL fake_video_capture_device.cc vgem parts https://codereview.chromium.org/1106563002/diff/40001/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/1106563002/diff/40001/content/browser/renderer_host/media/video_capture_buffer_pool.cc#newcode57 ...
5 years, 7 months ago (2015-05-07 15:59:46 UTC) #20
dshwang
https://codereview.chromium.org/1106563002/diff/290001/media/video/capture/fake_video_capture_device.cc File media/video/capture/fake_video_capture_device.cc (right): https://codereview.chromium.org/1106563002/diff/290001/media/video/capture/fake_video_capture_device.cc#newcode67 media/video/capture/fake_video_capture_device.cc:67: base::FileEnumerator::FILES, false, base::FileEnumerator::DIRECTORIES, I use this logic in https://codereview.chromium.org/1124063003/ ...
5 years, 7 months ago (2015-05-12 12:58:44 UTC) #22
mcasas
On 2015/05/12 12:58:44, dshwang wrote: > https://codereview.chromium.org/1106563002/diff/290001/media/video/capture/fake_video_capture_device.cc > File media/video/capture/fake_video_capture_device.cc (right): > > https://codereview.chromium.org/1106563002/diff/290001/media/video/capture/fake_video_capture_device.cc#newcode67 > ...
5 years, 7 months ago (2015-05-12 19:11:32 UTC) #23
mcasas
5 years, 1 month ago (2015-11-04 21:31:34 UTC) #24
On 2015/05/12 19:11:32, mcasas wrote:
> On 2015/05/12 12:58:44, dshwang wrote:
> >
>
https://codereview.chromium.org/1106563002/diff/290001/media/video/capture/fa...
> > File media/video/capture/fake_video_capture_device.cc (right):
> > 
> >
>
https://codereview.chromium.org/1106563002/diff/290001/media/video/capture/fa...
> > media/video/capture/fake_video_capture_device.cc:67:
> > base::FileEnumerator::FILES,
> > false, base::FileEnumerator::DIRECTORIES,
> > 
> > I use this logic in https://codereview.chromium.org/1124063003/ as mcasas
> > advised.
> > How about getting vgem fd from drm_display_host_manager.cc, instead of
opening
> > fd in ad-hoc way?
> 
> Media can't open a communication channel to Gpu process, it might need to be
> done in VideoCaptureBufferPool, when creating the Buffer Handle [1]. It 
> would be great if VCBP could abstract the implementation, and FakeVCD
> be completely agnostic. I'll wait until your CL is done and then 
> probably refactor this CL.
> 
> [1]
>
https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/re...

Hey guys, I'm closing this issue since is not applicable 
anymore: users of GMBs should not extract their underlying
storages, and instead just use Map()-Unmap(). Thanks
for your time.

Powered by Google App Engine
This is Rietveld 408576698