| Index: content/browser/renderer_host/media/video_capture_controller.cc
|
| diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
|
| index 4b6d4b94b1e0fca3c3d4827a4c0bb200130f42ea..deecf3b999bc2bb0f2ad6e61bcd6666d4ae934cb 100644
|
| --- a/content/browser/renderer_host/media/video_capture_controller.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_controller.cc
|
| @@ -179,6 +179,9 @@ class VideoCaptureController::VideoCaptureDeviceClient
|
|
|
| // The pool of shared-memory buffers used for capturing.
|
| const scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
|
| +
|
| + // Number of frames dropped due to that no shared buffers are available.
|
| + int frames_dropped_;
|
| };
|
|
|
| VideoCaptureController::VideoCaptureController(int max_buffers)
|
| @@ -191,7 +194,7 @@ VideoCaptureController::VideoCaptureController(int max_buffers)
|
| VideoCaptureController::VideoCaptureDeviceClient::VideoCaptureDeviceClient(
|
| const base::WeakPtr<VideoCaptureController>& controller,
|
| const scoped_refptr<VideoCaptureBufferPool>& buffer_pool)
|
| - : controller_(controller), buffer_pool_(buffer_pool) {}
|
| + : controller_(controller), buffer_pool_(buffer_pool), frames_dropped_(0) {}
|
|
|
| VideoCaptureController::VideoCaptureDeviceClient::~VideoCaptureDeviceClient() {}
|
|
|
| @@ -365,8 +368,11 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedData(
|
| scoped_refptr<Buffer> buffer =
|
| DoReserveOutputBuffer(media::VideoFrame::I420, dimensions);
|
|
|
| - if (!buffer.get())
|
| + if (!buffer.get()) {
|
| + ++frames_dropped_;
|
| return;
|
| + }
|
| +
|
| uint8* yplane = NULL;
|
| bool flip = false;
|
| yplane = reinterpret_cast<uint8*>(buffer->data());
|
| @@ -468,6 +474,7 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedData(
|
|
|
| VideoCaptureFormat format(
|
| dimensions, frame_format.frame_rate, media::PIXEL_FORMAT_I420);
|
| + format.number_of_dropped_frames = frames_dropped_;
|
| BrowserThread::PostTask(
|
| BrowserThread::IO,
|
| FROM_HERE,
|
|
|