OLD | NEW |
---|---|
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 auto it = std::unique(payload_types.begin(), payload_types.end()); | 179 auto it = std::unique(payload_types.begin(), payload_types.end()); |
180 return it == payload_types.end(); | 180 return it == payload_types.end(); |
181 } | 181 } |
182 | 182 |
183 // Return true if codec.params[feature] == "1", false otherwise. | 183 // Return true if codec.params[feature] == "1", false otherwise. |
184 bool IsCodecFeatureEnabled(const AudioCodec& codec, const char* feature) { | 184 bool IsCodecFeatureEnabled(const AudioCodec& codec, const char* feature) { |
185 int value; | 185 int value; |
186 return codec.GetParam(feature, &value) && value == 1; | 186 return codec.GetParam(feature, &value) && value == 1; |
187 } | 187 } |
188 | 188 |
189 // Returns integer parameter params[feature] if it is defined. Returns | |
190 // |default_value| otherwise. | |
191 int GetCodecFeatureInt(const AudioCodec& codec, | |
192 const char* feature, | |
193 int default_value) { | |
194 int value; | |
the sun
2016/10/25 09:25:46
= 0
always initializing is a good habit
minyue-webrtc
2016/10/27 14:33:10
Done.
| |
195 if (codec.GetParam(feature, &value)) { | |
196 return value; | |
197 } | |
198 return default_value; | |
199 } | |
200 | |
189 // Use params[kCodecParamMaxAverageBitrate] if it is defined, use codec.bitrate | 201 // Use params[kCodecParamMaxAverageBitrate] if it is defined, use codec.bitrate |
190 // otherwise. If the value (either from params or codec.bitrate) <=0, use the | 202 // otherwise. If the value (either from params or codec.bitrate) <=0, use the |
191 // default configuration. If the value is beyond feasible bit rate of Opus, | 203 // default configuration. If the value is beyond feasible bit rate of Opus, |
192 // clamp it. Returns the Opus bit rate for operation. | 204 // clamp it. Returns the Opus bit rate for operation. |
193 int GetOpusBitrate(const AudioCodec& codec, int max_playback_rate) { | 205 int GetOpusBitrate(const AudioCodec& codec, int max_playback_rate) { |
194 int bitrate = 0; | 206 int bitrate = 0; |
195 bool use_param = true; | 207 bool use_param = true; |
196 if (!codec.GetParam(kCodecParamMaxAverageBitrate, &bitrate)) { | 208 if (!codec.GetParam(kCodecParamMaxAverageBitrate, &bitrate)) { |
197 bitrate = codec.bitrate; | 209 bitrate = codec.bitrate; |
198 use_param = false; | 210 use_param = false; |
(...skipping 15 matching lines...) Expand all Loading... | |
214 std::string rate_source = | 226 std::string rate_source = |
215 use_param ? "Codec parameter \"maxaveragebitrate\"" : | 227 use_param ? "Codec parameter \"maxaveragebitrate\"" : |
216 "Supplied Opus bitrate"; | 228 "Supplied Opus bitrate"; |
217 LOG(LS_WARNING) << rate_source | 229 LOG(LS_WARNING) << rate_source |
218 << " is invalid and is replaced by: " | 230 << " is invalid and is replaced by: " |
219 << bitrate; | 231 << bitrate; |
220 } | 232 } |
221 return bitrate; | 233 return bitrate; |
222 } | 234 } |
223 | 235 |
224 // Returns kOpusDefaultPlaybackRate if params[kCodecParamMaxPlaybackRate] is not | 236 void GetOpusConfig(const AudioCodec& codec, |
225 // defined. Returns the value of params[kCodecParamMaxPlaybackRate] otherwise. | 237 webrtc::CodecInst* voe_codec, |
226 int GetOpusMaxPlaybackRate(const AudioCodec& codec) { | 238 bool* enable_codec_fec, |
227 int value; | 239 int* max_playback_rate, |
228 if (codec.GetParam(kCodecParamMaxPlaybackRate, &value)) { | 240 bool* enable_codec_dtx, |
229 return value; | 241 int* min_ptime_ms, |
230 } | 242 int* max_ptime_ms) { |
231 return kOpusDefaultMaxPlaybackRate; | |
232 } | |
233 | |
234 void GetOpusConfig(const AudioCodec& codec, webrtc::CodecInst* voe_codec, | |
235 bool* enable_codec_fec, int* max_playback_rate, | |
236 bool* enable_codec_dtx) { | |
237 *enable_codec_fec = IsCodecFeatureEnabled(codec, kCodecParamUseInbandFec); | 243 *enable_codec_fec = IsCodecFeatureEnabled(codec, kCodecParamUseInbandFec); |
238 *enable_codec_dtx = IsCodecFeatureEnabled(codec, kCodecParamUseDtx); | 244 *enable_codec_dtx = IsCodecFeatureEnabled(codec, kCodecParamUseDtx); |
239 *max_playback_rate = GetOpusMaxPlaybackRate(codec); | 245 *max_playback_rate = GetCodecFeatureInt(codec, kCodecParamMaxPlaybackRate, |
246 kOpusDefaultMaxPlaybackRate); | |
247 *max_ptime_ms = | |
248 GetCodecFeatureInt(codec, kCodecParamMaxPTime, kOpusDefaultMaxPTime); | |
249 *min_ptime_ms = | |
250 GetCodecFeatureInt(codec, kCodecParamMinPTime, kOpusDefaultMinPTime); | |
240 | 251 |
241 // If OPUS, change what we send according to the "stereo" codec | 252 // If OPUS, change what we send according to the "stereo" codec |
242 // parameter, and not the "channels" parameter. We set | 253 // parameter, and not the "channels" parameter. We set |
243 // voe_codec.channels to 2 if "stereo=1" and 1 otherwise. If | 254 // voe_codec.channels to 2 if "stereo=1" and 1 otherwise. If |
244 // the bitrate is not specified, i.e. is <= zero, we set it to the | 255 // the bitrate is not specified, i.e. is <= zero, we set it to the |
245 // appropriate default value for mono or stereo Opus. | 256 // appropriate default value for mono or stereo Opus. |
246 | |
247 voe_codec->channels = IsCodecFeatureEnabled(codec, kCodecParamStereo) ? 2 : 1; | 257 voe_codec->channels = IsCodecFeatureEnabled(codec, kCodecParamStereo) ? 2 : 1; |
248 voe_codec->rate = GetOpusBitrate(codec, *max_playback_rate); | 258 voe_codec->rate = GetOpusBitrate(codec, *max_playback_rate); |
249 } | 259 } |
250 | 260 |
251 webrtc::AudioState::Config MakeAudioStateConfig(VoEWrapper* voe_wrapper) { | 261 webrtc::AudioState::Config MakeAudioStateConfig(VoEWrapper* voe_wrapper) { |
252 webrtc::AudioState::Config config; | 262 webrtc::AudioState::Config config; |
253 config.voice_engine = voe_wrapper->engine(); | 263 config.voice_engine = voe_wrapper->engine(); |
254 return config; | 264 return config; |
255 } | 265 } |
256 | 266 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
891 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); | 901 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); |
892 } | 902 } |
893 } | 903 } |
894 | 904 |
895 if (options.playout_sample_rate) { | 905 if (options.playout_sample_rate) { |
896 LOG(LS_INFO) << "Playout sample rate is " << *options.playout_sample_rate; | 906 LOG(LS_INFO) << "Playout sample rate is " << *options.playout_sample_rate; |
897 if (adm()->SetPlayoutSampleRate(*options.playout_sample_rate)) { | 907 if (adm()->SetPlayoutSampleRate(*options.playout_sample_rate)) { |
898 LOG_RTCERR1(SetPlayoutSampleRate, *options.playout_sample_rate); | 908 LOG_RTCERR1(SetPlayoutSampleRate, *options.playout_sample_rate); |
899 } | 909 } |
900 } | 910 } |
901 | |
902 return true; | 911 return true; |
903 } | 912 } |
904 | 913 |
905 void WebRtcVoiceEngine::SetDefaultDevices() { | 914 void WebRtcVoiceEngine::SetDefaultDevices() { |
906 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 915 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
907 #if !defined(WEBRTC_IOS) | 916 #if !defined(WEBRTC_IOS) |
908 int in_id = kDefaultAudioDeviceId; | 917 int in_id = kDefaultAudioDeviceId; |
909 int out_id = kDefaultAudioDeviceId; | 918 int out_id = kDefaultAudioDeviceId; |
910 LOG(LS_INFO) << "Setting microphone to (id=" << in_id | 919 LOG(LS_INFO) << "Setting microphone to (id=" << in_id |
911 << ") and speaker to (id=" << out_id << ")"; | 920 << ") and speaker to (id=" << out_id << ")"; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1143 : public AudioSource::Sink { | 1152 : public AudioSource::Sink { |
1144 public: | 1153 public: |
1145 WebRtcAudioSendStream( | 1154 WebRtcAudioSendStream( |
1146 int ch, | 1155 int ch, |
1147 webrtc::AudioTransport* voe_audio_transport, | 1156 webrtc::AudioTransport* voe_audio_transport, |
1148 uint32_t ssrc, | 1157 uint32_t ssrc, |
1149 const std::string& c_name, | 1158 const std::string& c_name, |
1150 const webrtc::AudioSendStream::Config::SendCodecSpec& send_codec_spec, | 1159 const webrtc::AudioSendStream::Config::SendCodecSpec& send_codec_spec, |
1151 const std::vector<webrtc::RtpExtension>& extensions, | 1160 const std::vector<webrtc::RtpExtension>& extensions, |
1152 int max_send_bitrate_bps, | 1161 int max_send_bitrate_bps, |
1162 const rtc::Optional<std::string>& audio_network_adaptor_config, | |
1153 webrtc::Call* call, | 1163 webrtc::Call* call, |
1154 webrtc::Transport* send_transport) | 1164 webrtc::Transport* send_transport) |
1155 : voe_audio_transport_(voe_audio_transport), | 1165 : voe_audio_transport_(voe_audio_transport), |
1156 call_(call), | 1166 call_(call), |
1157 config_(send_transport), | 1167 config_(send_transport), |
1158 max_send_bitrate_bps_(max_send_bitrate_bps), | 1168 max_send_bitrate_bps_(max_send_bitrate_bps), |
1159 rtp_parameters_(CreateRtpParametersWithOneEncoding()) { | 1169 rtp_parameters_(CreateRtpParametersWithOneEncoding()) { |
1160 RTC_DCHECK_GE(ch, 0); | 1170 RTC_DCHECK_GE(ch, 0); |
1161 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore: | 1171 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore: |
1162 // RTC_DCHECK(voe_audio_transport); | 1172 // RTC_DCHECK(voe_audio_transport); |
1163 RTC_DCHECK(call); | 1173 RTC_DCHECK(call); |
1164 config_.rtp.ssrc = ssrc; | 1174 config_.rtp.ssrc = ssrc; |
1165 config_.rtp.c_name = c_name; | 1175 config_.rtp.c_name = c_name; |
1166 config_.voe_channel_id = ch; | 1176 config_.voe_channel_id = ch; |
1167 config_.rtp.extensions = extensions; | 1177 config_.rtp.extensions = extensions; |
1178 config_.audio_network_adaptor_config = audio_network_adaptor_config; | |
1168 RecreateAudioSendStream(send_codec_spec); | 1179 RecreateAudioSendStream(send_codec_spec); |
1169 } | 1180 } |
1170 | 1181 |
1171 ~WebRtcAudioSendStream() override { | 1182 ~WebRtcAudioSendStream() override { |
1172 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1183 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1173 ClearSource(); | 1184 ClearSource(); |
1174 call_->DestroyAudioSendStream(stream_); | 1185 call_->DestroyAudioSendStream(stream_); |
1175 } | 1186 } |
1176 | 1187 |
1177 void RecreateAudioSendStream( | 1188 void RecreateAudioSendStream( |
(...skipping 11 matching lines...) Expand all Loading... | |
1189 RecreateAudioSendStream(); | 1200 RecreateAudioSendStream(); |
1190 } | 1201 } |
1191 | 1202 |
1192 void RecreateAudioSendStream( | 1203 void RecreateAudioSendStream( |
1193 const std::vector<webrtc::RtpExtension>& extensions) { | 1204 const std::vector<webrtc::RtpExtension>& extensions) { |
1194 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1205 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1195 config_.rtp.extensions = extensions; | 1206 config_.rtp.extensions = extensions; |
1196 RecreateAudioSendStream(); | 1207 RecreateAudioSendStream(); |
1197 } | 1208 } |
1198 | 1209 |
1210 void RecreateAudioSendStream( | |
1211 const rtc::Optional<std::string>& audio_network_adaptor_config) { | |
1212 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | |
1213 if (config_.audio_network_adaptor_config == audio_network_adaptor_config) { | |
1214 return; | |
1215 } | |
1216 config_.audio_network_adaptor_config = audio_network_adaptor_config; | |
1217 RecreateAudioSendStream(); | |
1218 } | |
1219 | |
1199 bool SetMaxSendBitrate(int bps) { | 1220 bool SetMaxSendBitrate(int bps) { |
1200 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1221 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1201 auto send_rate = | 1222 auto send_rate = |
1202 ComputeSendBitrate(bps, rtp_parameters_.encodings[0].max_bitrate_bps, | 1223 ComputeSendBitrate(bps, rtp_parameters_.encodings[0].max_bitrate_bps, |
1203 send_codec_spec_.codec_inst); | 1224 send_codec_spec_.codec_inst); |
1204 if (!send_rate) { | 1225 if (!send_rate) { |
1205 return false; | 1226 return false; |
1206 } | 1227 } |
1207 | 1228 |
1208 max_send_bitrate_bps_ = bps; | 1229 max_send_bitrate_bps_ = bps; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1696 bool WebRtcVoiceMediaChannel::ValidateRtpParameters( | 1717 bool WebRtcVoiceMediaChannel::ValidateRtpParameters( |
1697 const webrtc::RtpParameters& rtp_parameters) { | 1718 const webrtc::RtpParameters& rtp_parameters) { |
1698 if (rtp_parameters.encodings.size() != 1) { | 1719 if (rtp_parameters.encodings.size() != 1) { |
1699 LOG(LS_ERROR) | 1720 LOG(LS_ERROR) |
1700 << "Attempted to set RtpParameters without exactly one encoding"; | 1721 << "Attempted to set RtpParameters without exactly one encoding"; |
1701 return false; | 1722 return false; |
1702 } | 1723 } |
1703 return true; | 1724 return true; |
1704 } | 1725 } |
1705 | 1726 |
1706 bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) { | 1727 bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) { |
minyue-webrtc
2016/10/24 10:57:11
When setoptions, the .audio_network_adaptor/audio_
| |
1707 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1728 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1708 LOG(LS_INFO) << "Setting voice channel options: " | 1729 LOG(LS_INFO) << "Setting voice channel options: " |
1709 << options.ToString(); | 1730 << options.ToString(); |
1710 | 1731 |
1711 // We retain all of the existing options, and apply the given ones | 1732 // We retain all of the existing options, and apply the given ones |
1712 // on top. This means there is no way to "clear" options such that | 1733 // on top. This means there is no way to "clear" options such that |
1713 // they go back to the engine default. | 1734 // they go back to the engine default. |
1714 options_.SetAll(options); | 1735 options_.SetAll(options); |
1715 if (!engine()->ApplyOptions(options_)) { | 1736 if (!engine()->ApplyOptions(options_)) { |
1716 LOG(LS_WARNING) << | 1737 LOG(LS_WARNING) << |
1717 "Failed to apply engine options during channel SetOptions."; | 1738 "Failed to apply engine options during channel SetOptions."; |
1718 return false; | 1739 return false; |
1719 } | 1740 } |
1741 | |
1742 if (options_.audio_network_adaptor) { | |
1743 // Only override current setting when |options_.audio_network_adaptor| has | |
1744 // a value. | |
1745 if (!*options_.audio_network_adaptor) { | |
the sun
2016/10/25 09:25:46
Simplify the logic to use a single loop.
| |
1746 // Turn off audio network adaptor. | |
1747 for (auto& it : send_streams_) { | |
1748 it.second->RecreateAudioSendStream(rtc::Optional<std::string>()); | |
1749 } | |
1750 } else if (options_.audio_network_adaptor_config) { | |
1751 // Turn on audio network adaptor only when | |
1752 // |options_.audio_network_adaptor_config| is defined. | |
1753 for (auto& it : send_streams_) { | |
1754 it.second->RecreateAudioSendStream( | |
1755 options_.audio_network_adaptor_config); | |
1756 } | |
1757 } | |
1758 } | |
1759 | |
1720 LOG(LS_INFO) << "Set voice channel options. Current options: " | 1760 LOG(LS_INFO) << "Set voice channel options. Current options: " |
1721 << options_.ToString(); | 1761 << options_.ToString(); |
1722 return true; | 1762 return true; |
1723 } | 1763 } |
1724 | 1764 |
1725 bool WebRtcVoiceMediaChannel::SetRecvCodecs( | 1765 bool WebRtcVoiceMediaChannel::SetRecvCodecs( |
1726 const std::vector<AudioCodec>& codecs) { | 1766 const std::vector<AudioCodec>& codecs) { |
1727 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1767 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1728 | 1768 |
1729 // Set the payload types to be used for incoming media. | 1769 // Set the payload types to be used for incoming media. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1823 | 1863 |
1824 send_codec_spec.transport_cc_enabled = HasTransportCc(*codec); | 1864 send_codec_spec.transport_cc_enabled = HasTransportCc(*codec); |
1825 send_codec_spec.nack_enabled = HasNack(*codec); | 1865 send_codec_spec.nack_enabled = HasNack(*codec); |
1826 | 1866 |
1827 // For Opus as the send codec, we are to determine inband FEC, maximum | 1867 // For Opus as the send codec, we are to determine inband FEC, maximum |
1828 // playback rate, and opus internal dtx. | 1868 // playback rate, and opus internal dtx. |
1829 if (IsCodec(*codec, kOpusCodecName)) { | 1869 if (IsCodec(*codec, kOpusCodecName)) { |
1830 GetOpusConfig(*codec, &send_codec_spec.codec_inst, | 1870 GetOpusConfig(*codec, &send_codec_spec.codec_inst, |
1831 &send_codec_spec.enable_codec_fec, | 1871 &send_codec_spec.enable_codec_fec, |
1832 &send_codec_spec.opus_max_playback_rate, | 1872 &send_codec_spec.opus_max_playback_rate, |
1833 &send_codec_spec.enable_opus_dtx); | 1873 &send_codec_spec.enable_opus_dtx, |
1874 &send_codec_spec.min_ptime_ms, | |
1875 &send_codec_spec.max_ptime_ms); | |
1834 } | 1876 } |
1835 | 1877 |
1836 // Set packet size if the AudioCodec param kCodecParamPTime is set. | 1878 // Set packet size if the AudioCodec param kCodecParamPTime is set. |
1837 int ptime_ms = 0; | 1879 int ptime_ms = 0; |
1838 if (codec->GetParam(kCodecParamPTime, &ptime_ms)) { | 1880 if (codec->GetParam(kCodecParamPTime, &ptime_ms)) { |
1839 if (!WebRtcVoiceCodecs::SetPTimeAsPacketSize( | 1881 if (!WebRtcVoiceCodecs::SetPTimeAsPacketSize( |
1840 &send_codec_spec.codec_inst, ptime_ms)) { | 1882 &send_codec_spec.codec_inst, ptime_ms)) { |
1841 LOG(LS_WARNING) << "Failed to set packet size for codec " | 1883 LOG(LS_WARNING) << "Failed to set packet size for codec " |
1842 << send_codec_spec.codec_inst.plname; | 1884 << send_codec_spec.codec_inst.plname; |
1843 return false; | 1885 return false; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1999 int channel = CreateVoEChannel(); | 2041 int channel = CreateVoEChannel(); |
2000 if (channel == -1) { | 2042 if (channel == -1) { |
2001 return false; | 2043 return false; |
2002 } | 2044 } |
2003 | 2045 |
2004 // Save the channel to send_streams_, so that RemoveSendStream() can still | 2046 // Save the channel to send_streams_, so that RemoveSendStream() can still |
2005 // delete the channel in case failure happens below. | 2047 // delete the channel in case failure happens below. |
2006 webrtc::AudioTransport* audio_transport = | 2048 webrtc::AudioTransport* audio_transport = |
2007 engine()->voe()->base()->audio_transport(); | 2049 engine()->voe()->base()->audio_transport(); |
2008 | 2050 |
2051 rtc::Optional<std::string> audio_network_adaptor_config; | |
2052 if (options_.audio_network_adaptor && *options_.audio_network_adaptor && | |
the sun
2016/10/25 09:25:46
So this is exactly the same logic as in SetOptions
minyue-webrtc
2016/10/27 14:33:10
Not really exactly the same, here we interpret "op
| |
2053 options_.audio_network_adaptor_config) { | |
2054 // Turn on audio network adaptor only when |options_.audio_network_adaptor| | |
2055 // equals true and |options_.audio_network_adaptor_config| has a value. | |
2056 audio_network_adaptor_config = options_.audio_network_adaptor_config; | |
2057 } | |
2009 WebRtcAudioSendStream* stream = new WebRtcAudioSendStream( | 2058 WebRtcAudioSendStream* stream = new WebRtcAudioSendStream( |
2010 channel, audio_transport, ssrc, sp.cname, send_codec_spec_, | 2059 channel, audio_transport, ssrc, sp.cname, send_codec_spec_, |
2011 send_rtp_extensions_, max_send_bitrate_bps_, call_, this); | 2060 send_rtp_extensions_, max_send_bitrate_bps_, audio_network_adaptor_config, |
2061 call_, this); | |
2012 send_streams_.insert(std::make_pair(ssrc, stream)); | 2062 send_streams_.insert(std::make_pair(ssrc, stream)); |
2013 | 2063 |
2014 // At this point the stream's local SSRC has been updated. If it is the first | 2064 // At this point the stream's local SSRC has been updated. If it is the first |
2015 // send stream, make sure that all the receive streams are updated with the | 2065 // send stream, make sure that all the receive streams are updated with the |
2016 // same SSRC in order to send receiver reports. | 2066 // same SSRC in order to send receiver reports. |
2017 if (send_streams_.size() == 1) { | 2067 if (send_streams_.size() == 1) { |
2018 receiver_reports_ssrc_ = ssrc; | 2068 receiver_reports_ssrc_ = ssrc; |
2019 for (const auto& kv : recv_streams_) { | 2069 for (const auto& kv : recv_streams_) { |
2020 // TODO(solenberg): Allow applications to set the RTCP SSRC of receive | 2070 // TODO(solenberg): Allow applications to set the RTCP SSRC of receive |
2021 // streams instead, so we can avoid recreating the streams here. | 2071 // streams instead, so we can avoid recreating the streams here. |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2509 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2559 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
2510 const auto it = send_streams_.find(ssrc); | 2560 const auto it = send_streams_.find(ssrc); |
2511 if (it != send_streams_.end()) { | 2561 if (it != send_streams_.end()) { |
2512 return it->second->channel(); | 2562 return it->second->channel(); |
2513 } | 2563 } |
2514 return -1; | 2564 return -1; |
2515 } | 2565 } |
2516 } // namespace cricket | 2566 } // namespace cricket |
2517 | 2567 |
2518 #endif // HAVE_WEBRTC_VOICE | 2568 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |