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

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

Issue 2808113002: Reland of TCRtpReceiver.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 : receiver_(receiver),
16 timestamp_ms_(webContributingSource.TimestampMs()),
17 source_(webContributingSource.Source()) {
18 DCHECK(receiver_);
19 }
20
21 void RTCRtpContributingSource::UpdateMembers(
22 const WebRTCRtpContributingSource& webContributingSource) {
23 timestamp_ms_ = webContributingSource.TimestampMs();
24 DCHECK_EQ(webContributingSource.Source(), source_);
25 }
26
27 double RTCRtpContributingSource::timestamp() {
28 receiver_->UpdateSourcesIfNeeded();
29 return timestamp_ms_;
30 }
31
32 uint32_t RTCRtpContributingSource::source() const {
33 // Skip |receiver_->UpdateSourcesIfNeeded()|, |source_| is a constant.
34 return source_;
35 }
36
37 DEFINE_TRACE(RTCRtpContributingSource) {
38 visitor->Trace(receiver_);
39 }
40
41 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698