| 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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 "StartSend() RTP/RTCP failed to stop sending"); | 1218 "StartSend() RTP/RTCP failed to stop sending"); |
| 1219 } | 1219 } |
| 1220 _rtpRtcpModule->SetSendingMediaStatus(false); | 1220 _rtpRtcpModule->SetSendingMediaStatus(false); |
| 1221 | 1221 |
| 1222 return 0; | 1222 return 0; |
| 1223 } | 1223 } |
| 1224 | 1224 |
| 1225 int32_t Channel::StartReceiving() { | 1225 int32_t Channel::StartReceiving() { |
| 1226 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1226 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 1227 "Channel::StartReceiving()"); | 1227 "Channel::StartReceiving()"); |
| 1228 if (channel_state_.Get().receiving) { | |
| 1229 return 0; | |
| 1230 } | |
| 1231 channel_state_.SetReceiving(true); | |
| 1232 _numberOfDiscardedPackets = 0; | 1228 _numberOfDiscardedPackets = 0; |
| 1233 return 0; | 1229 return 0; |
| 1234 } | 1230 } |
| 1235 | 1231 |
| 1236 int32_t Channel::StopReceiving() { | |
| 1237 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | |
| 1238 "Channel::StopReceiving()"); | |
| 1239 if (!channel_state_.Get().receiving) { | |
| 1240 return 0; | |
| 1241 } | |
| 1242 | |
| 1243 channel_state_.SetReceiving(false); | |
| 1244 return 0; | |
| 1245 } | |
| 1246 | |
| 1247 int32_t Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) { | 1232 int32_t Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) { |
| 1248 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1233 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 1249 "Channel::RegisterVoiceEngineObserver()"); | 1234 "Channel::RegisterVoiceEngineObserver()"); |
| 1250 rtc::CritScope cs(&_callbackCritSect); | 1235 rtc::CritScope cs(&_callbackCritSect); |
| 1251 | 1236 |
| 1252 if (_voiceEngineObserverPtr) { | 1237 if (_voiceEngineObserverPtr) { |
| 1253 _engineStatisticsPtr->SetLastError( | 1238 _engineStatisticsPtr->SetLastError( |
| 1254 VE_INVALID_OPERATION, kTraceError, | 1239 VE_INVALID_OPERATION, kTraceError, |
| 1255 "RegisterVoiceEngineObserver() observer already enabled"); | 1240 "RegisterVoiceEngineObserver() observer already enabled"); |
| 1256 return -1; | 1241 return -1; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 int32_t Channel::SetRecPayloadType(const CodecInst& codec) { | 1348 int32_t Channel::SetRecPayloadType(const CodecInst& codec) { |
| 1364 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1349 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 1365 "Channel::SetRecPayloadType()"); | 1350 "Channel::SetRecPayloadType()"); |
| 1366 | 1351 |
| 1367 if (channel_state_.Get().playing) { | 1352 if (channel_state_.Get().playing) { |
| 1368 _engineStatisticsPtr->SetLastError( | 1353 _engineStatisticsPtr->SetLastError( |
| 1369 VE_ALREADY_PLAYING, kTraceError, | 1354 VE_ALREADY_PLAYING, kTraceError, |
| 1370 "SetRecPayloadType() unable to set PT while playing"); | 1355 "SetRecPayloadType() unable to set PT while playing"); |
| 1371 return -1; | 1356 return -1; |
| 1372 } | 1357 } |
| 1373 if (channel_state_.Get().receiving) { | |
| 1374 _engineStatisticsPtr->SetLastError( | |
| 1375 VE_ALREADY_LISTENING, kTraceError, | |
| 1376 "SetRecPayloadType() unable to set PT while listening"); | |
| 1377 return -1; | |
| 1378 } | |
| 1379 | 1358 |
| 1380 if (codec.pltype == -1) { | 1359 if (codec.pltype == -1) { |
| 1381 // De-register the selected codec (RTP/RTCP module and ACM) | 1360 // De-register the selected codec (RTP/RTCP module and ACM) |
| 1382 | 1361 |
| 1383 int8_t pltype(-1); | 1362 int8_t pltype(-1); |
| 1384 CodecInst rxCodec = codec; | 1363 CodecInst rxCodec = codec; |
| 1385 | 1364 |
| 1386 // Get payload type for the given codec | 1365 // Get payload type for the given codec |
| 1387 rtp_payload_registry_->ReceivePayloadType( | 1366 rtp_payload_registry_->ReceivePayloadType( |
| 1388 rxCodec.plname, rxCodec.plfreq, rxCodec.channels, | 1367 rxCodec.plname, rxCodec.plfreq, rxCodec.channels, |
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3265 int64_t min_rtt = 0; | 3244 int64_t min_rtt = 0; |
| 3266 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3245 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3267 0) { | 3246 0) { |
| 3268 return 0; | 3247 return 0; |
| 3269 } | 3248 } |
| 3270 return rtt; | 3249 return rtt; |
| 3271 } | 3250 } |
| 3272 | 3251 |
| 3273 } // namespace voe | 3252 } // namespace voe |
| 3274 } // namespace webrtc | 3253 } // namespace webrtc |
| OLD | NEW |