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

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp

Issue 2803693002: RTCRtpReceiver.getContributingSources() added. (Closed)
Patch Set: 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_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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698