OLD | NEW |
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 |
11 #include "webrtc/video/rtp_streams_synchronizer.h" | 11 #include "webrtc/video/rtp_streams_synchronizer.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | |
14 #include "webrtc/base/logging.h" | |
15 #include "webrtc/base/timeutils.h" | |
16 #include "webrtc/base/trace_event.h" | |
17 #include "webrtc/call/syncable.h" | 13 #include "webrtc/call/syncable.h" |
18 #include "webrtc/modules/video_coding/video_coding_impl.h" | 14 #include "webrtc/modules/video_coding/video_coding_impl.h" |
| 15 #include "webrtc/rtc_base/checks.h" |
| 16 #include "webrtc/rtc_base/logging.h" |
| 17 #include "webrtc/rtc_base/timeutils.h" |
| 18 #include "webrtc/rtc_base/trace_event.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 namespace { | 21 namespace { |
22 bool UpdateMeasurements(StreamSynchronization::Measurements* stream, | 22 bool UpdateMeasurements(StreamSynchronization::Measurements* stream, |
23 const Syncable::Info& info) { | 23 const Syncable::Info& info) { |
24 RTC_DCHECK(stream); | 24 RTC_DCHECK(stream); |
25 stream->latest_timestamp = info.latest_received_capture_timestamp; | 25 stream->latest_timestamp = info.latest_received_capture_timestamp; |
26 stream->latest_receive_time_ms = info.latest_receive_time_ms; | 26 stream->latest_receive_time_ms = info.latest_receive_time_ms; |
27 bool new_rtcp_sr = false; | 27 bool new_rtcp_sr = false; |
28 if (!stream->rtp_to_ntp.UpdateMeasurements(info.capture_time_ntp_secs, | 28 if (!stream->rtp_to_ntp.UpdateMeasurements(info.capture_time_ntp_secs, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 int64_t time_to_render_ms = render_time_ms - rtc::TimeMillis(); | 145 int64_t time_to_render_ms = render_time_ms - rtc::TimeMillis(); |
146 if (time_to_render_ms > 0) | 146 if (time_to_render_ms > 0) |
147 latest_video_ntp += time_to_render_ms; | 147 latest_video_ntp += time_to_render_ms; |
148 | 148 |
149 *stream_offset_ms = latest_audio_ntp - latest_video_ntp; | 149 *stream_offset_ms = latest_audio_ntp - latest_video_ntp; |
150 *estimated_freq_khz = video_measurement_.rtp_to_ntp.params().frequency_khz; | 150 *estimated_freq_khz = video_measurement_.rtp_to_ntp.params().frequency_khz; |
151 return true; | 151 return true; |
152 } | 152 } |
153 | 153 |
154 } // namespace webrtc | 154 } // namespace webrtc |
OLD | NEW |