Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: webrtc/voice_engine/channel_proxy.cc

Issue 1459083007: Open backdoor in VoiceEngineImpl to get at the actual voe::Channel objects from an ID. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
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
16 namespace webrtc {
17 namespace voe {
18 ChannelProxy::ChannelProxy() : channel_owner_(nullptr) {
19 }
kwiberg-webrtc 2015/11/25 10:44:59 What's this constructor for?
the sun 2015/11/25 12:28:01 For the mock.
20
21 ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) :
22 channel_owner_(channel_owner) {
23 RTC_CHECK(channel_owner_.channel());
24 }
25
26 void ChannelProxy::SetRTCPStatus(bool enable) {
27 RTC_DCHECK(channel_owner_.channel());
28 channel_owner_.channel()->SetRTCPStatus(enable);
29 }
30
31 void ChannelProxy::SetLocalSSRC(uint32_t ssrc) {
32 RTC_DCHECK(channel_owner_.channel());
33 int error = channel_owner_.channel()->SetLocalSSRC(ssrc);
34 RTC_DCHECK_EQ(0, error);
35 }
36
37 void ChannelProxy::SetRTCP_CNAME(const std::string& c_name) {
38 // Note: VoERTP_RTCP::SetRTCP_CNAME() accepts a char[256] array.
39 std::string c_name_limited = c_name.substr(0, 255);
kwiberg-webrtc 2015/11/25 10:44:59 Would it make sense to CHECK the size instead, or
the sun 2015/11/25 12:28:01 AFAIU this string comes directly from the SDP, so
40 RTC_DCHECK(channel_owner_.channel());
41 int error = channel_owner_.channel()->SetRTCP_CNAME(c_name_limited.c_str());
42 RTC_DCHECK_EQ(0, error);
43 }
44 } // namespace voe
45 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698