blob: 4e690fb62f071d6483feb0d90d4de9d52a62964a [file] [log] [blame]
solenberg13725082015-11-25 08:16:52 -08001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#include "webrtc/voice_engine/channel_proxy.h"
12
Tommif888bb52015-12-12 01:37:01 +010013#include <utility>
14
kjellandera69d9732016-08-31 07:33:05 -070015#include "webrtc/api/call/audio_sink.h"
solenberg13725082015-11-25 08:16:52 -080016#include "webrtc/base/checks.h"
17#include "webrtc/voice_engine/channel.h"
18
19namespace webrtc {
20namespace voe {
21ChannelProxy::ChannelProxy() : channel_owner_(nullptr) {}
22
23ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) :
24 channel_owner_(channel_owner) {
25 RTC_CHECK(channel_owner_.channel());
solenberg08b19df2017-02-15 00:42:31 -080026 module_process_thread_checker_.DetachFromThread();
solenberg13725082015-11-25 08:16:52 -080027}
28
Tommif888bb52015-12-12 01:37:01 +010029ChannelProxy::~ChannelProxy() {}
30
solenberg13725082015-11-25 08:16:52 -080031void ChannelProxy::SetRTCPStatus(bool enable) {
solenberg08b19df2017-02-15 00:42:31 -080032 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -080033 channel()->SetRTCPStatus(enable);
solenberg13725082015-11-25 08:16:52 -080034}
35
36void ChannelProxy::SetLocalSSRC(uint32_t ssrc) {
solenberg08b19df2017-02-15 00:42:31 -080037 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -080038 int error = channel()->SetLocalSSRC(ssrc);
solenberg13725082015-11-25 08:16:52 -080039 RTC_DCHECK_EQ(0, error);
40}
41
42void ChannelProxy::SetRTCP_CNAME(const std::string& c_name) {
solenberg08b19df2017-02-15 00:42:31 -080043 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg13725082015-11-25 08:16:52 -080044 // Note: VoERTP_RTCP::SetRTCP_CNAME() accepts a char[256] array.
45 std::string c_name_limited = c_name.substr(0, 255);
solenberg358057b2015-11-27 10:46:42 -080046 int error = channel()->SetRTCP_CNAME(c_name_limited.c_str());
solenberg13725082015-11-25 08:16:52 -080047 RTC_DCHECK_EQ(0, error);
48}
solenberg358057b2015-11-27 10:46:42 -080049
solenberg971cab02016-06-14 10:02:41 -070050void ChannelProxy::SetNACKStatus(bool enable, int max_packets) {
solenberg08b19df2017-02-15 00:42:31 -080051 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg971cab02016-06-14 10:02:41 -070052 channel()->SetNACKStatus(enable, max_packets);
53}
54
solenberg358057b2015-11-27 10:46:42 -080055void ChannelProxy::SetSendAudioLevelIndicationStatus(bool enable, int id) {
solenberg08b19df2017-02-15 00:42:31 -080056 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -080057 int error = channel()->SetSendAudioLevelIndicationStatus(enable, id);
58 RTC_DCHECK_EQ(0, error);
59}
60
solenberg358057b2015-11-27 10:46:42 -080061void ChannelProxy::SetReceiveAudioLevelIndicationStatus(bool enable, int id) {
solenberg08b19df2017-02-15 00:42:31 -080062 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -080063 int error = channel()->SetReceiveAudioLevelIndicationStatus(enable, id);
64 RTC_DCHECK_EQ(0, error);
65}
66
stefan3313ec92016-01-21 06:32:43 -080067void ChannelProxy::EnableSendTransportSequenceNumber(int id) {
solenberg08b19df2017-02-15 00:42:31 -080068 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
stefan3313ec92016-01-21 06:32:43 -080069 channel()->EnableSendTransportSequenceNumber(id);
70}
71
72void ChannelProxy::EnableReceiveTransportSequenceNumber(int id) {
solenberg08b19df2017-02-15 00:42:31 -080073 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
stefan3313ec92016-01-21 06:32:43 -080074 channel()->EnableReceiveTransportSequenceNumber(id);
75}
76
stefanbba9dec2016-02-01 04:39:55 -080077void ChannelProxy::RegisterSenderCongestionControlObjects(
Stefan Holmerb86d4e42015-12-07 10:26:18 +010078 RtpPacketSender* rtp_packet_sender,
79 TransportFeedbackObserver* transport_feedback_observer,
stefan7de8d642017-02-07 07:14:08 -080080 PacketRouter* packet_router,
81 RtcpBandwidthObserver* bandwidth_observer) {
solenberg08b19df2017-02-15 00:42:31 -080082 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
stefanbba9dec2016-02-01 04:39:55 -080083 channel()->RegisterSenderCongestionControlObjects(
stefan7de8d642017-02-07 07:14:08 -080084 rtp_packet_sender, transport_feedback_observer, packet_router,
85 bandwidth_observer);
Stefan Holmerb86d4e42015-12-07 10:26:18 +010086}
87
stefanbba9dec2016-02-01 04:39:55 -080088void ChannelProxy::RegisterReceiverCongestionControlObjects(
89 PacketRouter* packet_router) {
solenberg08b19df2017-02-15 00:42:31 -080090 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
stefanbba9dec2016-02-01 04:39:55 -080091 channel()->RegisterReceiverCongestionControlObjects(packet_router);
92}
93
94void ChannelProxy::ResetCongestionControlObjects() {
solenberg08b19df2017-02-15 00:42:31 -080095 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
stefanbba9dec2016-02-01 04:39:55 -080096 channel()->ResetCongestionControlObjects();
97}
98
solenberg358057b2015-11-27 10:46:42 -080099CallStatistics ChannelProxy::GetRTCPStatistics() const {
solenberg08b19df2017-02-15 00:42:31 -0800100 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -0800101 CallStatistics stats = {0};
102 int error = channel()->GetRTPStatistics(stats);
103 RTC_DCHECK_EQ(0, error);
104 return stats;
105}
106
107std::vector<ReportBlock> ChannelProxy::GetRemoteRTCPReportBlocks() const {
solenberg08b19df2017-02-15 00:42:31 -0800108 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -0800109 std::vector<webrtc::ReportBlock> blocks;
110 int error = channel()->GetRemoteRTCPReportBlocks(&blocks);
111 RTC_DCHECK_EQ(0, error);
112 return blocks;
113}
114
115NetworkStatistics ChannelProxy::GetNetworkStatistics() const {
solenberg08b19df2017-02-15 00:42:31 -0800116 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -0800117 NetworkStatistics stats = {0};
118 int error = channel()->GetNetworkStatistics(stats);
119 RTC_DCHECK_EQ(0, error);
120 return stats;
121}
122
123AudioDecodingCallStats ChannelProxy::GetDecodingCallStatistics() const {
solenberg08b19df2017-02-15 00:42:31 -0800124 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -0800125 AudioDecodingCallStats stats;
126 channel()->GetDecodingCallStatistics(&stats);
127 return stats;
128}
129
130int32_t ChannelProxy::GetSpeechOutputLevelFullRange() const {
solenberg08b19df2017-02-15 00:42:31 -0800131 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -0800132 uint32_t level = 0;
133 int error = channel()->GetSpeechOutputLevelFullRange(level);
134 RTC_DCHECK_EQ(0, error);
135 return static_cast<int32_t>(level);
136}
137
138uint32_t ChannelProxy::GetDelayEstimate() const {
solenberg08b19df2017-02-15 00:42:31 -0800139 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread() ||
140 module_process_thread_checker_.CalledOnValidThread());
solenberg358057b2015-11-27 10:46:42 -0800141 return channel()->GetDelayEstimate();
142}
143
solenbergffbbcac2016-11-17 05:25:37 -0800144bool ChannelProxy::SetSendTelephoneEventPayloadType(int payload_type,
145 int payload_frequency) {
solenberg08b19df2017-02-15 00:42:31 -0800146 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergffbbcac2016-11-17 05:25:37 -0800147 return channel()->SetSendTelephoneEventPayloadType(payload_type,
148 payload_frequency) == 0;
Fredrik Solenbergb5727682015-12-04 15:22:19 +0100149}
150
solenberg8842c3e2016-03-11 03:06:41 -0800151bool ChannelProxy::SendTelephoneEventOutband(int event, int duration_ms) {
solenberg08b19df2017-02-15 00:42:31 -0800152 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg8842c3e2016-03-11 03:06:41 -0800153 return channel()->SendTelephoneEventOutband(event, duration_ms) == 0;
Fredrik Solenbergb5727682015-12-04 15:22:19 +0100154}
155
minyue78b4d562016-11-30 04:47:39 -0800156void ChannelProxy::SetBitrate(int bitrate_bps, int64_t probing_interval_ms) {
solenberg08b19df2017-02-15 00:42:31 -0800157 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread() ||
158 module_process_thread_checker_.CalledOnValidThread());
minyue78b4d562016-11-30 04:47:39 -0800159 channel()->SetBitRate(bitrate_bps, probing_interval_ms);
mflodman86cc6ff2016-07-26 04:44:06 -0700160}
161
kwibergd32bf752017-01-19 07:03:59 -0800162void ChannelProxy::SetRecPayloadType(int payload_type,
163 const SdpAudioFormat& format) {
solenberg08b19df2017-02-15 00:42:31 -0800164 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
kwibergd32bf752017-01-19 07:03:59 -0800165 const int result = channel()->SetRecPayloadType(payload_type, format);
166 RTC_DCHECK_EQ(0, result);
167}
168
kwibergb7f89d62016-02-17 10:04:18 -0800169void ChannelProxy::SetSink(std::unique_ptr<AudioSinkInterface> sink) {
solenberg08b19df2017-02-15 00:42:31 -0800170 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
deadbeef2d110be2016-01-13 12:00:26 -0800171 channel()->SetSink(std::move(sink));
Tommif888bb52015-12-12 01:37:01 +0100172}
173
solenberg94218532016-06-16 10:53:22 -0700174void ChannelProxy::SetInputMute(bool muted) {
solenberg08b19df2017-02-15 00:42:31 -0800175 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg94218532016-06-16 10:53:22 -0700176 int error = channel()->SetInputMute(muted);
177 RTC_DCHECK_EQ(0, error);
178}
179
mflodman3d7db262016-04-29 00:57:13 -0700180void ChannelProxy::RegisterExternalTransport(Transport* transport) {
solenberg08b19df2017-02-15 00:42:31 -0800181 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
mflodman3d7db262016-04-29 00:57:13 -0700182 int error = channel()->RegisterExternalTransport(transport);
183 RTC_DCHECK_EQ(0, error);
184}
185
186void ChannelProxy::DeRegisterExternalTransport() {
solenberg08b19df2017-02-15 00:42:31 -0800187 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
mflodman3d7db262016-04-29 00:57:13 -0700188 channel()->DeRegisterExternalTransport();
189}
190
191bool ChannelProxy::ReceivedRTPPacket(const uint8_t* packet,
192 size_t length,
193 const PacketTime& packet_time) {
194 // May be called on either worker thread or network thread.
195 return channel()->ReceivedRTPPacket(packet, length, packet_time) == 0;
196}
197
198bool ChannelProxy::ReceivedRTCPPacket(const uint8_t* packet, size_t length) {
199 // May be called on either worker thread or network thread.
200 return channel()->ReceivedRTCPPacket(packet, length) == 0;
201}
202
ossu29b1a8d2016-06-13 07:34:51 -0700203const rtc::scoped_refptr<AudioDecoderFactory>&
solenberg217fb662016-06-17 08:30:54 -0700204 ChannelProxy::GetAudioDecoderFactory() const {
solenberg08b19df2017-02-15 00:42:31 -0800205 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
ossu29b1a8d2016-06-13 07:34:51 -0700206 return channel()->GetAudioDecoderFactory();
207}
208
solenberg217fb662016-06-17 08:30:54 -0700209void ChannelProxy::SetChannelOutputVolumeScaling(float scaling) {
solenberg08b19df2017-02-15 00:42:31 -0800210 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg217fb662016-06-17 08:30:54 -0700211 int error = channel()->SetChannelOutputVolumeScaling(scaling);
212 RTC_DCHECK_EQ(0, error);
213}
214
ivoc14d5dbe2016-07-04 07:06:55 -0700215void ChannelProxy::SetRtcEventLog(RtcEventLog* event_log) {
solenberg08b19df2017-02-15 00:42:31 -0800216 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
ivoc14d5dbe2016-07-04 07:06:55 -0700217 channel()->SetRtcEventLog(event_log);
218}
219
minyue6b825df2016-10-31 04:08:32 -0700220void ChannelProxy::EnableAudioNetworkAdaptor(const std::string& config_string) {
solenberg08b19df2017-02-15 00:42:31 -0800221 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
minyue6b825df2016-10-31 04:08:32 -0700222 bool ret = channel()->EnableAudioNetworkAdaptor(config_string);
223 RTC_DCHECK(ret);
224;}
225
226void ChannelProxy::DisableAudioNetworkAdaptor() {
solenberg08b19df2017-02-15 00:42:31 -0800227 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
minyue6b825df2016-10-31 04:08:32 -0700228 channel()->DisableAudioNetworkAdaptor();
229}
230
231void ChannelProxy::SetReceiverFrameLengthRange(int min_frame_length_ms,
232 int max_frame_length_ms) {
solenberg08b19df2017-02-15 00:42:31 -0800233 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
minyue6b825df2016-10-31 04:08:32 -0700234 channel()->SetReceiverFrameLengthRange(min_frame_length_ms,
235 max_frame_length_ms);
236}
237
aleloi6c278492016-10-20 14:24:39 -0700238AudioMixer::Source::AudioFrameInfo ChannelProxy::GetAudioFrameWithInfo(
239 int sample_rate_hz,
240 AudioFrame* audio_frame) {
solenberg08b19df2017-02-15 00:42:31 -0800241 RTC_DCHECK_RUNS_SERIALIZED(&audio_thread_race_checker_);
aleloi6c278492016-10-20 14:24:39 -0700242 return channel()->GetAudioFrameWithInfo(sample_rate_hz, audio_frame);
aleloiaed581a2016-10-20 06:32:39 -0700243}
244
aleloi051f6782016-10-31 03:26:40 -0700245int ChannelProxy::NeededFrequency() const {
solenberg08b19df2017-02-15 00:42:31 -0800246 RTC_DCHECK_RUNS_SERIALIZED(&audio_thread_race_checker_);
aleloi051f6782016-10-31 03:26:40 -0700247 return static_cast<int>(channel()->NeededFrequency(-1));
248}
249
michaelt79e05882016-11-08 02:50:09 -0800250void ChannelProxy::SetTransportOverhead(int transport_overhead_per_packet) {
solenberg08b19df2017-02-15 00:42:31 -0800251 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
michaelt79e05882016-11-08 02:50:09 -0800252 channel()->SetTransportOverhead(transport_overhead_per_packet);
253}
254
solenberg7602aab2016-11-14 11:30:07 -0800255void ChannelProxy::AssociateSendChannel(
256 const ChannelProxy& send_channel_proxy) {
solenberg08b19df2017-02-15 00:42:31 -0800257 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg7602aab2016-11-14 11:30:07 -0800258 channel()->set_associate_send_channel(send_channel_proxy.channel_owner_);
259}
260
261void ChannelProxy::DisassociateSendChannel() {
solenberg08b19df2017-02-15 00:42:31 -0800262 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenberg7602aab2016-11-14 11:30:07 -0800263 channel()->set_associate_send_channel(ChannelOwner(nullptr));
264}
265
solenberg3ebbcb52017-01-31 03:58:40 -0800266void ChannelProxy::GetRtpRtcp(RtpRtcp** rtp_rtcp,
267 RtpReceiver** rtp_receiver) const {
solenberg08b19df2017-02-15 00:42:31 -0800268 RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread());
solenberg3ebbcb52017-01-31 03:58:40 -0800269 RTC_DCHECK(rtp_rtcp);
270 RTC_DCHECK(rtp_receiver);
271 int error = channel()->GetRtpRtcp(rtp_rtcp, rtp_receiver);
272 RTC_DCHECK_EQ(0, error);
273}
274
solenberg3ebbcb52017-01-31 03:58:40 -0800275uint32_t ChannelProxy::GetPlayoutTimestamp() const {
solenberg08b19df2017-02-15 00:42:31 -0800276 RTC_DCHECK_RUNS_SERIALIZED(&video_capture_thread_race_checker_);
solenberg3ebbcb52017-01-31 03:58:40 -0800277 unsigned int timestamp = 0;
278 int error = channel()->GetPlayoutTimestamp(timestamp);
279 RTC_DCHECK(!error || timestamp == 0);
280 return timestamp;
281}
282
283void ChannelProxy::SetMinimumPlayoutDelay(int delay_ms) {
solenberg08b19df2017-02-15 00:42:31 -0800284 RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread());
solenberg3ebbcb52017-01-31 03:58:40 -0800285 // Limit to range accepted by both VoE and ACM, so we're at least getting as
286 // close as possible, instead of failing.
287 delay_ms = std::max(0, std::min(delay_ms, 10000));
288 int error = channel()->SetMinimumPlayoutDelay(delay_ms);
289 RTC_DCHECK_EQ(0, error);
290}
291
michaelt9332b7d2016-11-30 07:51:13 -0800292void ChannelProxy::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) {
solenberg08b19df2017-02-15 00:42:31 -0800293 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
michaelt9332b7d2016-11-30 07:51:13 -0800294 channel()->SetRtcpRttStats(rtcp_rtt_stats);
295}
296
solenbergbd9a77f2017-02-06 12:53:57 -0800297bool ChannelProxy::GetRecCodec(CodecInst* codec_inst) const {
solenberg08b19df2017-02-15 00:42:31 -0800298 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800299 return channel()->GetRecCodec(*codec_inst) == 0;
300}
301
302bool ChannelProxy::GetSendCodec(CodecInst* codec_inst) const {
solenberg08b19df2017-02-15 00:42:31 -0800303 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800304 return channel()->GetSendCodec(*codec_inst) == 0;
305}
306
307bool ChannelProxy::SetVADStatus(bool enable) {
solenberg08b19df2017-02-15 00:42:31 -0800308 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800309 return channel()->SetVADStatus(enable, VADNormal, false) == 0;
310}
311
312bool ChannelProxy::SetCodecFECStatus(bool enable) {
solenberg08b19df2017-02-15 00:42:31 -0800313 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800314 return channel()->SetCodecFECStatus(enable) == 0;
315}
316
317bool ChannelProxy::SetOpusDtx(bool enable) {
solenberg08b19df2017-02-15 00:42:31 -0800318 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800319 return channel()->SetOpusDtx(enable) == 0;
320}
321
322bool ChannelProxy::SetOpusMaxPlaybackRate(int frequency_hz) {
solenberg08b19df2017-02-15 00:42:31 -0800323 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800324 return channel()->SetOpusMaxPlaybackRate(frequency_hz) == 0;
325}
326
327bool ChannelProxy::SetSendCodec(const CodecInst& codec_inst) {
solenberg08b19df2017-02-15 00:42:31 -0800328 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800329 // Validation code copied from VoECodecImpl::SetSendCodec().
330 if ((STR_CASE_CMP(codec_inst.plname, "L16") == 0) &&
331 (codec_inst.pacsize >= 960)) {
332 return false;
333 }
334 if (!STR_CASE_CMP(codec_inst.plname, "CN") ||
335 !STR_CASE_CMP(codec_inst.plname, "TELEPHONE-EVENT") ||
336 !STR_CASE_CMP(codec_inst.plname, "RED")) {
337 return false;
338 }
339 if ((codec_inst.channels != 1) && (codec_inst.channels != 2)) {
340 return false;
341 }
342 if (!AudioCodingModule::IsCodecValid(codec_inst)) {
343 return false;
344 }
345 return channel()->SetSendCodec(codec_inst) == 0;
346}
347
348bool ChannelProxy::SetSendCNPayloadType(int type,
349 PayloadFrequencies frequency) {
solenberg08b19df2017-02-15 00:42:31 -0800350 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
solenbergbd9a77f2017-02-06 12:53:57 -0800351 // Validation code copied from VoECodecImpl::SetSendCNPayloadType().
352 if (type < 96 || type > 127) {
353 // Only allow dynamic range: 96 to 127
354 return false;
355 }
356 if ((frequency != kFreq16000Hz) && (frequency != kFreq32000Hz)) {
357 // It is not possible to modify the payload type for CN/8000.
358 // We only allow modification of the CN payload type for CN/16000
359 // and CN/32000.
360 return false;
361 }
362 return channel()->SetSendCNPayloadType(type, frequency) == 0;
363}
364
solenberg358057b2015-11-27 10:46:42 -0800365Channel* ChannelProxy::channel() const {
366 RTC_DCHECK(channel_owner_.channel());
367 return channel_owner_.channel();
368}
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100369
solenberg13725082015-11-25 08:16:52 -0800370} // namespace voe
371} // namespace webrtc