Chromium Code Reviews| 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 f6f8cba1aa5ae165026c78a387bfb3508d2f8dc9..7d8046e3a03c5f2f9e22b39dfaa9e0ddc14aad80 100644 |
| --- a/content/browser/renderer_host/media/video_capture_device_client.cc |
| +++ b/content/browser/renderer_host/media/video_capture_device_client.cc |
| @@ -138,10 +138,14 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData( |
| std::unique_ptr<Buffer> buffer( |
| ReserveI420OutputBuffer(dimensions, output_pixel_storage, &y_plane_data, |
| &u_plane_data, &v_plane_data)); |
| - if (!buffer.get()) { |
| - DLOG(WARNING) << "Failed to reserve I420 output buffer."; |
| +#if DCHECK_IS_ON() |
| + dropped_frame_counter_ = buffer.get() ? 0 : dropped_frame_counter_ + 1; |
| + DCHECK_LT(dropped_frame_counter_, 150u) |
|
mcasas
2016/07/13 00:31:36
I'd recommend defining a constant
static const i
emircan
2016/07/13 17:51:14
Changed |dropped_frame_counter_| to int and declar
emircan
2016/07/13 18:24:55
Nvm. I just realized OnError is a call within this
|
| + << " Dropped too many consecutive captured frames."; |
| +#endif |
| + // Failed to reserve I420 output buffer, so drop the frame. |
|
mcasas
2016/07/13 00:31:36
nit: Shift l.146 two spaces left.
emircan
2016/07/13 17:51:14
Done.
|
| + if (!buffer.get()) |
| return; |
| - } |
| const int yplane_stride = dimensions.width(); |
| const int uv_plane_stride = yplane_stride / 2; |