1470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com/* 20975d2158c0479fd0546b4411b33ca709c1b683eleozwang@webrtc.org * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com * 4470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com * Use of this source code is governed by a BSD-style license 5470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com * that can be found in the LICENSE file in the root of the source 6470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com * tree. An additional intellectual property rights grant can be found 7470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com * in the file PATENTS. All contributing project authors may 8470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com * be found in the AUTHORS file in the root of the source tree. 9470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com */ 10470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 1198f53510b222f71fdd8b799b2f33737ceeb28c61Henrik Kjellander#include "webrtc/system_wrappers/include/critical_section_wrapper.h" 1298f53510b222f71fdd8b799b2f33737ceeb28c61Henrik Kjellander#include "webrtc/system_wrappers/include/file_wrapper.h" 1398f53510b222f71fdd8b799b2f33737ceeb28c61Henrik Kjellander#include "webrtc/system_wrappers/include/trace.h" 14956aa7e0874f2e08c335a82a2c32f400fac8b031pbos@webrtc.org#include "webrtc/voice_engine/include/voe_errors.h" 15956aa7e0874f2e08c335a82a2c32f400fac8b031pbos@webrtc.org#include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" 16956aa7e0874f2e08c335a82a2c32f400fac8b031pbos@webrtc.org#include "webrtc/voice_engine/voice_engine_impl.h" 17470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 18956aa7e0874f2e08c335a82a2c32f400fac8b031pbos@webrtc.org#include "webrtc/voice_engine/channel.h" 19956aa7e0874f2e08c335a82a2c32f400fac8b031pbos@webrtc.org#include "webrtc/voice_engine/transmit_mixer.h" 20470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 21470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.comnamespace webrtc { 22470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 230d266054acece70259fc1e85026194154f41e5a0Jelena MarusicVoERTP_RTCP* VoERTP_RTCP::GetInterface(VoiceEngine* voiceEngine) { 24470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#ifndef WEBRTC_VOICE_ENGINE_RTP_RTCP_API 250d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return NULL; 26470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#else 270d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (NULL == voiceEngine) { 280d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return NULL; 290d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 300d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VoiceEngineImpl* s = static_cast<VoiceEngineImpl*>(voiceEngine); 310d266054acece70259fc1e85026194154f41e5a0Jelena Marusic s->AddRef(); 320d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return s; 33470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#endif 34470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 35470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 36470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API 37470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 380d266054acece70259fc1e85026194154f41e5a0Jelena MarusicVoERTP_RTCPImpl::VoERTP_RTCPImpl(voe::SharedData* shared) : _shared(shared) { 390d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), 400d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "VoERTP_RTCPImpl::VoERTP_RTCPImpl() - ctor"); 41470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 42470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 430d266054acece70259fc1e85026194154f41e5a0Jelena MarusicVoERTP_RTCPImpl::~VoERTP_RTCPImpl() { 440d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_shared->instance_id(), -1), 450d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "VoERTP_RTCPImpl::~VoERTP_RTCPImpl() - dtor"); 46470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 47470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 480d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::SetLocalSSRC(int channel, unsigned int ssrc) { 490d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 500d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetLocalSSRC(channel=%d, %lu)", channel, ssrc); 510d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 520d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 530d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 540d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 550d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 560d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 570d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 580d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 590d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetLocalSSRC() failed to locate channel"); 600d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 610d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 620d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->SetLocalSSRC(ssrc); 63470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 64470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 650d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::GetLocalSSRC(int channel, unsigned int& ssrc) { 660d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 670d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 680d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 690d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 700d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 710d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 720d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 730d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 740d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetLocalSSRC() failed to locate channel"); 750d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 760d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 770d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetLocalSSRC(ssrc); 78470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 79470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 800d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::GetRemoteSSRC(int channel, unsigned int& ssrc) { 810d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 820d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 830d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 840d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 850d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 860d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 870d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 880d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 890d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetRemoteSSRC() failed to locate channel"); 900d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 910d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 920d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetRemoteSSRC(ssrc); 93470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 94470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 95ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.orgint VoERTP_RTCPImpl::SetSendAudioLevelIndicationStatus(int channel, 96ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org bool enable, 970d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned char id) { 980d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 990d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetSendAudioLevelIndicationStatus(channel=%d, enable=%d," 1000d266054acece70259fc1e85026194154f41e5a0Jelena Marusic " ID=%u)", 1010d266054acece70259fc1e85026194154f41e5a0Jelena Marusic channel, enable, id); 1020d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 1030d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 1040d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 1050d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 1060d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (enable && (id < kVoiceEngineMinRtpExtensionId || 1070d266054acece70259fc1e85026194154f41e5a0Jelena Marusic id > kVoiceEngineMaxRtpExtensionId)) { 1080d266054acece70259fc1e85026194154f41e5a0Jelena Marusic // [RFC5285] The 4-bit id is the local identifier of this element in 1090d266054acece70259fc1e85026194154f41e5a0Jelena Marusic // the range 1-14 inclusive. 1100d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 1110d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_INVALID_ARGUMENT, kTraceError, 1120d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetSendAudioLevelIndicationStatus() invalid ID parameter"); 1130d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 1140d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 115470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 1160d266054acece70259fc1e85026194154f41e5a0Jelena Marusic // Set state and id for the specified channel. 1170d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 1180d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 1190d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 1200d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 1210d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_CHANNEL_NOT_VALID, kTraceError, 1220d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetSendAudioLevelIndicationStatus() failed to locate channel"); 1230d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 1240d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 1250d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->SetSendAudioLevelIndicationStatus(enable, id); 126470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 127470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 12893fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.orgint VoERTP_RTCPImpl::SetReceiveAudioLevelIndicationStatus(int channel, 12993fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org bool enable, 13093fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org unsigned char id) { 1310d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE( 1320d266054acece70259fc1e85026194154f41e5a0Jelena Marusic kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 13393fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org "SetReceiveAudioLevelIndicationStatus(channel=%d, enable=%d, id=%u)", 13493fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org channel, enable, id); 13593fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org if (!_shared->statistics().Initialized()) { 13693fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org _shared->SetLastError(VE_NOT_INITED, kTraceError); 13793fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org return -1; 13893fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org } 1390d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (enable && (id < kVoiceEngineMinRtpExtensionId || 1400d266054acece70259fc1e85026194154f41e5a0Jelena Marusic id > kVoiceEngineMaxRtpExtensionId)) { 14193fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org // [RFC5285] The 4-bit id is the local identifier of this element in 14293fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org // the range 1-14 inclusive. 1430d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 1440d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_INVALID_ARGUMENT, kTraceError, 14593fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org "SetReceiveAbsoluteSenderTimeStatus() invalid id parameter"); 14693fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org return -1; 14793fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org } 14893fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org // Set state and id for the specified channel. 14993fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 15093fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org voe::Channel* channel_ptr = ch.channel(); 15193fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org if (channel_ptr == NULL) { 1520d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 1530d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_CHANNEL_NOT_VALID, kTraceError, 15493fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org "SetReceiveAudioLevelIndicationStatus() failed to locate channel"); 15593fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org return -1; 15693fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org } 15793fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org return channel_ptr->SetReceiveAudioLevelIndicationStatus(enable, id); 15893fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org} 15993fd25c20c688961569d3631b875c8ee0dfc2a80wu@webrtc.org 160ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.orgint VoERTP_RTCPImpl::SetSendAbsoluteSenderTimeStatus(int channel, 161ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org bool enable, 162ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org unsigned char id) { 163ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 164ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org "SetSendAbsoluteSenderTimeStatus(channel=%d, enable=%d, id=%u)", 165ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org channel, enable, id); 166ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org if (!_shared->statistics().Initialized()) { 167ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org _shared->SetLastError(VE_NOT_INITED, kTraceError); 168ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return -1; 169ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org } 170ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org if (enable && (id < kVoiceEngineMinRtpExtensionId || 171ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org id > kVoiceEngineMaxRtpExtensionId)) { 172ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org // [RFC5285] The 4-bit id is the local identifier of this element in 173ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org // the range 1-14 inclusive. 1740d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 1750d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_INVALID_ARGUMENT, kTraceError, 176ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org "SetSendAbsoluteSenderTimeStatus() invalid id parameter"); 177ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return -1; 178ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org } 179ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org // Set state and id for the specified channel. 180ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 181ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org voe::Channel* channelPtr = ch.channel(); 182ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org if (channelPtr == NULL) { 1830d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 1840d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_CHANNEL_NOT_VALID, kTraceError, 185ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org "SetSendAbsoluteSenderTimeStatus() failed to locate channel"); 186ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return -1; 187ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org } 188ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return channelPtr->SetSendAbsoluteSenderTimeStatus(enable, id); 189ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org} 190ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org 191ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.orgint VoERTP_RTCPImpl::SetReceiveAbsoluteSenderTimeStatus(int channel, 192ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org bool enable, 193ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org unsigned char id) { 1940d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE( 1950d266054acece70259fc1e85026194154f41e5a0Jelena Marusic kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 196ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org "SetReceiveAbsoluteSenderTimeStatus(channel=%d, enable=%d, id=%u)", 197ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org channel, enable, id); 198ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org if (!_shared->statistics().Initialized()) { 199ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org _shared->SetLastError(VE_NOT_INITED, kTraceError); 200ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return -1; 201ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org } 202ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org if (enable && (id < kVoiceEngineMinRtpExtensionId || 203ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org id > kVoiceEngineMaxRtpExtensionId)) { 204ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org // [RFC5285] The 4-bit id is the local identifier of this element in 205ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org // the range 1-14 inclusive. 2060d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 2070d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_INVALID_ARGUMENT, kTraceError, 208ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org "SetReceiveAbsoluteSenderTimeStatus() invalid id parameter"); 209ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return -1; 210ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org } 211ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org // Set state and id for the specified channel. 212ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 213ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org voe::Channel* channelPtr = ch.channel(); 214ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org if (channelPtr == NULL) { 2150d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 2160d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_CHANNEL_NOT_VALID, kTraceError, 217ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org "SetReceiveAbsoluteSenderTimeStatus() failed to locate channel"); 218ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return -1; 219ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org } 220ebdb0e3ad0a787bee066d12cdcd115a38b0a10d1wu@webrtc.org return channelPtr->SetReceiveAbsoluteSenderTimeStatus(enable, id); 221470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 222470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 2230d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::SetRTCPStatus(int channel, bool enable) { 2240d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 2250d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetRTCPStatus(channel=%d, enable=%d)", channel, enable); 2260d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 2270d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 2280d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2290d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2300d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 2310d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 2320d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 2330d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 2340d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetRTCPStatus() failed to locate channel"); 2350d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2360d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2370d266054acece70259fc1e85026194154f41e5a0Jelena Marusic channelPtr->SetRTCPStatus(enable); 2380d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return 0; 239470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 240470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 2410d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::GetRTCPStatus(int channel, bool& enabled) { 2420d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 2430d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 2440d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2450d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2460d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 2470d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 2480d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 2490d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 2500d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetRTCPStatus() failed to locate channel"); 2510d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2520d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2530d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetRTCPStatus(enabled); 254470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 255470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 2560d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::SetRTCP_CNAME(int channel, const char cName[256]) { 2570d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 2580d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetRTCP_CNAME(channel=%d, cName=%s)", channel, cName); 2590d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 2600d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 2610d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2620d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2630d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 2640d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 2650d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 2660d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 2670d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetRTCP_CNAME() failed to locate channel"); 2680d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2690d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2700d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->SetRTCP_CNAME(cName); 271470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 272470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 2730d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::GetRemoteRTCP_CNAME(int channel, char cName[256]) { 2740d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 2750d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 2760d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2770d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2780d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 2790d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 2800d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 2810d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 2820d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetRemoteRTCP_CNAME() failed to locate channel"); 2830d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 2840d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 2850d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetRemoteRTCP_CNAME(cName); 286470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 287470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 288470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.comint VoERTP_RTCPImpl::GetRemoteRTCPData( 289470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com int channel, 2900d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned int& NTPHigh, // from sender info in SR 2910d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned int& NTPLow, // from sender info in SR 2920d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned int& timestamp, // from sender info in SR 2930d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned int& playoutTimestamp, // derived locally 2940d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned int* jitter, // from report block 1 in SR/RR 2950d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned short* fractionLost) // from report block 1 in SR/RR 296470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com{ 2970d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 2980d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 2990d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3000d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3010d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 3020d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 3030d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 3040d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 3050d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetRemoteRTCP_CNAME() failed to locate channel"); 3060d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3070d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3080d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetRemoteRTCPData(NTPHigh, NTPLow, timestamp, 3090d266054acece70259fc1e85026194154f41e5a0Jelena Marusic playoutTimestamp, jitter, fractionLost); 310470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 311470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 312470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.comint VoERTP_RTCPImpl::GetRTPStatistics(int channel, 313470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com unsigned int& averageJitterMs, 314470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com unsigned int& maxJitterMs, 3150d266054acece70259fc1e85026194154f41e5a0Jelena Marusic unsigned int& discardedPackets) { 3160d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 3170d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 3180d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3190d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3200d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 3210d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 3220d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 3230d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 3240d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetRTPStatistics() failed to locate channel"); 3250d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3260d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3270d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetRTPStatistics(averageJitterMs, maxJitterMs, 3280d266054acece70259fc1e85026194154f41e5a0Jelena Marusic discardedPackets); 329470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 330470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 3310d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::GetRTCPStatistics(int channel, CallStatistics& stats) { 3320d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 3330d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 3340d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3350d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3360d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 3370d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 3380d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 3390d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 3400d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetRTPStatistics() failed to locate channel"); 3410d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3420d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3430d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetRTPStatistics(stats); 344470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 345470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 3468a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.orgint VoERTP_RTCPImpl::GetRemoteRTCPReportBlocks( 3478a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org int channel, std::vector<ReportBlock>* report_blocks) { 3488a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org if (!_shared->statistics().Initialized()) { 3498a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org _shared->SetLastError(VE_NOT_INITED, kTraceError); 3508a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org return -1; 3518a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org } 352676ff1ed893d6ae59a7ce29a4428e0d7c9f855d9pbos@webrtc.org voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 353676ff1ed893d6ae59a7ce29a4428e0d7c9f855d9pbos@webrtc.org voe::Channel* channel_ptr = ch.channel(); 3548a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org if (channel_ptr == NULL) { 3550d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError( 3560d266054acece70259fc1e85026194154f41e5a0Jelena Marusic VE_CHANNEL_NOT_VALID, kTraceError, 3578a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org "GetRemoteRTCPReportBlocks() failed to locate channel"); 3588a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org return -1; 3598a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org } 3608a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org return channel_ptr->GetRemoteRTCPReportBlocks(report_blocks); 3618a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org} 3628a2fc88459dc507a67594e3127143e16af612fc9henrika@webrtc.org 3630d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::SetREDStatus(int channel, 3640d266054acece70259fc1e85026194154f41e5a0Jelena Marusic bool enable, 3650d266054acece70259fc1e85026194154f41e5a0Jelena Marusic int redPayloadtype) { 3660d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 3670d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetREDStatus(channel=%d, enable=%d, redPayloadtype=%d)", 3680d266054acece70259fc1e85026194154f41e5a0Jelena Marusic channel, enable, redPayloadtype); 369470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#ifdef WEBRTC_CODEC_RED 3700d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 3710d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 3720d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 3730d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3740d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 3750d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 3760d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 3770d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 3780d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetREDStatus() failed to locate channel"); 379470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com return -1; 3800d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3810d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->SetREDStatus(enable, redPayloadtype); 3820d266054acece70259fc1e85026194154f41e5a0Jelena Marusic#else 3830d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError, 3840d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetREDStatus() RED is not supported"); 3850d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 386470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#endif 387470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 388470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 389c1a40a7b68a8d253b0ba32b89f3126931eeaeab3minyue@webrtc.orgint VoERTP_RTCPImpl::GetREDStatus(int channel, 390470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com bool& enabled, 3910d266054acece70259fc1e85026194154f41e5a0Jelena Marusic int& redPayloadtype) { 392470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#ifdef WEBRTC_CODEC_RED 3930d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (!_shared->statistics().Initialized()) { 3940d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_NOT_INITED, kTraceError); 395470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com return -1; 3960d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 3970d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 3980d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 3990d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 4000d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 4010d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetREDStatus() failed to locate channel"); 4020d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 4030d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 4040d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return channelPtr->GetREDStatus(enabled, redPayloadtype); 4050d266054acece70259fc1e85026194154f41e5a0Jelena Marusic#else 4060d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceError, 4070d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "GetREDStatus() RED is not supported"); 4080d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 409470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#endif 410470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} 411470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 4120d266054acece70259fc1e85026194154f41e5a0Jelena Marusicint VoERTP_RTCPImpl::SetNACKStatus(int channel, bool enable, int maxNoPackets) { 4130d266054acece70259fc1e85026194154f41e5a0Jelena Marusic WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 4140d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetNACKStatus(channel=%d, enable=%d, maxNoPackets=%d)", channel, 4150d266054acece70259fc1e85026194154f41e5a0Jelena Marusic enable, maxNoPackets); 416b35d2e3abcc44b018aa42a571212e4aaac75b65bniklas.enbom@webrtc.org 4170d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 4180d266054acece70259fc1e85026194154f41e5a0Jelena Marusic voe::Channel* channelPtr = ch.channel(); 4190d266054acece70259fc1e85026194154f41e5a0Jelena Marusic if (channelPtr == NULL) { 4200d266054acece70259fc1e85026194154f41e5a0Jelena Marusic _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 4210d266054acece70259fc1e85026194154f41e5a0Jelena Marusic "SetNACKStatus() failed to locate channel"); 4220d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return -1; 4230d266054acece70259fc1e85026194154f41e5a0Jelena Marusic } 4240d266054acece70259fc1e85026194154f41e5a0Jelena Marusic channelPtr->SetNACKStatus(enable, maxNoPackets); 4250d266054acece70259fc1e85026194154f41e5a0Jelena Marusic return 0; 4260d266054acece70259fc1e85026194154f41e5a0Jelena Marusic} 427b35d2e3abcc44b018aa42a571212e4aaac75b65bniklas.enbom@webrtc.org 428470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com#endif // #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API 429470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com 430470e71d3649f6cac4688e83819640b012b5d38bbniklase@google.com} // namespace webrtc 431