Commit bcd0585f authored by emircan's avatar emircan Committed by Commit bot

Remove VideoCaptureDeviceClient buffer warning logs

VideoCaptureDeviceClient buffer warnings show that capture is
stopped. In most of the capture related errors, capture stops
and we print this warning for each following frame. As a result,
it is much harder to read through the error logs, such as below
as we print this line hundreds of times.

This CL addresses this issue by removing the logs and replacing with
a DCHECK that comes in after consistent errors.

https://build.chromium.org/p/chromium.webrtc/builders/Win8%20Tester/builds/26646/steps/browser_tests/logs/stdio

Review-Url: https://codereview.chromium.org/2124073006
Cr-Commit-Position: refs/heads/master@{#405274}
parent c875b8ba
......@@ -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;
if (dropped_frame_counter_ >= kMaxDroppedFrames)
OnError(FROM_HERE, "Too many frames dropped");
#endif
// Failed to reserve I420 output buffer, so drop the frame.
if (!buffer.get())
return;
}
const int yplane_stride = dimensions.width();
const int uv_plane_stride = yplane_stride / 2;
......
......@@ -103,6 +103,14 @@ class CONTENT_EXPORT VideoCaptureDeviceClient
// The pool of shared-memory buffers used for capturing.
const scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
#if DCHECK_IS_ON()
// Counter used to track the number of times consecutive capture buffers are
// dropped.
int dropped_frame_counter_ = 0;
static const int kMaxDroppedFrames = 150;
#endif // DCHECK_IS_ON()
// Indication to the Client to copy-transform the incoming data into
// GpuMemoryBuffers.
const bool use_gpu_memory_buffers_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment