DescriptionPass 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 #Messages
Total messages: 46 (25 generated)
|