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

Side by Side Diff: webrtc/video/video_capture_input.cc

Issue 1335993003: Log timestamps when old frames are delivered. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 // Convert NTP time, in ms, to RTP timestamp. 96 // Convert NTP time, in ms, to RTP timestamp.
97 const int kMsToRtpTimestamp = 90; 97 const int kMsToRtpTimestamp = 90;
98 incoming_frame.set_timestamp( 98 incoming_frame.set_timestamp(
99 kMsToRtpTimestamp * static_cast<uint32_t>(incoming_frame.ntp_time_ms())); 99 kMsToRtpTimestamp * static_cast<uint32_t>(incoming_frame.ntp_time_ms()));
100 100
101 CriticalSectionScoped cs(capture_cs_.get()); 101 CriticalSectionScoped cs(capture_cs_.get());
102 if (incoming_frame.ntp_time_ms() <= last_captured_timestamp_) { 102 if (incoming_frame.ntp_time_ms() <= last_captured_timestamp_) {
103 // We don't allow the same capture time for two frames, drop this one. 103 // We don't allow the same capture time for two frames, drop this one.
104 LOG(LS_WARNING) << "Same/old NTP timestamp for incoming frame. Dropping."; 104 LOG(LS_WARNING) << "Same/old NTP timestamp ("
105 << incoming_frame.ntp_time_ms()
106 << " <= " << last_captured_timestamp_
107 << ") for incoming frame. Dropping.";
105 return; 108 return;
106 } 109 }
107 110
108 captured_frame_.ShallowCopy(incoming_frame); 111 captured_frame_.ShallowCopy(incoming_frame);
109 last_captured_timestamp_ = incoming_frame.ntp_time_ms(); 112 last_captured_timestamp_ = incoming_frame.ntp_time_ms();
110 113
111 overuse_detector_->FrameCaptured(captured_frame_.width(), 114 overuse_detector_->FrameCaptured(captured_frame_.width(),
112 captured_frame_.height(), 115 captured_frame_.height(),
113 captured_frame_.render_time_ms()); 116 captured_frame_.render_time_ms());
114 117
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 156 }
154 // We're done! 157 // We're done!
155 if (capture_time != -1) { 158 if (capture_time != -1) {
156 overuse_detector_->FrameSent(capture_time); 159 overuse_detector_->FrameSent(capture_time);
157 } 160 }
158 return true; 161 return true;
159 } 162 }
160 163
161 } // namespace internal 164 } // namespace internal
162 } // namespace webrtc 165 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698