• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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  */
10 #ifndef AUDIO_TEST_AUDIO_END_TO_END_TEST_H_
11 #define AUDIO_TEST_AUDIO_END_TO_END_TEST_H_
12 
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 #include "api/task_queue/task_queue_base.h"
18 #include "api/test/simulated_network.h"
19 #include "test/call_test.h"
20 
21 namespace webrtc {
22 namespace test {
23 
24 class AudioEndToEndTest : public test::EndToEndTest {
25  public:
26   AudioEndToEndTest();
27 
28  protected:
send_audio_device()29   TestAudioDeviceModule* send_audio_device() { return send_audio_device_; }
send_stream()30   const AudioSendStream* send_stream() const { return send_stream_; }
receive_stream()31   const AudioReceiveStream* receive_stream() const { return receive_stream_; }
32 
33   virtual BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() const;
34 
35   size_t GetNumVideoStreams() const override;
36   size_t GetNumAudioStreams() const override;
37   size_t GetNumFlexfecStreams() const override;
38 
39   std::unique_ptr<TestAudioDeviceModule::Capturer> CreateCapturer() override;
40   std::unique_ptr<TestAudioDeviceModule::Renderer> CreateRenderer() override;
41 
42   void OnFakeAudioDevicesCreated(
43       TestAudioDeviceModule* send_audio_device,
44       TestAudioDeviceModule* recv_audio_device) override;
45 
46   std::unique_ptr<test::PacketTransport> CreateSendTransport(
47       TaskQueueBase* task_queue,
48       Call* sender_call) override;
49   std::unique_ptr<test::PacketTransport> CreateReceiveTransport(
50       TaskQueueBase* task_queue) override;
51 
52   void ModifyAudioConfigs(
53       AudioSendStream::Config* send_config,
54       std::vector<AudioReceiveStream::Config>* receive_configs) override;
55   void OnAudioStreamsCreated(
56       AudioSendStream* send_stream,
57       const std::vector<AudioReceiveStream*>& receive_streams) override;
58 
59   void PerformTest() override;
60 
61  private:
62   TestAudioDeviceModule* send_audio_device_ = nullptr;
63   AudioSendStream* send_stream_ = nullptr;
64   AudioReceiveStream* receive_stream_ = nullptr;
65 };
66 
67 }  // namespace test
68 }  // namespace webrtc
69 
70 #endif  // AUDIO_TEST_AUDIO_END_TO_END_TEST_H_
71