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