| 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..9c57286dc9b58308ddb2e2bc9488f7c516b27e02
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
|
| @@ -0,0 +1,42 @@
|
| +// 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);
|
| +}
|
| +
|
| +RTCRtpContributingSource& RTCRtpContributingSource::operator=(
|
| + const WebRTCRtpContributingSource& webContributingSource) {
|
| + m_timestampMs = webContributingSource.timestampMs();
|
| + DCHECK_EQ(webContributingSource.source(), m_source);
|
| + return *this;
|
| +}
|
| +
|
| +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
|
|
|