From dd3abbb53250072dc5baac0391ebea135be6fa53 Mon Sep 17 00:00:00 2001 From: solenberg Date: Mon, 18 Sep 2017 07:05:30 -0700 Subject: [PATCH] Remove VoERTP_RTCP. BUG=webrtc:4690 Review-Url: https://codereview.webrtc.org/3006383002 Cr-Commit-Position: refs/heads/master@{#19892} --- test/mock_voice_engine.h | 38 ------ voice_engine/BUILD.gn | 3 - voice_engine/channel.cc | 75 ----------- voice_engine/channel.h | 41 ++++-- voice_engine/channel_proxy.h | 4 +- voice_engine/include/voe_rtp_rtcp.h | 151 --------------------- voice_engine/voe_rtp_rtcp_impl.cc | 201 ---------------------------- voice_engine/voe_rtp_rtcp_impl.h | 55 -------- voice_engine/voice_engine_defines.h | 6 - voice_engine/voice_engine_impl.h | 3 - 10 files changed, 30 insertions(+), 547 deletions(-) delete mode 100644 voice_engine/include/voe_rtp_rtcp.h delete mode 100644 voice_engine/voe_rtp_rtcp_impl.cc delete mode 100644 voice_engine/voe_rtp_rtcp_impl.h diff --git a/test/mock_voice_engine.h b/test/mock_voice_engine.h index e388993cf6..45a9f9fd7e 100644 --- a/test/mock_voice_engine.h +++ b/test/mock_voice_engine.h @@ -127,44 +127,6 @@ class MockVoiceEngine : public VoiceEngineImpl { MOCK_METHOD3(ReceivedRTCPPacket, int(int channel, const void* data, size_t length)); - // VoERTP_RTCP - MOCK_METHOD2(SetLocalSSRC, int(int channel, unsigned int ssrc)); - MOCK_METHOD2(GetLocalSSRC, int(int channel, unsigned int& ssrc)); - MOCK_METHOD2(GetRemoteSSRC, int(int channel, unsigned int& ssrc)); - MOCK_METHOD3(SetSendAudioLevelIndicationStatus, - int(int channel, bool enable, unsigned char id)); - MOCK_METHOD3(SetReceiveAudioLevelIndicationStatus, - int(int channel, bool enable, unsigned char id)); - MOCK_METHOD3(SetSendAbsoluteSenderTimeStatus, - int(int channel, bool enable, unsigned char id)); - MOCK_METHOD3(SetReceiveAbsoluteSenderTimeStatus, - int(int channel, bool enable, unsigned char id)); - MOCK_METHOD2(SetRTCPStatus, int(int channel, bool enable)); - MOCK_METHOD2(GetRTCPStatus, int(int channel, bool& enabled)); - MOCK_METHOD2(SetRTCP_CNAME, int(int channel, const char cName[256])); - MOCK_METHOD2(GetRTCP_CNAME, int(int channel, char cName[256])); - MOCK_METHOD2(GetRemoteRTCP_CNAME, int(int channel, char cName[256])); - MOCK_METHOD7(GetRemoteRTCPData, - int(int channel, - unsigned int& NTPHigh, - unsigned int& NTPLow, - unsigned int& timestamp, - unsigned int& playoutTimestamp, - unsigned int* jitter, - unsigned short* fraction_lost)); - MOCK_METHOD4(GetRTPStatistics, - int(int channel, - unsigned int& averageJitterMs, - unsigned int& maxJitterMs, - unsigned int& discardedPackets)); - MOCK_METHOD2(GetRTCPStatistics, int(int channel, CallStatistics& stats)); - MOCK_METHOD2(GetRemoteRTCPReportBlocks, - int(int channel, std::vector* receive_blocks)); - MOCK_METHOD3(SetREDStatus, int(int channel, bool enable, int redPayloadtype)); - MOCK_METHOD3(GetREDStatus, - int(int channel, bool& enable, int& redPayloadtype)); - MOCK_METHOD3(SetNACKStatus, int(int channel, bool enable, int maxNoPackets)); - private: // TODO(ossu): I'm not particularly happy about keeping the decoder factory // here, but due to how gmock is implemented, I cannot just keep it in the diff --git a/voice_engine/BUILD.gn b/voice_engine/BUILD.gn index 5f1ae034ca..600645e93f 100644 --- a/voice_engine/BUILD.gn +++ b/voice_engine/BUILD.gn @@ -19,7 +19,6 @@ rtc_static_library("voice_engine") { "include/voe_base.h", "include/voe_errors.h", "include/voe_network.h", - "include/voe_rtp_rtcp.h", "monitor_module.h", "output_mixer.cc", "output_mixer.h", @@ -37,8 +36,6 @@ rtc_static_library("voice_engine") { "voe_base_impl.h", "voe_network_impl.cc", "voe_network_impl.h", - "voe_rtp_rtcp_impl.cc", - "voe_rtp_rtcp_impl.h", "voice_engine_defines.h", "voice_engine_impl.cc", "voice_engine_impl.h", diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc index 49bc381746..a44ccb819a 100644 --- a/voice_engine/channel.cc +++ b/voice_engine/channel.cc @@ -39,7 +39,6 @@ #include "rtc_base/timeutils.h" #include "system_wrappers/include/field_trial.h" #include "system_wrappers/include/trace.h" -#include "voice_engine/include/voe_rtp_rtcp.h" #include "voice_engine/output_mixer.h" #include "voice_engine/statistics.h" #include "voice_engine/utility.h" @@ -1576,11 +1575,6 @@ int Channel::SetLocalSSRC(unsigned int ssrc) { return 0; } -int Channel::GetLocalSSRC(unsigned int& ssrc) { - ssrc = _rtpRtcpModule->SSRC(); - return 0; -} - int Channel::GetRemoteSSRC(unsigned int& ssrc) { ssrc = rtp_receiver_->SSRC(); return 0; @@ -1671,12 +1665,6 @@ void Channel::SetRTCPStatus(bool enable) { _rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff); } -int Channel::GetRTCPStatus(bool& enabled) { - RtcpMode method = _rtpRtcpModule->RTCP(); - enabled = (method != RtcpMode::kOff); - return 0; -} - int Channel::SetRTCP_CNAME(const char cName[256]) { WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), "Channel::SetRTCP_CNAME()"); @@ -1689,69 +1677,6 @@ int Channel::SetRTCP_CNAME(const char cName[256]) { return 0; } -int Channel::GetRemoteRTCP_CNAME(char cName[256]) { - if (cName == NULL) { - _engineStatisticsPtr->SetLastError( - VE_INVALID_ARGUMENT, kTraceError, - "GetRemoteRTCP_CNAME() invalid CNAME input buffer"); - return -1; - } - char cname[RTCP_CNAME_SIZE]; - const uint32_t remoteSSRC = rtp_receiver_->SSRC(); - if (_rtpRtcpModule->RemoteCNAME(remoteSSRC, cname) != 0) { - _engineStatisticsPtr->SetLastError( - VE_CANNOT_RETRIEVE_CNAME, kTraceError, - "GetRemoteRTCP_CNAME() failed to retrieve remote RTCP CNAME"); - return -1; - } - strcpy(cName, cname); - return 0; -} - -int Channel::SendApplicationDefinedRTCPPacket( - unsigned char subType, - unsigned int name, - const char* data, - unsigned short dataLengthInBytes) { - WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), - "Channel::SendApplicationDefinedRTCPPacket()"); - if (!channel_state_.Get().sending) { - _engineStatisticsPtr->SetLastError( - VE_NOT_SENDING, kTraceError, - "SendApplicationDefinedRTCPPacket() not sending"); - return -1; - } - if (NULL == data) { - _engineStatisticsPtr->SetLastError( - VE_INVALID_ARGUMENT, kTraceError, - "SendApplicationDefinedRTCPPacket() invalid data value"); - return -1; - } - if (dataLengthInBytes % 4 != 0) { - _engineStatisticsPtr->SetLastError( - VE_INVALID_ARGUMENT, kTraceError, - "SendApplicationDefinedRTCPPacket() invalid length value"); - return -1; - } - RtcpMode status = _rtpRtcpModule->RTCP(); - if (status == RtcpMode::kOff) { - _engineStatisticsPtr->SetLastError( - VE_RTCP_ERROR, kTraceError, - "SendApplicationDefinedRTCPPacket() RTCP is disabled"); - return -1; - } - - // Create and schedule the RTCP APP packet for transmission - if (_rtpRtcpModule->SetRTCPApplicationSpecificData( - subType, name, (const unsigned char*)data, dataLengthInBytes) != 0) { - _engineStatisticsPtr->SetLastError( - VE_SEND_ERROR, kTraceError, - "SendApplicationDefinedRTCPPacket() failed to send RTCP packet"); - return -1; - } - return 0; -} - int Channel::GetRemoteRTCPReportBlocks( std::vector* report_blocks) { if (report_blocks == NULL) { diff --git a/voice_engine/channel.h b/voice_engine/channel.h index 5c95a64f1c..48aeafe17c 100644 --- a/voice_engine/channel.h +++ b/voice_engine/channel.h @@ -56,13 +56,37 @@ class RtpPacketReceived; class RtpRtcp; class RtpTransportControllerSendInterface; class TelephoneEventHandler; -class VoERTPObserver; class VoiceEngineObserver; -struct CallStatistics; -struct ReportBlock; struct SenderInfo; +struct CallStatistics { + unsigned short fractionLost; + unsigned int cumulativeLost; + unsigned int extendedMax; + unsigned int jitterSamples; + int64_t rttMs; + size_t bytesSent; + int packetsSent; + size_t bytesReceived; + int packetsReceived; + // The capture ntp time (in local timebase) of the first played out audio + // frame. + int64_t capture_start_ntp_time_ms_; +}; + +// See section 6.4.2 in http://www.ietf.org/rfc/rfc3550.txt for details. +struct ReportBlock { + uint32_t sender_SSRC; // SSRC of sender + uint32_t source_SSRC; + uint8_t fraction_lost; + uint32_t cumulative_num_packets_lost; + uint32_t extended_highest_sequence_number; + uint32_t interarrival_jitter; + uint32_t last_SR_timestamp; + uint32_t delay_since_last_SR; +}; + namespace voe { class OutputMixer; @@ -215,10 +239,8 @@ class Channel int SendTelephoneEventOutband(int event, int duration_ms); int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency); - // VoERTP_RTCP + // RTP+RTCP int SetLocalSSRC(unsigned int ssrc); - int GetLocalSSRC(unsigned int& ssrc); - int GetRemoteSSRC(unsigned int& ssrc); int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); void EnableSendTransportSequenceNumber(int id); @@ -231,13 +253,7 @@ class Channel void ResetSenderCongestionControlObjects(); void ResetReceiverCongestionControlObjects(); void SetRTCPStatus(bool enable); - int GetRTCPStatus(bool& enabled); int SetRTCP_CNAME(const char cName[256]); - int GetRemoteRTCP_CNAME(char cName[256]); - int SendApplicationDefinedRTCPPacket(unsigned char subType, - unsigned int name, - const char* data, - unsigned short dataLengthInBytes); int GetRemoteRTCPReportBlocks(std::vector* report_blocks); int GetRTPStatistics(CallStatistics& stats); void SetNACKStatus(bool enable, int maxNumberOfPackets); @@ -343,6 +359,7 @@ class Channel private: class ProcessAndEncodeAudioTask; + int GetRemoteSSRC(unsigned int& ssrc); void OnUplinkPacketLossRate(float packet_loss_rate); bool InputMute() const; bool OnRtpPacketWithHeader(const uint8_t* received_packet, diff --git a/voice_engine/channel_proxy.h b/voice_engine/channel_proxy.h index ca11b58764..40246aaa10 100644 --- a/voice_engine/channel_proxy.h +++ b/voice_engine/channel_proxy.h @@ -18,8 +18,8 @@ #include "rtc_base/constructormagic.h" #include "rtc_base/race_checker.h" #include "rtc_base/thread_checker.h" +#include "voice_engine/channel.h" #include "voice_engine/channel_manager.h" -#include "voice_engine/include/voe_rtp_rtcp.h" #include #include @@ -42,8 +42,6 @@ class TransportFeedbackObserver; namespace voe { -class Channel; - // This class provides the "view" of a voe::Channel that we need to implement // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two // purposes: diff --git a/voice_engine/include/voe_rtp_rtcp.h b/voice_engine/include/voe_rtp_rtcp.h deleted file mode 100644 index e863a28666..0000000000 --- a/voice_engine/include/voe_rtp_rtcp.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This sub-API supports the following functionalities: -// -// - Callbacks for RTP and RTCP events such as modified SSRC or CSRC. -// - SSRC handling. -// - Transmission of RTCP sender reports. -// - Obtaining RTCP data from incoming RTCP sender reports. -// - RTP and RTCP statistics (jitter, packet loss, RTT etc.). -// - Redundant Coding (RED) -// - Writing RTP and RTCP packets to binary files for off-line analysis of -// the call quality. -// -// Usage example, omitting error checking: -// -// using namespace webrtc; -// VoiceEngine* voe = VoiceEngine::Create(); -// VoEBase* base = VoEBase::GetInterface(voe); -// VoERTP_RTCP* rtp_rtcp = VoERTP_RTCP::GetInterface(voe); -// base->Init(); -// int ch = base->CreateChannel(); -// ... -// rtp_rtcp->SetLocalSSRC(ch, 12345); -// ... -// base->DeleteChannel(ch); -// base->Terminate(); -// base->Release(); -// rtp_rtcp->Release(); -// VoiceEngine::Delete(voe); -// -#ifndef VOICE_ENGINE_VOE_RTP_RTCP_H_ -#define VOICE_ENGINE_VOE_RTP_RTCP_H_ - -#include -#include "common_types.h" // NOLINT(build/include) - -namespace webrtc { - -class VoiceEngine; - -// VoERTPObserver -class WEBRTC_DLLEXPORT VoERTPObserver { - public: - virtual void OnIncomingCSRCChanged(int channel, - unsigned int CSRC, - bool added) = 0; - - virtual void OnIncomingSSRCChanged(int channel, unsigned int SSRC) = 0; - - protected: - virtual ~VoERTPObserver() {} -}; - -// CallStatistics -struct CallStatistics { - unsigned short fractionLost; - unsigned int cumulativeLost; - unsigned int extendedMax; - unsigned int jitterSamples; - int64_t rttMs; - size_t bytesSent; - int packetsSent; - size_t bytesReceived; - int packetsReceived; - // The capture ntp time (in local timebase) of the first played out audio - // frame. - int64_t capture_start_ntp_time_ms_; -}; - -// See section 6.4.1 in http://www.ietf.org/rfc/rfc3550.txt for details. -struct SenderInfo { - uint32_t NTP_timestamp_high; - uint32_t NTP_timestamp_low; - uint32_t RTP_timestamp; - uint32_t sender_packet_count; - uint32_t sender_octet_count; -}; - -// See section 6.4.2 in http://www.ietf.org/rfc/rfc3550.txt for details. -struct ReportBlock { - uint32_t sender_SSRC; // SSRC of sender - uint32_t source_SSRC; - uint8_t fraction_lost; - uint32_t cumulative_num_packets_lost; - uint32_t extended_highest_sequence_number; - uint32_t interarrival_jitter; - uint32_t last_SR_timestamp; - uint32_t delay_since_last_SR; -}; - -// VoERTP_RTCP -class WEBRTC_DLLEXPORT VoERTP_RTCP { - public: - // Factory for the VoERTP_RTCP sub-API. Increases an internal - // reference counter if successful. Returns NULL if the API is not - // supported or if construction fails. - static VoERTP_RTCP* GetInterface(VoiceEngine* voiceEngine); - - // Releases the VoERTP_RTCP sub-API and decreases an internal - // reference counter. Returns the new reference count. This value should - // be zero for all sub-API:s before the VoiceEngine object can be safely - // deleted. - virtual int Release() = 0; - - // Sets the local RTP synchronization source identifier (SSRC) explicitly. - virtual int SetLocalSSRC(int channel, unsigned int ssrc) = 0; - - // Gets the local RTP SSRC of a specified |channel|. - virtual int GetLocalSSRC(int channel, unsigned int& ssrc) = 0; - - // Gets the SSRC of the incoming RTP packets. - virtual int GetRemoteSSRC(int channel, unsigned int& ssrc) = 0; - - // Sets the status of rtp-audio-level-indication on a specific |channel|. - virtual int SetSendAudioLevelIndicationStatus(int channel, - bool enable, - unsigned char id = 1) = 0; - - // Sets the RTCP status on a specific |channel|. - virtual int SetRTCPStatus(int channel, bool enable) = 0; - - // Gets the RTCP status on a specific |channel|. - virtual int GetRTCPStatus(int channel, bool& enabled) = 0; - - // Sets the canonical name (CNAME) parameter for RTCP reports on a - // specific |channel|. - virtual int SetRTCP_CNAME(int channel, const char cName[256]) = 0; - - // Gets the canonical name (CNAME) parameter for incoming RTCP reports - // on a specific channel. - virtual int GetRemoteRTCP_CNAME(int channel, char cName[256]) = 0; - - // Gets RTCP statistics for a specific |channel|. - virtual int GetRTCPStatistics(int channel, CallStatistics& stats) = 0; - - protected: - VoERTP_RTCP() {} - virtual ~VoERTP_RTCP() {} -}; - -} // namespace webrtc - -#endif // #ifndef VOICE_ENGINE_VOE_RTP_RTCP_H_ diff --git a/voice_engine/voe_rtp_rtcp_impl.cc b/voice_engine/voe_rtp_rtcp_impl.cc deleted file mode 100644 index 15d5022039..0000000000 --- a/voice_engine/voe_rtp_rtcp_impl.cc +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "system_wrappers/include/file_wrapper.h" -#include "system_wrappers/include/trace.h" -#include "voice_engine/include/voe_errors.h" -#include "voice_engine/voe_rtp_rtcp_impl.h" -#include "voice_engine/voice_engine_impl.h" - -#include "voice_engine/channel.h" -#include "voice_engine/transmit_mixer.h" - -namespace webrtc { - -VoERTP_RTCP* VoERTP_RTCP::GetInterface(VoiceEngine* voiceEngine) { - if (NULL == voiceEngine) { - return NULL; - } - VoiceEngineImpl* s = static_cast(voiceEngine); - s->AddRef(); - return s; -} - -VoERTP_RTCPImpl::VoERTP_RTCPImpl(voe::SharedData* shared) : _shared(shared) { - WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), - "VoERTP_RTCPImpl::VoERTP_RTCPImpl() - ctor"); -} - -VoERTP_RTCPImpl::~VoERTP_RTCPImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), - "VoERTP_RTCPImpl::~VoERTP_RTCPImpl() - dtor"); -} - -int VoERTP_RTCPImpl::SetLocalSSRC(int channel, unsigned int ssrc) { - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "SetLocalSSRC(channel=%d, %lu)", channel, ssrc); - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "SetLocalSSRC() failed to locate channel"); - return -1; - } - return channelPtr->SetLocalSSRC(ssrc); -} - -int VoERTP_RTCPImpl::GetLocalSSRC(int channel, unsigned int& ssrc) { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetLocalSSRC() failed to locate channel"); - return -1; - } - return channelPtr->GetLocalSSRC(ssrc); -} - -int VoERTP_RTCPImpl::GetRemoteSSRC(int channel, unsigned int& ssrc) { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetRemoteSSRC() failed to locate channel"); - return -1; - } - return channelPtr->GetRemoteSSRC(ssrc); -} - -int VoERTP_RTCPImpl::SetSendAudioLevelIndicationStatus(int channel, - bool enable, - unsigned char id) { - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "SetSendAudioLevelIndicationStatus(channel=%d, enable=%d," - " ID=%u)", - channel, enable, id); - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - if (enable && (id < kVoiceEngineMinRtpExtensionId || - id > kVoiceEngineMaxRtpExtensionId)) { - // [RFC5285] The 4-bit id is the local identifier of this element in - // the range 1-14 inclusive. - _shared->SetLastError( - VE_INVALID_ARGUMENT, kTraceError, - "SetSendAudioLevelIndicationStatus() invalid ID parameter"); - return -1; - } - - // Set state and id for the specified channel. - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError( - VE_CHANNEL_NOT_VALID, kTraceError, - "SetSendAudioLevelIndicationStatus() failed to locate channel"); - return -1; - } - return channelPtr->SetSendAudioLevelIndicationStatus(enable, id); -} - -int VoERTP_RTCPImpl::SetRTCPStatus(int channel, bool enable) { - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "SetRTCPStatus(channel=%d, enable=%d)", channel, enable); - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "SetRTCPStatus() failed to locate channel"); - return -1; - } - channelPtr->SetRTCPStatus(enable); - return 0; -} - -int VoERTP_RTCPImpl::GetRTCPStatus(int channel, bool& enabled) { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetRTCPStatus() failed to locate channel"); - return -1; - } - return channelPtr->GetRTCPStatus(enabled); -} - -int VoERTP_RTCPImpl::SetRTCP_CNAME(int channel, const char cName[256]) { - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "SetRTCP_CNAME(channel=%d, cName=%s)", channel, cName); - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "SetRTCP_CNAME() failed to locate channel"); - return -1; - } - return channelPtr->SetRTCP_CNAME(cName); -} - -int VoERTP_RTCPImpl::GetRemoteRTCP_CNAME(int channel, char cName[256]) { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetRemoteRTCP_CNAME() failed to locate channel"); - return -1; - } - return channelPtr->GetRemoteRTCP_CNAME(cName); -} - -int VoERTP_RTCPImpl::GetRTCPStatistics(int channel, CallStatistics& stats) { - if (!_shared->statistics().Initialized()) { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); - voe::Channel* channelPtr = ch.channel(); - if (channelPtr == NULL) { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetRTPStatistics() failed to locate channel"); - return -1; - } - return channelPtr->GetRTPStatistics(stats); -} - -} // namespace webrtc diff --git a/voice_engine/voe_rtp_rtcp_impl.h b/voice_engine/voe_rtp_rtcp_impl.h deleted file mode 100644 index b640bdfbd3..0000000000 --- a/voice_engine/voe_rtp_rtcp_impl.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H_ -#define VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H_ - -#include "voice_engine/include/voe_rtp_rtcp.h" - -#include "voice_engine/shared_data.h" - -namespace webrtc { - -class VoERTP_RTCPImpl : public VoERTP_RTCP { - public: - // RTCP - int SetRTCPStatus(int channel, bool enable) override; - - int GetRTCPStatus(int channel, bool& enabled) override; - - int SetRTCP_CNAME(int channel, const char cName[256]) override; - - int GetRemoteRTCP_CNAME(int channel, char cName[256]) override; - - // SSRC - int SetLocalSSRC(int channel, unsigned int ssrc) override; - - int GetLocalSSRC(int channel, unsigned int& ssrc) override; - - int GetRemoteSSRC(int channel, unsigned int& ssrc) override; - - // RTP Header Extension for Client-to-Mixer Audio Level Indication - int SetSendAudioLevelIndicationStatus(int channel, - bool enable, - unsigned char id) override; - - int GetRTCPStatistics(int channel, CallStatistics& stats) override; - - protected: - VoERTP_RTCPImpl(voe::SharedData* shared); - ~VoERTP_RTCPImpl() override; - - private: - voe::SharedData* _shared; -}; - -} // namespace webrtc - -#endif // VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H_ diff --git a/voice_engine/voice_engine_defines.h b/voice_engine/voice_engine_defines.h index c16dd56468..bc5eb1b81f 100644 --- a/voice_engine/voice_engine_defines.h +++ b/voice_engine/voice_engine_defines.h @@ -56,12 +56,6 @@ enum { kVoiceEngineMinMinPlayoutDelayMs = 0 }; // Highest minimum playout delay enum { kVoiceEngineMaxMinPlayoutDelayMs = 10000 }; -// RTP/RTCP -// Min 4-bit ID for RTP extension (see section 4.2 in RFC 5285) -enum { kVoiceEngineMinRtpExtensionId = 1 }; -// Max 4-bit ID for RTP extension -enum { kVoiceEngineMaxRtpExtensionId = 14 }; - } // namespace webrtc namespace webrtc { diff --git a/voice_engine/voice_engine_impl.h b/voice_engine/voice_engine_impl.h index ef03e706a1..2ede6c3bdf 100644 --- a/voice_engine/voice_engine_impl.h +++ b/voice_engine/voice_engine_impl.h @@ -17,7 +17,6 @@ #include "typedefs.h" // NOLINT(build/include) #include "voice_engine/voe_base_impl.h" #include "voice_engine/voe_network_impl.h" -#include "voice_engine/voe_rtp_rtcp_impl.h" namespace webrtc { namespace voe { @@ -27,13 +26,11 @@ class ChannelProxy; class VoiceEngineImpl : public voe::SharedData, // Must be the first base class public VoiceEngine, public VoENetworkImpl, - public VoERTP_RTCPImpl, public VoEBaseImpl { public: VoiceEngineImpl() : SharedData(), VoENetworkImpl(this), - VoERTP_RTCPImpl(this), VoEBaseImpl(this), _ref_count(0) {} ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }