| 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 d5cb149bbadad2e2376a41eb6271ea81411e413f..4d508c4e3f0c9659736bcfbb68511ed15e50db15 100644
|
| --- a/content/browser/renderer_host/media/video_capture_device_client.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_device_client.cc
|
| @@ -270,21 +270,17 @@ VideoCaptureDeviceClient::ReserveOutputBuffer(
|
| // it's a ShMem GMB or a DmaBuf GMB.
|
| int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId;
|
| const int buffer_id = buffer_pool_->ReserveForProducer(
|
| - pixel_format, pixel_storage, frame_size, &buffer_id_to_drop);
|
| - if (buffer_id == VideoCaptureBufferPool::kInvalidId)
|
| - return NULL;
|
| -
|
| - scoped_ptr<media::VideoCaptureDevice::Client::Buffer> output_buffer(
|
| - new AutoReleaseBuffer(buffer_pool_, buffer_id));
|
| -
|
| + frame_size, pixel_format, pixel_storage, &buffer_id_to_drop);
|
| if (buffer_id_to_drop != VideoCaptureBufferPool::kInvalidId) {
|
| BrowserThread::PostTask(BrowserThread::IO,
|
| FROM_HERE,
|
| base::Bind(&VideoCaptureController::DoBufferDestroyedOnIOThread,
|
| controller_, buffer_id_to_drop));
|
| }
|
| -
|
| - return output_buffer;
|
| + if (buffer_id == VideoCaptureBufferPool::kInvalidId)
|
| + return nullptr;
|
| + return make_scoped_ptr<Buffer>(
|
| + new AutoReleaseBuffer(buffer_pool_, buffer_id));
|
| }
|
|
|
| void VideoCaptureDeviceClient::OnIncomingCapturedBuffer(
|
| @@ -340,6 +336,19 @@ void VideoCaptureDeviceClient::OnIncomingCapturedVideoFrame(
|
| timestamp));
|
| }
|
|
|
| +scoped_ptr<media::VideoCaptureDevice::Client::Buffer>
|
| +VideoCaptureDeviceClient::ResurrectLastOutputBuffer(
|
| + const gfx::Size& dimensions,
|
| + media::VideoPixelFormat format,
|
| + media::VideoPixelStorage storage) {
|
| + const int buffer_id =
|
| + buffer_pool_->ResurrectLastForProducer(dimensions, format, storage);
|
| + if (buffer_id == VideoCaptureBufferPool::kInvalidId)
|
| + return nullptr;
|
| + return make_scoped_ptr<Buffer>(
|
| + new AutoReleaseBuffer(buffer_pool_, buffer_id));
|
| +}
|
| +
|
| void VideoCaptureDeviceClient::OnError(
|
| const tracked_objects::Location& from_here,
|
| const std::string& reason) {
|
|
|