OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "modules/peerconnection/RTCRtpContributingSource.h" |
| 6 |
| 7 #include "modules/peerconnection/RTCRtpReceiver.h" |
| 8 #include "public/platform/WebRTCRtpContributingSource.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 RTCRtpContributingSource::RTCRtpContributingSource( |
| 13 RTCRtpReceiver* receiver, |
| 14 const WebRTCRtpContributingSource& webContributingSource) |
| 15 : m_receiver(receiver), |
| 16 m_timestamp(webContributingSource.timestamp()), |
| 17 m_source(webContributingSource.source()) { |
| 18 DCHECK(m_receiver); |
| 19 } |
| 20 |
| 21 RTCRtpContributingSource& RTCRtpContributingSource::operator=( |
| 22 const WebRTCRtpContributingSource& webContributingSource) { |
| 23 m_timestamp = webContributingSource.timestamp(); |
| 24 DCHECK_EQ(webContributingSource.source(), m_source); |
| 25 return *this; |
| 26 } |
| 27 |
| 28 double RTCRtpContributingSource::timestamp() { |
| 29 m_receiver->updateSources(); |
| 30 return m_timestamp; |
| 31 } |
| 32 |
| 33 uint32_t RTCRtpContributingSource::source() const { |
| 34 // Skip |m_receiver->updateContributingSources()|, |m_source| is constant. |
| 35 return m_source; |
| 36 } |
| 37 |
| 38 DEFINE_TRACE(RTCRtpContributingSource) { |
| 39 visitor->trace(m_receiver); |
| 40 } |
| 41 |
| 42 } // namespace blink |
OLD | NEW |