blob: f53db8748cbf53b3ff105c9460f519c2c428b77f [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
13#include "webrtc/base/checks.h"
14#include "webrtc/voice_engine/channel.h"
15
16namespace webrtc {
17namespace voe {
18ChannelProxy::ChannelProxy() : channel_owner_(nullptr) {}
19
20ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) :
21 channel_owner_(channel_owner) {
22 RTC_CHECK(channel_owner_.channel());
23}
24
25void ChannelProxy::SetRTCPStatus(bool enable) {
26 RTC_DCHECK(channel_owner_.channel());
27 channel_owner_.channel()->SetRTCPStatus(enable);
28}
29
30void ChannelProxy::SetLocalSSRC(uint32_t ssrc) {
31 RTC_DCHECK(channel_owner_.channel());
32 int error = channel_owner_.channel()->SetLocalSSRC(ssrc);
33 RTC_DCHECK_EQ(0, error);
34}
35
36void ChannelProxy::SetRTCP_CNAME(const std::string& c_name) {
37 // Note: VoERTP_RTCP::SetRTCP_CNAME() accepts a char[256] array.
38 std::string c_name_limited = c_name.substr(0, 255);
39 RTC_DCHECK(channel_owner_.channel());
40 int error = channel_owner_.channel()->SetRTCP_CNAME(c_name_limited.c_str());
41 RTC_DCHECK_EQ(0, error);
42}
43} // namespace voe
44} // namespace webrtc