blob: c47cb470766ab8a85afc38cf2c1974b5f05caeff [file] [log] [blame]
oprypin92220ff2017-03-23 03:40:03 -07001/*
2 * Copyright (c) 2017 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 */
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef AUDIO_TEST_AUDIO_END_TO_END_TEST_H_
11#define AUDIO_TEST_AUDIO_END_TO_END_TEST_H_
oprypin92220ff2017-03-23 03:40:03 -070012
13#include <memory>
14#include <string>
15#include <vector>
16
Danil Chapovalov44db4362019-09-30 04:16:28 +020017#include "api/task_queue/task_queue_base.h"
Artem Titov46c4e602018-08-17 14:26:54 +020018#include "api/test/simulated_network.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "test/call_test.h"
oprypin92220ff2017-03-23 03:40:03 -070020
21namespace webrtc {
22namespace test {
23
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020024class AudioEndToEndTest : public test::EndToEndTest {
oprypin92220ff2017-03-23 03:40:03 -070025 public:
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020026 AudioEndToEndTest();
oprypin92220ff2017-03-23 03:40:03 -070027
28 protected:
Artem Titov3faa8322018-03-07 14:44:00 +010029 TestAudioDeviceModule* send_audio_device() { return send_audio_device_; }
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020030 const AudioSendStream* send_stream() const { return send_stream_; }
31 const AudioReceiveStream* receive_stream() const { return receive_stream_; }
oprypin92220ff2017-03-23 03:40:03 -070032
Artem Titov75e36472018-10-08 12:28:56 +020033 virtual BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() const;
oprypin92220ff2017-03-23 03:40:03 -070034
35 size_t GetNumVideoStreams() const override;
36 size_t GetNumAudioStreams() const override;
37 size_t GetNumFlexfecStreams() const override;
38
Artem Titov3faa8322018-03-07 14:44:00 +010039 std::unique_ptr<TestAudioDeviceModule::Capturer> CreateCapturer() override;
40 std::unique_ptr<TestAudioDeviceModule::Renderer> CreateRenderer() override;
oprypin92220ff2017-03-23 03:40:03 -070041
42 void OnFakeAudioDevicesCreated(
Artem Titov3faa8322018-03-07 14:44:00 +010043 TestAudioDeviceModule* send_audio_device,
44 TestAudioDeviceModule* recv_audio_device) override;
oprypin92220ff2017-03-23 03:40:03 -070045
Danil Chapovalov44db4362019-09-30 04:16:28 +020046 std::unique_ptr<test::PacketTransport> CreateSendTransport(
47 TaskQueueBase* task_queue,
eladalon413ee9a2017-08-22 04:02:52 -070048 Call* sender_call) override;
Danil Chapovalov44db4362019-09-30 04:16:28 +020049 std::unique_ptr<test::PacketTransport> CreateReceiveTransport(
50 TaskQueueBase* task_queue) override;
oprypin92220ff2017-03-23 03:40:03 -070051
52 void ModifyAudioConfigs(
53 AudioSendStream::Config* send_config,
54 std::vector<AudioReceiveStream::Config>* receive_configs) override;
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020055 void OnAudioStreamsCreated(
56 AudioSendStream* send_stream,
57 const std::vector<AudioReceiveStream*>& receive_streams) override;
oprypin92220ff2017-03-23 03:40:03 -070058
59 void PerformTest() override;
oprypin92220ff2017-03-23 03:40:03 -070060
61 private:
Artem Titov3faa8322018-03-07 14:44:00 +010062 TestAudioDeviceModule* send_audio_device_ = nullptr;
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020063 AudioSendStream* send_stream_ = nullptr;
64 AudioReceiveStream* receive_stream_ = nullptr;
oprypin92220ff2017-03-23 03:40:03 -070065};
66
67} // namespace test
68} // namespace webrtc
69
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020070#endif // AUDIO_TEST_AUDIO_END_TO_END_TEST_H_