Index: content/renderer/media/webrtc/rtc_rtp_contributing_source.cc |
diff --git a/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc b/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04eaba85279b559205da89ee04a7498ee8a0ee22 |
--- /dev/null |
+++ b/content/renderer/media/webrtc/rtc_rtp_contributing_source.cc |
@@ -0,0 +1,39 @@ |
+// Copyright (c) 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/renderer/media/webrtc/rtc_rtp_contributing_source.h" |
+ |
+#include "base/logging.h" |
+#include "third_party/webrtc/base/scoped_ref_ptr.h" |
+ |
+namespace content { |
+ |
+RTCRtpContributingSource::RTCRtpContributingSource( |
+ const webrtc::RtpSource& source) |
+ : source_(source) {} |
+ |
+RTCRtpContributingSource::~RTCRtpContributingSource() {} |
+ |
+blink::WebRTCRtpContributingSourceType RTCRtpContributingSource::sourceType() |
+ const { |
+ switch (source_.source_type()) { |
+ case webrtc::RtpSourceType::RTP_SSRC_SOURCE: |
+ return blink::WebRTCRtpContributingSourceType::SSRC; |
+ case webrtc::RtpSourceType::RTP_CSRC_SOURCE: |
+ return blink::WebRTCRtpContributingSourceType::CSRC; |
+ default: |
+ NOTREACHED(); |
+ return blink::WebRTCRtpContributingSourceType::SSRC; |
+ } |
+} |
+ |
+double RTCRtpContributingSource::timestamp() const { |
+ return source_.timestamp(); |
+} |
+ |
+uint32_t RTCRtpContributingSource::source() const { |
+ return source_.source_id(); |
+} |
+ |
+} // namespace content |