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

Unified Diff: webrtc/api/test/fakertpsenderreceiver.cc

Issue 2611983002: TrackMediaInfoMap added. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698