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

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp

Issue 2803693002: RTCRtpReceiver.getContributingSources() added. (Closed)
Patch Set: Addressed guidou's comments Created 3 years, 8 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: third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..526933135b5a78512ed856fc2bb60300c65c19fe
--- /dev/null
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/peerconnection/RTCRtpContributingSource.h"
+
+#include "modules/peerconnection/RTCRtpReceiver.h"
+#include "public/platform/WebRTCRtpContributingSource.h"
+
+namespace blink {
+
+RTCRtpContributingSource::RTCRtpContributingSource(
+ RTCRtpReceiver* receiver,
+ const WebRTCRtpContributingSource& webContributingSource)
+ : m_receiver(receiver),
+ m_timestampMs(webContributingSource.timestampMs()),
+ m_source(webContributingSource.source()) {
+ DCHECK(m_receiver);
+}
+
+void RTCRtpContributingSource::updateMembers(
+ const WebRTCRtpContributingSource& webContributingSource) {
+ m_timestampMs = webContributingSource.timestampMs();
+ DCHECK_EQ(webContributingSource.source(), m_source);
+}
+
+double RTCRtpContributingSource::timestamp() {
+ m_receiver->updateSourcesIfNeeded();
+ return m_timestampMs;
+}
+
+uint32_t RTCRtpContributingSource::source() const {
+ // Skip |m_receiver->updateSourcesIfNeeded()|, |m_source| is a constant.
+ return m_source;
+}
+
+DEFINE_TRACE(RTCRtpContributingSource) {
+ visitor->trace(m_receiver);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698