OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/api/test/fakertpsenderreceiver.h" | |
12 | |
13 #include "webrtc/base/optional.h" | |
14 #include "webrtc/base/checks.h" | |
15 | |
16 namespace webrtc { | |
17 | |
18 FakeRtpSender::FakeRtpSender( | |
19 cricket::MediaType media_type, RtpParameters parameters) | |
20 : 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.
| |
21 } | |
22 | |
23 bool FakeRtpSender::SetTrack(MediaStreamTrackInterface* track) { | |
24 track_ = track; | |
25 return true; | |
26 } | |
27 | |
28 rtc::scoped_refptr<MediaStreamTrackInterface> FakeRtpSender::track() const { | |
29 return track_; | |
30 } | |
31 | |
32 uint32_t FakeRtpSender::ssrc() const { | |
33 if (GetParameters().encodings.empty()) | |
34 return 0; | |
35 return *GetParameters().encodings[0].ssrc; | |
36 } | |
37 | |
38 cricket::MediaType FakeRtpSender::media_type() const { | |
39 return media_type_; | |
40 } | |
41 | |
42 std::string FakeRtpSender::id() const { | |
43 return "FakeRtpSender"; | |
44 } | |
45 | |
46 std::vector<std::string> FakeRtpSender::stream_ids() const { | |
47 RTC_NOTREACHED(); | |
48 return std::vector<std::string>(); | |
49 } | |
50 | |
51 RtpParameters FakeRtpSender::GetParameters() const { | |
52 return rtp_parameters_; | |
53 } | |
54 | |
55 bool FakeRtpSender::SetParameters(const RtpParameters& parameters) { | |
56 rtp_parameters_ = parameters; | |
57 return true; | |
58 } | |
59 | |
60 FakeRtpReceiver::FakeRtpReceiver( | |
61 cricket::MediaType media_type, RtpParameters parameters) | |
62 : media_type_(media_type), rtp_parameters_(parameters) { | |
63 } | |
64 | |
65 void FakeRtpReceiver::SetTrack(MediaStreamTrackInterface* track) { | |
66 track_ = track; | |
67 } | |
68 | |
69 rtc::scoped_refptr<MediaStreamTrackInterface> FakeRtpReceiver::track() const { | |
70 return track_; | |
71 } | |
72 | |
73 cricket::MediaType FakeRtpReceiver::media_type() const { | |
74 return media_type_; | |
75 } | |
76 | |
77 std::string FakeRtpReceiver::id() const { | |
78 return "FakeRtpReceiver"; | |
79 } | |
80 | |
81 RtpParameters FakeRtpReceiver::GetParameters() const { | |
82 return rtp_parameters_; | |
83 } | |
84 | |
85 bool FakeRtpReceiver::SetParameters(const RtpParameters& parameters) { | |
86 rtp_parameters_ = parameters; | |
87 return true; | |
88 } | |
89 | |
90 void FakeRtpReceiver::SetObserver(RtpReceiverObserverInterface* observer) { | |
91 RTC_NOTREACHED(); | |
92 } | |
93 | |
94 } // namespace webrtc | |
OLD | NEW |