diff options
author | wu@webrtc.org <wu@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-03-06 23:49:08 +0000 |
---|---|---|
committer | wu@webrtc.org <wu@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-03-06 23:49:08 +0000 |
commit | 9a8232203a0793a3bbd7edc8bba04a4b48e00210 (patch) | |
tree | 7c2ab0789be2304ee9d5f13cde4f54b86c132393 /voice_engine/channel.cc | |
parent | 7a560797ddeafa0472a0bd85aa9ad62b2530ffba (diff) | |
download | webrtc-9a8232203a0793a3bbd7edc8bba04a4b48e00210.tar.gz |
Help to land 7969005 on behalf of solenberg. The review and try is done in 7969005.
- Add ability to VoE to send Absolute Sender Time header extension.
- Refactor handling of RTP header extensions in VoE to work the same as in ViE.
- Add API to enable receiving Absolute Sender Time in VoE.
This is part of the work to include audio packets in bandwidth estimation, for
better accuracy in estimates.
BUG=
TBR=solenberg@webrtc.org,henrikg@webrtc.org,stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/9509004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5654 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/channel.cc')
-rw-r--r-- | voice_engine/channel.cc | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc index 48f98549..480ff494 100644 --- a/voice_engine/channel.cc +++ b/voice_engine/channel.cc @@ -3503,9 +3503,7 @@ Channel::GetRemoteCSRCs(unsigned int arrCSRC[15]) return CSRCs; } -int -Channel::SetRTPAudioLevelIndicationStatus(bool enable, unsigned char ID) -{ +int Channel::SetSendAudioLevelIndicationStatus(bool enable, unsigned char id) { if (rtp_audioproc_.get() == NULL) { rtp_audioproc_.reset(AudioProcessing::Create(VoEModuleId(_instanceId, _channelId))); @@ -3519,23 +3517,24 @@ Channel::SetRTPAudioLevelIndicationStatus(bool enable, unsigned char ID) } _includeAudioLevelIndication = enable; - if (enable) { - rtp_header_parser_->RegisterRtpHeaderExtension(kRtpExtensionAudioLevel, - ID); - } else { - rtp_header_parser_->DeregisterRtpHeaderExtension(kRtpExtensionAudioLevel); - } - return _rtpRtcpModule->SetRTPAudioLevelIndicationStatus(enable, ID); + + return SetSendRtpHeaderExtension(enable, kRtpExtensionAudioLevel, id); } -int -Channel::GetRTPAudioLevelIndicationStatus(bool& enabled, unsigned char& ID) -{ - WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, - VoEId(_instanceId,_channelId), - "GetRTPAudioLevelIndicationStatus() => enabled=%d, ID=%u", - enabled, ID); - return _rtpRtcpModule->GetRTPAudioLevelIndicationStatus(enabled, ID); +int Channel::SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id) { + return SetSendRtpHeaderExtension(enable, kRtpExtensionAbsoluteSendTime, id); +} + +int Channel::SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id) { + rtp_header_parser_->DeregisterRtpHeaderExtension( + kRtpExtensionAbsoluteSendTime); + if (enable) { + if (!rtp_header_parser_->RegisterRtpHeaderExtension( + kRtpExtensionAbsoluteSendTime, id)) { + return -1; + } + } + return 0; } int @@ -5059,5 +5058,14 @@ int Channel::SetRedPayloadType(int red_payload_type) { return 0; } +int Channel::SetSendRtpHeaderExtension(bool enable, RTPExtensionType type, + unsigned char id) { + int error = 0; + _rtpRtcpModule->DeregisterSendRtpHeaderExtension(type); + if (enable) { + error = _rtpRtcpModule->RegisterSendRtpHeaderExtension(type, id); + } + return error; +} } // namespace voe } // namespace webrtc |