OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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 "content/renderer/media/webrtc/rtc_rtp_contributing_source.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/time/time.h" |
| 9 #include "third_party/webrtc/base/scoped_ref_ptr.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 RTCRtpContributingSource::RTCRtpContributingSource( |
| 14 const webrtc::RtpSource& source) |
| 15 : source_(source) {} |
| 16 |
| 17 RTCRtpContributingSource::~RTCRtpContributingSource() {} |
| 18 |
| 19 blink::WebRTCRtpContributingSourceType RTCRtpContributingSource::SourceType() |
| 20 const { |
| 21 switch (source_.source_type()) { |
| 22 case webrtc::RtpSourceType::SSRC: |
| 23 return blink::WebRTCRtpContributingSourceType::SSRC; |
| 24 case webrtc::RtpSourceType::CSRC: |
| 25 return blink::WebRTCRtpContributingSourceType::CSRC; |
| 26 default: |
| 27 NOTREACHED(); |
| 28 return blink::WebRTCRtpContributingSourceType::SSRC; |
| 29 } |
| 30 } |
| 31 |
| 32 double RTCRtpContributingSource::TimestampMs() const { |
| 33 return source_.timestamp_ms(); |
| 34 } |
| 35 |
| 36 uint32_t RTCRtpContributingSource::Source() const { |
| 37 return source_.source_id(); |
| 38 } |
| 39 |
| 40 } // namespace content |
OLD | NEW |