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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2568553002: Add SSRC to RtpEncodingParameters for audio. (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 rtp_parameters_(CreateRtpParametersWithOneEncoding()) { 1210 rtp_parameters_(CreateRtpParametersWithOneEncoding()) {
1211 RTC_DCHECK_GE(ch, 0); 1211 RTC_DCHECK_GE(ch, 0);
1212 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore: 1212 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore:
1213 // RTC_DCHECK(voe_audio_transport); 1213 // RTC_DCHECK(voe_audio_transport);
1214 RTC_DCHECK(call); 1214 RTC_DCHECK(call);
1215 config_.rtp.ssrc = ssrc; 1215 config_.rtp.ssrc = ssrc;
1216 config_.rtp.c_name = c_name; 1216 config_.rtp.c_name = c_name;
1217 config_.voe_channel_id = ch; 1217 config_.voe_channel_id = ch;
1218 config_.rtp.extensions = extensions; 1218 config_.rtp.extensions = extensions;
1219 config_.audio_network_adaptor_config = audio_network_adaptor_config; 1219 config_.audio_network_adaptor_config = audio_network_adaptor_config;
1220 rtp_parameters_.encodings[0].ssrc = rtc::Optional<uint32_t>(ssrc);
1220 RecreateAudioSendStream(send_codec_spec); 1221 RecreateAudioSendStream(send_codec_spec);
1221 } 1222 }
1222 1223
1223 ~WebRtcAudioSendStream() override { 1224 ~WebRtcAudioSendStream() override {
1224 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 1225 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
1225 ClearSource(); 1226 ClearSource();
1226 call_->DestroyAudioSendStream(stream_); 1227 call_->DestroyAudioSendStream(stream_);
1227 } 1228 }
1228 1229
1229 void RecreateAudioSendStream( 1230 void RecreateAudioSendStream(
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 LOG(LS_WARNING) << "Attempting to get RTP receive parameters for stream " 1736 LOG(LS_WARNING) << "Attempting to get RTP receive parameters for stream "
1736 << "with ssrc " << ssrc << " which doesn't exist."; 1737 << "with ssrc " << ssrc << " which doesn't exist.";
1737 return webrtc::RtpParameters(); 1738 return webrtc::RtpParameters();
1738 } 1739 }
1739 1740
1740 // TODO(deadbeef): Return stream-specific parameters. 1741 // TODO(deadbeef): Return stream-specific parameters.
1741 webrtc::RtpParameters rtp_params = CreateRtpParametersWithOneEncoding(); 1742 webrtc::RtpParameters rtp_params = CreateRtpParametersWithOneEncoding();
1742 for (const AudioCodec& codec : recv_codecs_) { 1743 for (const AudioCodec& codec : recv_codecs_) {
1743 rtp_params.codecs.push_back(codec.ToCodecParameters()); 1744 rtp_params.codecs.push_back(codec.ToCodecParameters());
1744 } 1745 }
1746 rtp_params.encodings[0].ssrc = rtc::Optional<uint32_t>(ssrc);
1745 return rtp_params; 1747 return rtp_params;
1746 } 1748 }
1747 1749
1748 bool WebRtcVoiceMediaChannel::SetRtpReceiveParameters( 1750 bool WebRtcVoiceMediaChannel::SetRtpReceiveParameters(
1749 uint32_t ssrc, 1751 uint32_t ssrc,
1750 const webrtc::RtpParameters& parameters) { 1752 const webrtc::RtpParameters& parameters) {
1751 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 1753 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
1752 if (!ValidateRtpParameters(parameters)) { 1754 if (!ValidateRtpParameters(parameters)) {
1753 return false; 1755 return false;
1754 } 1756 }
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2653 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2652 const auto it = send_streams_.find(ssrc); 2654 const auto it = send_streams_.find(ssrc);
2653 if (it != send_streams_.end()) { 2655 if (it != send_streams_.end()) {
2654 return it->second->channel(); 2656 return it->second->channel();
2655 } 2657 }
2656 return -1; 2658 return -1;
2657 } 2659 }
2658 } // namespace cricket 2660 } // namespace cricket
2659 2661
2660 #endif // HAVE_WEBRTC_VOICE 2662 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698