Chromium Code Reviews| Index: webrtc/video/video_capture_input.cc |
| diff --git a/webrtc/video/video_capture_input.cc b/webrtc/video/video_capture_input.cc |
| index 8f574e21154d7abddca59dcf46b28d476866d5dc..7777f45b220ebcfde66bfc4ffffb491c48abb7dc 100644 |
| --- a/webrtc/video/video_capture_input.cc |
| +++ b/webrtc/video/video_capture_input.cc |
| @@ -21,6 +21,9 @@ |
| #include "webrtc/video/vie_encoder.h" |
| namespace webrtc { |
| +namespace { |
| +const int64_t kFrameLogIntervalMs = 60000; |
| +} // namespace |
| namespace internal { |
| VideoCaptureInput::VideoCaptureInput( |
| @@ -38,7 +41,10 @@ VideoCaptureInput::VideoCaptureInput( |
| last_captured_timestamp_(0), |
| delta_ntp_internal_ms_(clock_->CurrentNtpInMilliseconds() - |
| clock_->TimeInMilliseconds()), |
| - overuse_detector_(overuse_detector) {} |
| + overuse_detector_(overuse_detector), |
| + last_frame_log_ms_(clock_->TimeInMilliseconds()), |
| + captured_frame_count_(0), |
| + dropped_frame_count_(0) {} |
| VideoCaptureInput::~VideoCaptureInput() { |
| } |
| @@ -83,6 +89,10 @@ void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { |
| return; |
| } |
| + ++captured_frame_count_; |
| + if (captured_frame_.get()) |
| + ++dropped_frame_count_; |
| + |
| captured_frame_.reset(new VideoFrame); |
| captured_frame_->ShallowCopy(incoming_frame); |
| last_captured_timestamp_ = incoming_frame.ntp_time_ms(); |
| @@ -92,6 +102,12 @@ void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { |
| TRACE_EVENT_ASYNC_BEGIN1("webrtc", "Video", video_frame.render_time_ms(), |
| "render_time", video_frame.render_time_ms()); |
| + if (current_time - last_frame_log_ms_ > kFrameLogIntervalMs) { |
| + last_frame_log_ms_ = current_time; |
| + LOG(LS_INFO) << "Number of frames: captured " << captured_frame_count_ |
|
mflodman
2016/09/02 08:46:02
I'd prefer to log the number of frames for the las
mnilsson
2016/09/02 09:21:10
Yes, resetting the count will make it easier to se
åsapersson
2016/09/02 10:19:43
Done.
åsapersson
2016/09/02 10:19:43
Done.
|
| + << ", dropped " << dropped_frame_count_; |
| + } |
| + |
| capture_event_->Set(); |
| } |