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_timestampMs(webContributingSource.timestampMs()), |
| 17 m_source(webContributingSource.source()) { |
| 18 DCHECK(m_receiver); |
| 19 } |
| 20 |
| 21 void RTCRtpContributingSource::updateMembers( |
| 22 const WebRTCRtpContributingSource& webContributingSource) { |
| 23 m_timestampMs = webContributingSource.timestampMs(); |
| 24 DCHECK_EQ(webContributingSource.source(), m_source); |
| 25 } |
| 26 |
| 27 double RTCRtpContributingSource::timestamp() { |
| 28 m_receiver->updateSourcesIfNeeded(); |
| 29 return m_timestampMs; |
| 30 } |
| 31 |
| 32 uint32_t RTCRtpContributingSource::source() const { |
| 33 // Skip |m_receiver->updateSourcesIfNeeded()|, |m_source| is a constant. |
| 34 return m_source; |
| 35 } |
| 36 |
| 37 DEFINE_TRACE(RTCRtpContributingSource) { |
| 38 visitor->trace(m_receiver); |
| 39 } |
| 40 |
| 41 } // namespace blink |
OLD | NEW |