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 RTCRtpContributingSource& RTCRtpContributingSource::operator=( | |
22 const WebRTCRtpContributingSource& webContributingSource) { | |
23 m_timestampMs = webContributingSource.timestampMs(); | |
24 DCHECK_EQ(webContributingSource.source(), m_source); | |
25 return *this; | |
26 } | |
27 | |
28 double RTCRtpContributingSource::timestamp() { | |
29 m_receiver->updateSourcesIfNeeded(); | |
foolip
2017/04/06 10:07:23
This is a bit odd, and suggests that it's possible
hbos_chromium
2017/04/06 11:10:15
The spec says its an interface, not a dictionary,
Taylor_Brandstetter
2017/04/06 20:34:41
I interpreted the spec the same way. It may not be
foolip
2017/04/07 06:49:51
OK, so the spec says "Each time an RTP packet is r
hbos_chromium
2017/04/07 08:18:51
Good point, filed https://github.com/w3c/webrtc-pc
| |
30 return m_timestampMs; | |
31 } | |
32 | |
33 uint32_t RTCRtpContributingSource::source() const { | |
34 // Skip |m_receiver->updateSourcesIfNeeded()|, |m_source| is a constant. | |
35 return m_source; | |
36 } | |
37 | |
38 DEFINE_TRACE(RTCRtpContributingSource) { | |
39 visitor->trace(m_receiver); | |
40 } | |
41 | |
42 } // namespace blink | |
OLD | NEW |