Index: webrtc/api/test/fakertpsenderreceiver.cc |
diff --git a/webrtc/api/test/fakertpsenderreceiver.cc b/webrtc/api/test/fakertpsenderreceiver.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..335d0e75e091f0aafdf10c8142723277de1a57cb |
--- /dev/null |
+++ b/webrtc/api/test/fakertpsenderreceiver.cc |
@@ -0,0 +1,94 @@ |
+/* |
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#include "webrtc/api/test/fakertpsenderreceiver.h" |
+ |
+#include "webrtc/base/optional.h" |
+#include "webrtc/base/checks.h" |
+ |
+namespace webrtc { |
+ |
+FakeRtpSender::FakeRtpSender( |
+ cricket::MediaType media_type, RtpParameters parameters) |
+ : media_type_(media_type), rtp_parameters_(parameters) { |
hta-webrtc
2017/01/05 09:46:56
Despite my earlier comment about not having implem
hbos
2017/01/05 15:27:56
Done.
|
+} |
+ |
+bool FakeRtpSender::SetTrack(MediaStreamTrackInterface* track) { |
+ track_ = track; |
+ return true; |
+} |
+ |
+rtc::scoped_refptr<MediaStreamTrackInterface> FakeRtpSender::track() const { |
+ return track_; |
+} |
+ |
+uint32_t FakeRtpSender::ssrc() const { |
+ if (GetParameters().encodings.empty()) |
+ return 0; |
+ return *GetParameters().encodings[0].ssrc; |
+} |
+ |
+cricket::MediaType FakeRtpSender::media_type() const { |
+ return media_type_; |
+} |
+ |
+std::string FakeRtpSender::id() const { |
+ return "FakeRtpSender"; |
+} |
+ |
+std::vector<std::string> FakeRtpSender::stream_ids() const { |
+ RTC_NOTREACHED(); |
+ return std::vector<std::string>(); |
+} |
+ |
+RtpParameters FakeRtpSender::GetParameters() const { |
+ return rtp_parameters_; |
+} |
+ |
+bool FakeRtpSender::SetParameters(const RtpParameters& parameters) { |
+ rtp_parameters_ = parameters; |
+ return true; |
+} |
+ |
+FakeRtpReceiver::FakeRtpReceiver( |
+ cricket::MediaType media_type, RtpParameters parameters) |
+ : media_type_(media_type), rtp_parameters_(parameters) { |
+} |
+ |
+void FakeRtpReceiver::SetTrack(MediaStreamTrackInterface* track) { |
+ track_ = track; |
+} |
+ |
+rtc::scoped_refptr<MediaStreamTrackInterface> FakeRtpReceiver::track() const { |
+ return track_; |
+} |
+ |
+cricket::MediaType FakeRtpReceiver::media_type() const { |
+ return media_type_; |
+} |
+ |
+std::string FakeRtpReceiver::id() const { |
+ return "FakeRtpReceiver"; |
+} |
+ |
+RtpParameters FakeRtpReceiver::GetParameters() const { |
+ return rtp_parameters_; |
+} |
+ |
+bool FakeRtpReceiver::SetParameters(const RtpParameters& parameters) { |
+ rtp_parameters_ = parameters; |
+ return true; |
+} |
+ |
+void FakeRtpReceiver::SetObserver(RtpReceiverObserverInterface* observer) { |
+ RTC_NOTREACHED(); |
+} |
+ |
+} // namespace webrtc |