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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 2686043006: WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType (Closed)
Patch Set: rebase Created 3 years, 9 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/voice_engine/channel.h ('k') | webrtc/voice_engine/channel_proxy.h » ('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) 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
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 // RTCP is enabled by default. 980 // RTCP is enabled by default.
981 _rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound); 981 _rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound);
982 // --- Register all permanent callbacks 982 // --- Register all permanent callbacks
983 if (audio_coding_->RegisterTransportCallback(this) == -1) { 983 if (audio_coding_->RegisterTransportCallback(this) == -1) {
984 _engineStatisticsPtr->SetLastError( 984 _engineStatisticsPtr->SetLastError(
985 VE_CANNOT_INIT_CHANNEL, kTraceError, 985 VE_CANNOT_INIT_CHANNEL, kTraceError,
986 "Channel::Init() callbacks not registered"); 986 "Channel::Init() callbacks not registered");
987 return -1; 987 return -1;
988 } 988 }
989 989
990 // --- Register all supported codecs to the receiving side of the 990 return 0;
991 // RTP/RTCP module 991 }
992 992
993 void Channel::RegisterLegacyCodecs() {
993 CodecInst codec; 994 CodecInst codec;
994 const uint8_t nSupportedCodecs = AudioCodingModule::NumberOfCodecs(); 995 const uint8_t nSupportedCodecs = AudioCodingModule::NumberOfCodecs();
995 996
996 for (int idx = 0; idx < nSupportedCodecs; idx++) { 997 for (int idx = 0; idx < nSupportedCodecs; idx++) {
997 // Open up the RTP/RTCP receiver for all supported codecs 998 // Open up the RTP/RTCP receiver for all supported codecs
998 if ((audio_coding_->Codec(idx, &codec) == -1) || 999 if ((audio_coding_->Codec(idx, &codec) == -1) ||
999 (rtp_receiver_->RegisterReceivePayload(codec) == -1)) { 1000 (rtp_receiver_->RegisterReceivePayload(codec) == -1)) {
1000 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId), 1001 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
1001 "Channel::Init() unable to register %s " 1002 "Channel::Init() unable to register %s "
1002 "(%d/%d/%" PRIuS "/%d) to RTP/RTCP receiver", 1003 "(%d/%d/%" PRIuS "/%d) to RTP/RTCP receiver",
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 !audio_coding_->RegisterReceiveCodec(codec.pltype, 1035 !audio_coding_->RegisterReceiveCodec(codec.pltype,
1035 CodecInstToSdp(codec)) || 1036 CodecInstToSdp(codec)) ||
1036 _rtpRtcpModule->RegisterSendPayload(codec) == -1) { 1037 _rtpRtcpModule->RegisterSendPayload(codec) == -1) {
1037 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId), 1038 WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
1038 "Channel::Init() failed to register CN (%d/%d) " 1039 "Channel::Init() failed to register CN (%d/%d) "
1039 "correctly - 1", 1040 "correctly - 1",
1040 codec.pltype, codec.plfreq); 1041 codec.pltype, codec.plfreq);
1041 } 1042 }
1042 } 1043 }
1043 } 1044 }
1044
1045 return 0;
1046 } 1045 }
1047 1046
1048 void Channel::Terminate() { 1047 void Channel::Terminate() {
1049 RTC_DCHECK(construction_thread_.CalledOnValidThread()); 1048 RTC_DCHECK(construction_thread_.CalledOnValidThread());
1050 // Must be called on the same thread as Init(). 1049 // Must be called on the same thread as Init().
1051 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId), 1050 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId),
1052 "Channel::Terminate"); 1051 "Channel::Terminate");
1053 1052
1054 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(NULL); 1053 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(NULL);
1055 1054
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 int32_t Channel::GetVADStatus(bool& enabledVAD, 1352 int32_t Channel::GetVADStatus(bool& enabledVAD,
1354 ACMVADMode& mode, 1353 ACMVADMode& mode,
1355 bool& disabledDTX) { 1354 bool& disabledDTX) {
1356 const auto* params = codec_manager_.GetStackParams(); 1355 const auto* params = codec_manager_.GetStackParams();
1357 enabledVAD = params->use_cng; 1356 enabledVAD = params->use_cng;
1358 mode = params->vad_mode; 1357 mode = params->vad_mode;
1359 disabledDTX = !params->use_cng; 1358 disabledDTX = !params->use_cng;
1360 return 0; 1359 return 0;
1361 } 1360 }
1362 1361
1362 void Channel::SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs) {
1363 rtp_payload_registry_->SetAudioReceivePayloads(codecs);
1364 audio_coding_->SetReceiveCodecs(codecs);
1365 }
1366
1363 int32_t Channel::SetRecPayloadType(const CodecInst& codec) { 1367 int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
1364 return SetRecPayloadType(codec.pltype, CodecInstToSdp(codec)); 1368 return SetRecPayloadType(codec.pltype, CodecInstToSdp(codec));
1365 } 1369 }
1366 1370
1367 int32_t Channel::SetRecPayloadType(int payload_type, 1371 int32_t Channel::SetRecPayloadType(int payload_type,
1368 const SdpAudioFormat& format) { 1372 const SdpAudioFormat& format) {
1369 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 1373 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
1370 "Channel::SetRecPayloadType()"); 1374 "Channel::SetRecPayloadType()");
1371 1375
1372 if (channel_state_.Get().playing) { 1376 if (channel_state_.Get().playing) {
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 int64_t min_rtt = 0; 3033 int64_t min_rtt = 0;
3030 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3034 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3031 0) { 3035 0) {
3032 return 0; 3036 return 0;
3033 } 3037 }
3034 return rtt; 3038 return rtt;
3035 } 3039 }
3036 3040
3037 } // namespace voe 3041 } // namespace voe
3038 } // namespace webrtc 3042 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698