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

Side by Side 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698