Commit d99b0d41 authored by Palak Agarwal's avatar Palak Agarwal Committed by Commit Bot

[VideoCapture] Limit logging of first frame in VideoCaptureImpl

Bug: 974149
Change-Id: Ie4753ea473fbfd8448d772c1e07d440e74085ace
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377718Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Palak Agarwal <agpalak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802885}
parent 856849e1
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
namespace blink { namespace blink {
constexpr int kMaxFirstFrameLogs = 5;
using VideoFrameBufferHandleType = media::mojom::blink::VideoBufferHandle::Tag; using VideoFrameBufferHandleType = media::mojom::blink::VideoBufferHandle::Tag;
// A collection of all types of handles that we use to reference a camera buffer // A collection of all types of handles that we use to reference a camera buffer
...@@ -514,7 +516,15 @@ void VideoCaptureImpl::OnBufferReady( ...@@ -514,7 +516,15 @@ void VideoCaptureImpl::OnBufferReady(
if (first_frame_ref_time_.is_null()) { if (first_frame_ref_time_.is_null()) {
first_frame_ref_time_ = reference_time; first_frame_ref_time_ = reference_time;
OnLog("First frame received at VideoCaptureImpl"); if (num_first_frame_logs_ < kMaxFirstFrameLogs) {
OnLog("First frame received for this VideoCaptureImpl instance");
num_first_frame_logs_++;
} else if (num_first_frame_logs_ == kMaxFirstFrameLogs) {
OnLog(
"First frame received for this VideoCaptureImpl instance. This will "
"not be logged anymore for this VideoCaptureImpl instance.");
num_first_frame_logs_++;
}
} }
// If the timestamp is not prepared, we use reference time to make a rough // If the timestamp is not prepared, we use reference time to make a rough
......
...@@ -174,6 +174,8 @@ class PLATFORM_EXPORT VideoCaptureImpl ...@@ -174,6 +174,8 @@ class PLATFORM_EXPORT VideoCaptureImpl
VideoCaptureState state_; VideoCaptureState state_;
int num_first_frame_logs_ = 0;
// Methods of |gpu_factories_| need to run on |media_task_runner_|. // Methods of |gpu_factories_| need to run on |media_task_runner_|.
media::GpuVideoAcceleratorFactories* gpu_factories_; media::GpuVideoAcceleratorFactories* gpu_factories_;
scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
......
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