OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 14 matching lines...) Expand all Loading... | |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #ifndef TALK_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_ | 28 #ifndef TALK_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_ |
29 #define TALK_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_ | 29 #define TALK_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_ |
30 | 30 |
31 #include <vector> | 31 #include <vector> |
32 | 32 |
33 #include "webrtc/call.h" | 33 #include "webrtc/call.h" |
34 #include "webrtc/audio_receive_stream.h" | 34 #include "webrtc/audio_receive_stream.h" |
35 #include "webrtc/audio_send_stream.h" | |
35 #include "webrtc/video_frame.h" | 36 #include "webrtc/video_frame.h" |
36 #include "webrtc/video_receive_stream.h" | 37 #include "webrtc/video_receive_stream.h" |
37 #include "webrtc/video_send_stream.h" | 38 #include "webrtc/video_send_stream.h" |
38 | 39 |
39 namespace cricket { | 40 namespace cricket { |
41 class FakeAudioSendStream : public webrtc::AudioSendStream { | |
kwiberg-webrtc
2015/10/21 14:04:40
Maybe it's just me not being familiar enough with
the sun
2015/10/21 14:42:24
Added comment at start of file.
| |
42 public: | |
43 explicit FakeAudioSendStream( | |
44 const webrtc::AudioSendStream::Config& config); | |
45 | |
46 // webrtc::AudioSendStream implementation. | |
47 webrtc::AudioSendStream::Stats GetStats() const override; | |
48 | |
49 const webrtc::AudioSendStream::Config& GetConfig() const; | |
50 | |
51 private: | |
52 // webrtc::SendStream implementation. | |
53 void Start() override {} | |
54 void Stop() override {} | |
55 void SignalNetworkState(webrtc::NetworkState state) override {} | |
56 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | |
57 return true; | |
58 } | |
59 | |
60 webrtc::AudioSendStream::Config config_; | |
61 }; | |
62 | |
40 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { | 63 class FakeAudioReceiveStream : public webrtc::AudioReceiveStream { |
41 public: | 64 public: |
42 explicit FakeAudioReceiveStream( | 65 explicit FakeAudioReceiveStream( |
43 const webrtc::AudioReceiveStream::Config& config); | 66 const webrtc::AudioReceiveStream::Config& config); |
44 | 67 |
45 // webrtc::AudioReceiveStream implementation. | 68 // webrtc::AudioReceiveStream implementation. |
46 webrtc::AudioReceiveStream::Stats GetStats() const override; | 69 webrtc::AudioReceiveStream::Stats GetStats() const override; |
47 | 70 |
48 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 71 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
49 | 72 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 | 177 |
155 class FakeCall : public webrtc::Call, public webrtc::PacketReceiver { | 178 class FakeCall : public webrtc::Call, public webrtc::PacketReceiver { |
156 public: | 179 public: |
157 explicit FakeCall(const webrtc::Call::Config& config); | 180 explicit FakeCall(const webrtc::Call::Config& config); |
158 ~FakeCall() override; | 181 ~FakeCall() override; |
159 | 182 |
160 webrtc::Call::Config GetConfig() const; | 183 webrtc::Call::Config GetConfig() const; |
161 const std::vector<FakeVideoSendStream*>& GetVideoSendStreams(); | 184 const std::vector<FakeVideoSendStream*>& GetVideoSendStreams(); |
162 const std::vector<FakeVideoReceiveStream*>& GetVideoReceiveStreams(); | 185 const std::vector<FakeVideoReceiveStream*>& GetVideoReceiveStreams(); |
163 | 186 |
187 const std::vector<FakeAudioSendStream*>& GetAudioSendStreams(); | |
188 const FakeAudioSendStream* GetAudioSendStream(uint32_t ssrc); | |
164 const std::vector<FakeAudioReceiveStream*>& GetAudioReceiveStreams(); | 189 const std::vector<FakeAudioReceiveStream*>& GetAudioReceiveStreams(); |
165 const FakeAudioReceiveStream* GetAudioReceiveStream(uint32_t ssrc); | 190 const FakeAudioReceiveStream* GetAudioReceiveStream(uint32_t ssrc); |
166 | 191 |
167 rtc::SentPacket last_sent_packet() const { return last_sent_packet_; } | 192 rtc::SentPacket last_sent_packet() const { return last_sent_packet_; } |
168 webrtc::NetworkState GetNetworkState() const; | 193 webrtc::NetworkState GetNetworkState() const; |
169 int GetNumCreatedSendStreams() const; | 194 int GetNumCreatedSendStreams() const; |
170 int GetNumCreatedReceiveStreams() const; | 195 int GetNumCreatedReceiveStreams() const; |
171 void SetStats(const webrtc::Call::Stats& stats); | 196 void SetStats(const webrtc::Call::Stats& stats); |
172 | 197 |
173 private: | 198 private: |
(...skipping 27 matching lines...) Expand all Loading... | |
201 void SetBitrateConfig( | 226 void SetBitrateConfig( |
202 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; | 227 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; |
203 void SignalNetworkState(webrtc::NetworkState state) override; | 228 void SignalNetworkState(webrtc::NetworkState state) override; |
204 void OnSentPacket(const rtc::SentPacket& sent_packet) override; | 229 void OnSentPacket(const rtc::SentPacket& sent_packet) override; |
205 | 230 |
206 webrtc::Call::Config config_; | 231 webrtc::Call::Config config_; |
207 webrtc::NetworkState network_state_; | 232 webrtc::NetworkState network_state_; |
208 rtc::SentPacket last_sent_packet_; | 233 rtc::SentPacket last_sent_packet_; |
209 webrtc::Call::Stats stats_; | 234 webrtc::Call::Stats stats_; |
210 std::vector<FakeVideoSendStream*> video_send_streams_; | 235 std::vector<FakeVideoSendStream*> video_send_streams_; |
236 std::vector<FakeAudioSendStream*> audio_send_streams_; | |
211 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 237 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
212 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 238 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
213 | 239 |
214 int num_created_send_streams_; | 240 int num_created_send_streams_; |
215 int num_created_receive_streams_; | 241 int num_created_receive_streams_; |
216 }; | 242 }; |
217 | 243 |
218 } // namespace cricket | 244 } // namespace cricket |
219 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 245 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
OLD | NEW |