| 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 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 if (_rtpRtcpModule->SetSendingStatus(false) == -1) { | 1215 if (_rtpRtcpModule->SetSendingStatus(false) == -1) { |
| 1216 _engineStatisticsPtr->SetLastError( | 1216 _engineStatisticsPtr->SetLastError( |
| 1217 VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, | 1217 VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, |
| 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 void Channel::ResetDiscardedPacketCount() { |
| 1226 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1226 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 1227 "Channel::StartReceiving()"); | 1227 "Channel::ResetDiscardedPacketCount()"); |
| 1228 if (channel_state_.Get().receiving) { | |
| 1229 return 0; | |
| 1230 } | |
| 1231 channel_state_.SetReceiving(true); | |
| 1232 _numberOfDiscardedPackets = 0; | 1228 _numberOfDiscardedPackets = 0; |
| 1233 return 0; | |
| 1234 } | |
| 1235 | |
| 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 } | 1229 } |
| 1246 | 1230 |
| 1247 int32_t Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) { | 1231 int32_t Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) { |
| 1248 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1232 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 1249 "Channel::RegisterVoiceEngineObserver()"); | 1233 "Channel::RegisterVoiceEngineObserver()"); |
| 1250 rtc::CritScope cs(&_callbackCritSect); | 1234 rtc::CritScope cs(&_callbackCritSect); |
| 1251 | 1235 |
| 1252 if (_voiceEngineObserverPtr) { | 1236 if (_voiceEngineObserverPtr) { |
| 1253 _engineStatisticsPtr->SetLastError( | 1237 _engineStatisticsPtr->SetLastError( |
| 1254 VE_INVALID_OPERATION, kTraceError, | 1238 VE_INVALID_OPERATION, kTraceError, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 int32_t Channel::SetRecPayloadType(const CodecInst& codec) { | 1347 int32_t Channel::SetRecPayloadType(const CodecInst& codec) { |
| 1364 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1348 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 1365 "Channel::SetRecPayloadType()"); | 1349 "Channel::SetRecPayloadType()"); |
| 1366 | 1350 |
| 1367 if (channel_state_.Get().playing) { | 1351 if (channel_state_.Get().playing) { |
| 1368 _engineStatisticsPtr->SetLastError( | 1352 _engineStatisticsPtr->SetLastError( |
| 1369 VE_ALREADY_PLAYING, kTraceError, | 1353 VE_ALREADY_PLAYING, kTraceError, |
| 1370 "SetRecPayloadType() unable to set PT while playing"); | 1354 "SetRecPayloadType() unable to set PT while playing"); |
| 1371 return -1; | 1355 return -1; |
| 1372 } | 1356 } |
| 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 | 1357 |
| 1380 if (codec.pltype == -1) { | 1358 if (codec.pltype == -1) { |
| 1381 // De-register the selected codec (RTP/RTCP module and ACM) | 1359 // De-register the selected codec (RTP/RTCP module and ACM) |
| 1382 | 1360 |
| 1383 int8_t pltype(-1); | 1361 int8_t pltype(-1); |
| 1384 CodecInst rxCodec = codec; | 1362 CodecInst rxCodec = codec; |
| 1385 | 1363 |
| 1386 // Get payload type for the given codec | 1364 // Get payload type for the given codec |
| 1387 rtp_payload_registry_->ReceivePayloadType( | 1365 rtp_payload_registry_->ReceivePayloadType( |
| 1388 rxCodec.plname, rxCodec.plfreq, rxCodec.channels, | 1366 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; | 3243 int64_t min_rtt = 0; |
| 3266 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3244 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3267 0) { | 3245 0) { |
| 3268 return 0; | 3246 return 0; |
| 3269 } | 3247 } |
| 3270 return rtt; | 3248 return rtt; |
| 3271 } | 3249 } |
| 3272 | 3250 |
| 3273 } // namespace voe | 3251 } // namespace voe |
| 3274 } // namespace webrtc | 3252 } // namespace webrtc |
| OLD | NEW |