Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: webrtc/video/video_capture_input.cc

Issue 2298213002: Add periodic logging of number of captured and dropped frames in VideoCaptureInput. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_capture_input.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « webrtc/video/video_capture_input.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698