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

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

Issue 2385763002: Add stats for frequency offset when converting RTP timestamp to NTP time. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « webrtc/video/stream_synchronization_unittest.cc ('k') | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return stats_proxy_.GetStats(); 339 return stats_proxy_.GetStats();
340 } 340 }
341 341
342 // TODO(tommi): This method grabs a lock 6 times. 342 // TODO(tommi): This method grabs a lock 6 times.
343 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { 343 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) {
344 // TODO(tommi): OnDecodedFrame grabs a lock, incidentally the same lock 344 // TODO(tommi): OnDecodedFrame grabs a lock, incidentally the same lock
345 // that OnSyncOffsetUpdated() and OnRenderedFrame() below grab. 345 // that OnSyncOffsetUpdated() and OnRenderedFrame() below grab.
346 stats_proxy_.OnDecodedFrame(); 346 stats_proxy_.OnDecodedFrame();
347 347
348 int64_t sync_offset_ms; 348 int64_t sync_offset_ms;
349 double estimated_freq_khz;
349 // TODO(tommi): GetStreamSyncOffsetInMs grabs three locks. One inside the 350 // TODO(tommi): GetStreamSyncOffsetInMs grabs three locks. One inside the
350 // function itself, another in GetChannel() and a third in 351 // function itself, another in GetChannel() and a third in
351 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function 352 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function
352 // succeeds most of the time, which leads to grabbing a fourth lock. 353 // succeeds most of the time, which leads to grabbing a fourth lock.
353 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms)) { 354 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame, &sync_offset_ms,
355 &estimated_freq_khz)) {
354 // TODO(tommi): OnSyncOffsetUpdated grabs a lock. 356 // TODO(tommi): OnSyncOffsetUpdated grabs a lock.
355 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms); 357 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms, estimated_freq_khz);
356 } 358 }
357 359
358 // config_.renderer must never be null if we're getting this callback. 360 // config_.renderer must never be null if we're getting this callback.
359 config_.renderer->OnFrame(video_frame); 361 config_.renderer->OnFrame(video_frame);
360 362
361 // TODO(tommi): OnRenderFrame grabs a lock too. 363 // TODO(tommi): OnRenderFrame grabs a lock too.
362 stats_proxy_.OnRenderedFrame(video_frame); 364 stats_proxy_.OnRenderedFrame(video_frame);
363 } 365 }
364 366
365 // TODO(asapersson): Consider moving callback from video_encoder.h or 367 // TODO(asapersson): Consider moving callback from video_encoder.h or
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 RequestKeyFrame(); 421 RequestKeyFrame();
420 } 422 }
421 } 423 }
422 424
423 void VideoReceiveStream::RequestKeyFrame() { 425 void VideoReceiveStream::RequestKeyFrame() {
424 rtp_stream_receiver_.RequestKeyFrame(); 426 rtp_stream_receiver_.RequestKeyFrame();
425 } 427 }
426 428
427 } // namespace internal 429 } // namespace internal
428 } // namespace webrtc 430 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/stream_synchronization_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698