OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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_AUDIO_TEST_LOW_BANDWIDTH_AUDIO_TEST_H_ | 10 #ifndef WEBRTC_AUDIO_TEST_AUDIO_END_TO_END_TEST_H_ |
11 #define WEBRTC_AUDIO_TEST_LOW_BANDWIDTH_AUDIO_TEST_H_ | 11 #define WEBRTC_AUDIO_TEST_AUDIO_END_TO_END_TEST_H_ |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/test/call_test.h" | 17 #include "webrtc/test/call_test.h" |
18 #include "webrtc/test/fake_audio_device.h" | |
19 | 18 |
20 namespace webrtc { | 19 namespace webrtc { |
21 namespace test { | 20 namespace test { |
22 | 21 |
23 class AudioQualityTest : public test::EndToEndTest { | 22 class AudioEndToEndTest : public test::EndToEndTest { |
24 public: | 23 public: |
25 AudioQualityTest(); | 24 AudioEndToEndTest(); |
26 | 25 |
27 protected: | 26 protected: |
28 virtual std::string AudioInputFile(); | 27 test::FakeAudioDevice* send_audio_device() { return send_audio_device_; } |
29 virtual std::string AudioOutputFile(); | 28 const AudioSendStream* send_stream() const { return send_stream_; } |
| 29 const AudioReceiveStream* receive_stream() const { return receive_stream_; } |
30 | 30 |
31 virtual FakeNetworkPipe::Config GetNetworkPipeConfig(); | 31 virtual FakeNetworkPipe::Config GetNetworkPipeConfig() const; |
32 | 32 |
33 size_t GetNumVideoStreams() const override; | 33 size_t GetNumVideoStreams() const override; |
34 size_t GetNumAudioStreams() const override; | 34 size_t GetNumAudioStreams() const override; |
35 size_t GetNumFlexfecStreams() const override; | 35 size_t GetNumFlexfecStreams() const override; |
36 | 36 |
37 std::unique_ptr<test::FakeAudioDevice::Capturer> CreateCapturer() override; | 37 std::unique_ptr<test::FakeAudioDevice::Capturer> CreateCapturer() override; |
38 std::unique_ptr<test::FakeAudioDevice::Renderer> CreateRenderer() override; | 38 std::unique_ptr<test::FakeAudioDevice::Renderer> CreateRenderer() override; |
39 | 39 |
40 void OnFakeAudioDevicesCreated( | 40 void OnFakeAudioDevicesCreated( |
41 test::FakeAudioDevice* send_audio_device, | 41 test::FakeAudioDevice* send_audio_device, |
42 test::FakeAudioDevice* recv_audio_device) override; | 42 test::FakeAudioDevice* recv_audio_device) override; |
43 | 43 |
44 test::PacketTransport* CreateSendTransport( | 44 test::PacketTransport* CreateSendTransport( |
45 SingleThreadedTaskQueueForTesting* task_queue, | 45 SingleThreadedTaskQueueForTesting* task_queue, |
46 Call* sender_call) override; | 46 Call* sender_call) override; |
47 test::PacketTransport* CreateReceiveTransport( | 47 test::PacketTransport* CreateReceiveTransport( |
48 SingleThreadedTaskQueueForTesting* task_queue) override; | 48 SingleThreadedTaskQueueForTesting* task_queue) override; |
49 | 49 |
50 void ModifyAudioConfigs( | 50 void ModifyAudioConfigs( |
51 AudioSendStream::Config* send_config, | 51 AudioSendStream::Config* send_config, |
52 std::vector<AudioReceiveStream::Config>* receive_configs) override; | 52 std::vector<AudioReceiveStream::Config>* receive_configs) override; |
| 53 void OnAudioStreamsCreated( |
| 54 AudioSendStream* send_stream, |
| 55 const std::vector<AudioReceiveStream*>& receive_streams) override; |
53 | 56 |
54 void PerformTest() override; | 57 void PerformTest() override; |
55 void OnTestFinished() override; | |
56 | 58 |
57 private: | 59 private: |
58 test::FakeAudioDevice* send_audio_device_; | 60 test::FakeAudioDevice* send_audio_device_ = nullptr; |
| 61 AudioSendStream* send_stream_ = nullptr; |
| 62 AudioReceiveStream* receive_stream_ = nullptr; |
59 }; | 63 }; |
60 | 64 |
61 } // namespace test | 65 } // namespace test |
62 } // namespace webrtc | 66 } // namespace webrtc |
63 | 67 |
64 #endif // WEBRTC_AUDIO_TEST_LOW_BANDWIDTH_AUDIO_TEST_H_ | 68 #endif // WEBRTC_AUDIO_TEST_AUDIO_END_TO_END_TEST_H_ |
OLD | NEW |