OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef WEBRTC_TEST_CALL_TEST_H_ | 10 #ifndef WEBRTC_TEST_CALL_TEST_H_ |
11 #define WEBRTC_TEST_CALL_TEST_H_ | 11 #define WEBRTC_TEST_CALL_TEST_H_ |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/call.h" | 16 #include "webrtc/call.h" |
17 #include "webrtc/test/encoder_settings.h" | |
18 #include "webrtc/test/fake_audio_device.h" | 17 #include "webrtc/test/fake_audio_device.h" |
19 #include "webrtc/test/fake_decoder.h" | 18 #include "webrtc/test/fake_decoder.h" |
20 #include "webrtc/test/fake_encoder.h" | 19 #include "webrtc/test/fake_encoder.h" |
21 #include "webrtc/test/frame_generator_capturer.h" | 20 #include "webrtc/test/frame_generator_capturer.h" |
22 #include "webrtc/test/rtp_rtcp_observer.h" | 21 #include "webrtc/test/rtp_rtcp_observer.h" |
23 | 22 |
24 namespace webrtc { | 23 namespace webrtc { |
25 | 24 |
26 class VoEBase; | 25 class VoEBase; |
27 class VoECodec; | 26 class VoECodec; |
28 | 27 |
29 namespace test { | 28 namespace test { |
30 | 29 |
31 class BaseTest; | 30 class BaseTest; |
32 | 31 |
33 class CallTest : public ::testing::Test { | 32 class CallTest : public ::testing::Test { |
34 public: | 33 public: |
35 CallTest(); | 34 CallTest(); |
36 virtual ~CallTest(); | 35 virtual ~CallTest(); |
37 | 36 |
38 static const size_t kNumSsrcs = 3; | 37 static const size_t kNumSsrcs = 3; |
39 static const int kDefaultWidth = 320; | 38 |
40 static const int kDefaultHeight = 180; | |
41 static const int kDefaultFramerate = 30; | |
42 static const int kDefaultTimeoutMs; | 39 static const int kDefaultTimeoutMs; |
43 static const int kLongTimeoutMs; | 40 static const int kLongTimeoutMs; |
44 static const uint8_t kVideoSendPayloadType; | 41 static const uint8_t kVideoSendPayloadType; |
45 static const uint8_t kSendRtxPayloadType; | 42 static const uint8_t kSendRtxPayloadType; |
46 static const uint8_t kFakeVideoSendPayloadType; | 43 static const uint8_t kFakeVideoSendPayloadType; |
47 static const uint8_t kRedPayloadType; | 44 static const uint8_t kRedPayloadType; |
48 static const uint8_t kRtxRedPayloadType; | 45 static const uint8_t kRtxRedPayloadType; |
49 static const uint8_t kUlpfecPayloadType; | 46 static const uint8_t kUlpfecPayloadType; |
50 static const uint8_t kAudioSendPayloadType; | 47 static const uint8_t kAudioSendPayloadType; |
51 static const uint32_t kSendRtxSsrcs[kNumSsrcs]; | 48 static const uint32_t kSendRtxSsrcs[kNumSsrcs]; |
(...skipping 13 matching lines...) Expand all Loading... |
65 const Call::Config& receiver_config); | 62 const Call::Config& receiver_config); |
66 void CreateSenderCall(const Call::Config& config); | 63 void CreateSenderCall(const Call::Config& config); |
67 void CreateReceiverCall(const Call::Config& config); | 64 void CreateReceiverCall(const Call::Config& config); |
68 void DestroyCalls(); | 65 void DestroyCalls(); |
69 | 66 |
70 void CreateSendConfig(size_t num_video_streams, | 67 void CreateSendConfig(size_t num_video_streams, |
71 size_t num_audio_streams, | 68 size_t num_audio_streams, |
72 Transport* send_transport); | 69 Transport* send_transport); |
73 void CreateMatchingReceiveConfigs(Transport* rtcp_send_transport); | 70 void CreateMatchingReceiveConfigs(Transport* rtcp_send_transport); |
74 | 71 |
75 void CreateFrameGeneratorCapturerWithDrift(Clock* drift_clock, | 72 void CreateFrameGeneratorCapturerWithDrift(Clock* drift_clock, float speed); |
76 float speed, | 73 void CreateFrameGeneratorCapturer(); |
77 int framerate, | |
78 int width, | |
79 int height); | |
80 void CreateFrameGeneratorCapturer(int framerate, int width, int height); | |
81 void CreateFakeAudioDevices(); | 74 void CreateFakeAudioDevices(); |
82 | 75 |
83 void CreateVideoStreams(); | 76 void CreateVideoStreams(); |
84 void CreateAudioStreams(); | 77 void CreateAudioStreams(); |
85 void Start(); | 78 void Start(); |
86 void Stop(); | 79 void Stop(); |
87 void DestroyStreams(); | 80 void DestroyStreams(); |
88 void SetFakeVideoCaptureRotation(VideoRotation rotation); | 81 void SetFakeVideoCaptureRotation(VideoRotation rotation); |
89 | 82 |
90 Clock* const clock_; | 83 Clock* const clock_; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 virtual Call::Config GetReceiverCallConfig(); | 147 virtual Call::Config GetReceiverCallConfig(); |
155 virtual void OnCallsCreated(Call* sender_call, Call* receiver_call); | 148 virtual void OnCallsCreated(Call* sender_call, Call* receiver_call); |
156 | 149 |
157 virtual test::PacketTransport* CreateSendTransport(Call* sender_call); | 150 virtual test::PacketTransport* CreateSendTransport(Call* sender_call); |
158 virtual test::PacketTransport* CreateReceiveTransport(); | 151 virtual test::PacketTransport* CreateReceiveTransport(); |
159 | 152 |
160 virtual void ModifyVideoConfigs( | 153 virtual void ModifyVideoConfigs( |
161 VideoSendStream::Config* send_config, | 154 VideoSendStream::Config* send_config, |
162 std::vector<VideoReceiveStream::Config>* receive_configs, | 155 std::vector<VideoReceiveStream::Config>* receive_configs, |
163 VideoEncoderConfig* encoder_config); | 156 VideoEncoderConfig* encoder_config); |
164 virtual void ModifyVideoCaptureStartResolution(int* width, | |
165 int* heigt, | |
166 int* frame_rate); | |
167 virtual void OnVideoStreamsCreated( | 157 virtual void OnVideoStreamsCreated( |
168 VideoSendStream* send_stream, | 158 VideoSendStream* send_stream, |
169 const std::vector<VideoReceiveStream*>& receive_streams); | 159 const std::vector<VideoReceiveStream*>& receive_streams); |
170 | 160 |
171 virtual void ModifyAudioConfigs( | 161 virtual void ModifyAudioConfigs( |
172 AudioSendStream::Config* send_config, | 162 AudioSendStream::Config* send_config, |
173 std::vector<AudioReceiveStream::Config>* receive_configs); | 163 std::vector<AudioReceiveStream::Config>* receive_configs); |
174 virtual void OnAudioStreamsCreated( | 164 virtual void OnAudioStreamsCreated( |
175 AudioSendStream* send_stream, | 165 AudioSendStream* send_stream, |
176 const std::vector<AudioReceiveStream*>& receive_streams); | 166 const std::vector<AudioReceiveStream*>& receive_streams); |
(...skipping 13 matching lines...) Expand all Loading... |
190 public: | 180 public: |
191 explicit EndToEndTest(unsigned int timeout_ms); | 181 explicit EndToEndTest(unsigned int timeout_ms); |
192 | 182 |
193 bool ShouldCreateReceivers() const override; | 183 bool ShouldCreateReceivers() const override; |
194 }; | 184 }; |
195 | 185 |
196 } // namespace test | 186 } // namespace test |
197 } // namespace webrtc | 187 } // namespace webrtc |
198 | 188 |
199 #endif // WEBRTC_TEST_CALL_TEST_H_ | 189 #endif // WEBRTC_TEST_CALL_TEST_H_ |
OLD | NEW |