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

Unified Diff: webrtc/call/rtc_event_log_proxy.cc

Issue 1748403002: Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Introduce proxy object for RtcEventLog and handle other comments. Created 4 years, 9 months 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/call/rtc_event_log_proxy.cc
diff --git a/webrtc/call/rtc_event_log_proxy.cc b/webrtc/call/rtc_event_log_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b49847cfa83789638d36f7c535cc5b2536efd88d
--- /dev/null
+++ b/webrtc/call/rtc_event_log_proxy.cc
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 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/call/rtc_event_log_proxy.h"
+
+namespace webrtc {
+
+void RtcEventLogProxy::SetEventLog(RtcEventLog* event_log) {
+ rtc::CritScope lock(&crit_);
+ event_log_ = event_log;
+}
+
+void RtcEventLogProxy::LogRtpHeader(PacketDirection direction,
+ MediaType media_type,
+ const uint8_t* header,
+ size_t packet_length) {
+ rtc::CritScope lock(&crit_);
+ if (event_log_) {
stefan-webrtc 2016/03/11 10:11:53 Can we DCHECK on this instead so that we know that
ivoc 2016/03/16 17:00:32 Good idea.
+ event_log_->LogRtpHeader(direction, media_type, header, packet_length);
+ }
+}
+
+void RtcEventLogProxy::LogRtcpPacket(PacketDirection direction,
+ MediaType media_type,
+ const uint8_t* packet,
+ size_t length) {
+ rtc::CritScope lock(&crit_);
+ if (event_log_) {
+ event_log_->LogRtcpPacket(direction, media_type, packet, length);
+ }
+}
+
+void RtcEventLogProxy::LogAudioPlayout(uint32_t ssrc) {
+ rtc::CritScope lock(&crit_);
+ if (event_log_) {
+ event_log_->LogAudioPlayout(ssrc);
+ }
+}
+
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698