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

Unified 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, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/voice_engine/channel_proxy.cc
diff --git a/webrtc/voice_engine/channel_proxy.cc b/webrtc/voice_engine/channel_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5a25f18855562bf0a3b68cc8d8586fab523731f6
--- /dev/null
+++ b/webrtc/voice_engine/channel_proxy.cc
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015 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 "webrtc/voice_engine/channel_proxy.h"
+
+#include "webrtc/base/checks.h"
+#include "webrtc/voice_engine/channel.h"
+
+namespace webrtc {
+namespace voe {
+ChannelProxy::ChannelProxy() : channel_owner_(nullptr) {
+}
kwiberg-webrtc 2015/11/25 10:44:59 What's this constructor for?
the sun 2015/11/25 12:28:01 For the mock.
+
+ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) :
+ channel_owner_(channel_owner) {
+ RTC_CHECK(channel_owner_.channel());
+}
+
+void ChannelProxy::SetRTCPStatus(bool enable) {
+ RTC_DCHECK(channel_owner_.channel());
+ channel_owner_.channel()->SetRTCPStatus(enable);
+}
+
+void ChannelProxy::SetLocalSSRC(uint32_t ssrc) {
+ RTC_DCHECK(channel_owner_.channel());
+ int error = channel_owner_.channel()->SetLocalSSRC(ssrc);
+ RTC_DCHECK_EQ(0, error);
+}
+
+void ChannelProxy::SetRTCP_CNAME(const std::string& c_name) {
+ // Note: VoERTP_RTCP::SetRTCP_CNAME() accepts a char[256] array.
+ 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
+ RTC_DCHECK(channel_owner_.channel());
+ int error = channel_owner_.channel()->SetRTCP_CNAME(c_name_limited.c_str());
+ RTC_DCHECK_EQ(0, error);
+}
+} // namespace voe
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698