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 |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1370 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
1371 "Channel::SetRecPayloadType()"); | 1371 "Channel::SetRecPayloadType()"); |
1372 | 1372 |
1373 if (channel_state_.Get().playing) { | 1373 if (channel_state_.Get().playing) { |
1374 _engineStatisticsPtr->SetLastError( | 1374 _engineStatisticsPtr->SetLastError( |
1375 VE_ALREADY_PLAYING, kTraceError, | 1375 VE_ALREADY_PLAYING, kTraceError, |
1376 "SetRecPayloadType() unable to set PT while playing"); | 1376 "SetRecPayloadType() unable to set PT while playing"); |
1377 return -1; | 1377 return -1; |
1378 } | 1378 } |
1379 | 1379 |
1380 const CodecInst codec = [&] { | 1380 const CodecInst codec = SdpToCodecInst(payload_type, format); |
1381 CodecInst c = SdpToCodecInst(payload_type, format); | |
1382 | |
1383 // Bug 6986: Emulate an old bug that caused us to always choose to decode | |
1384 // Opus in stereo. To be able to remove this, we first need to fix the | |
1385 // other half of bug 6986, which is about losing the Opus "stereo" | |
1386 // parameter. | |
1387 // TODO(kwiberg): Remove this special case, a.k.a. fix bug 6986. | |
1388 if (STR_CASE_CMP(codec.plname, "opus") == 0) { | |
1389 c.channels = 2; | |
1390 } | |
1391 | |
1392 return c; | |
1393 }(); | |
1394 | 1381 |
1395 if (payload_type == -1) { | 1382 if (payload_type == -1) { |
1396 // De-register the selected codec (RTP/RTCP module and ACM) | 1383 // De-register the selected codec (RTP/RTCP module and ACM) |
1397 | 1384 |
1398 int8_t pltype(-1); | 1385 int8_t pltype(-1); |
1399 CodecInst rxCodec = codec; | 1386 CodecInst rxCodec = codec; |
1400 | 1387 |
1401 // Get payload type for the given codec | 1388 // Get payload type for the given codec |
1402 rtp_payload_registry_->ReceivePayloadType(rxCodec, &pltype); | 1389 rtp_payload_registry_->ReceivePayloadType(rxCodec, &pltype); |
1403 rxCodec.pltype = pltype; | 1390 rxCodec.pltype = pltype; |
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3076 int64_t min_rtt = 0; | 3063 int64_t min_rtt = 0; |
3077 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3064 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3078 0) { | 3065 0) { |
3079 return 0; | 3066 return 0; |
3080 } | 3067 } |
3081 return rtt; | 3068 return rtt; |
3082 } | 3069 } |
3083 | 3070 |
3084 } // namespace voe | 3071 } // namespace voe |
3085 } // namespace webrtc | 3072 } // namespace webrtc |
OLD | NEW |