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

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

Issue 1181653002: Base A/V synchronization on sync_labels. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 5 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 | « webrtc/audio_receive_stream.h ('k') | webrtc/video/bitrate_estimator_tests.cc » ('j') | 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 16 matching lines...) Expand all
27 ss << ", "; 27 ss << ", ";
28 } 28 }
29 ss << ']'; 29 ss << ']';
30 ss << '}'; 30 ss << '}';
31 return ss.str(); 31 return ss.str();
32 } 32 }
33 33
34 std::string AudioReceiveStream::Config::ToString() const { 34 std::string AudioReceiveStream::Config::ToString() const {
35 std::stringstream ss; 35 std::stringstream ss;
36 ss << "{rtp: " << rtp.ToString(); 36 ss << "{rtp: " << rtp.ToString();
37 ss << ", voe_channel_id: " << voe_channel_id;
38 if (!sync_group.empty())
39 ss << ", sync_group: " << sync_group;
37 ss << '}'; 40 ss << '}';
38 return ss.str(); 41 return ss.str();
39 } 42 }
40 43
41 namespace internal { 44 namespace internal {
42 AudioReceiveStream::AudioReceiveStream( 45 AudioReceiveStream::AudioReceiveStream(
43 RemoteBitrateEstimator* remote_bitrate_estimator, 46 RemoteBitrateEstimator* remote_bitrate_estimator,
44 const webrtc::AudioReceiveStream::Config& config) 47 const webrtc::AudioReceiveStream::Config& config)
45 : remote_bitrate_estimator_(remote_bitrate_estimator), 48 : remote_bitrate_estimator_(remote_bitrate_estimator),
46 config_(config), 49 config_(config),
47 rtp_header_parser_(RtpHeaderParser::Create()) { 50 rtp_header_parser_(RtpHeaderParser::Create()) {
51 DCHECK(config.voe_channel_id != -1);
48 DCHECK(remote_bitrate_estimator_ != nullptr); 52 DCHECK(remote_bitrate_estimator_ != nullptr);
49 DCHECK(rtp_header_parser_ != nullptr); 53 DCHECK(rtp_header_parser_ != nullptr);
50 for (const auto& ext : config.rtp.extensions) { 54 for (const auto& ext : config.rtp.extensions) {
51 // One-byte-extension local identifiers are in the range 1-14 inclusive. 55 // One-byte-extension local identifiers are in the range 1-14 inclusive.
52 DCHECK_GE(ext.id, 1); 56 DCHECK_GE(ext.id, 1);
53 DCHECK_LE(ext.id, 14); 57 DCHECK_LE(ext.id, 14);
54 if (ext.name == RtpExtension::kAudioLevel) { 58 if (ext.name == RtpExtension::kAudioLevel) {
55 CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( 59 CHECK(rtp_header_parser_->RegisterRtpHeaderExtension(
56 kRtpExtensionAudioLevel, ext.id)); 60 kRtpExtensionAudioLevel, ext.id));
57 } else if (ext.name == RtpExtension::kAbsSendTime) { 61 } else if (ext.name == RtpExtension::kAbsSendTime) {
(...skipping 24 matching lines...) Expand all
82 if (header.extension.hasAbsoluteSendTime) { 86 if (header.extension.hasAbsoluteSendTime) {
83 int64_t arrival_time_ms = TickTime::MillisecondTimestamp(); 87 int64_t arrival_time_ms = TickTime::MillisecondTimestamp();
84 size_t payload_size = length - header.headerLength; 88 size_t payload_size = length - header.headerLength;
85 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size, 89 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size,
86 header, false); 90 header, false);
87 } 91 }
88 return true; 92 return true;
89 } 93 }
90 } // namespace internal 94 } // namespace internal
91 } // namespace webrtc 95 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio_receive_stream.h ('k') | webrtc/video/bitrate_estimator_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698