• 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 AudioReceiveStreamInterface* receive_stream() const {
32     return receive_stream_;
33   }
34 
35   virtual BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() const;
36 
37   size_t GetNumVideoStreams() const override;
38   size_t GetNumAudioStreams() const override;
39   size_t GetNumFlexfecStreams() const override;
40 
41   std::unique_ptr<TestAudioDeviceModule::Capturer> CreateCapturer() override;
42   std::unique_ptr<TestAudioDeviceModule::Renderer> CreateRenderer() override;
43 
44   void OnFakeAudioDevicesCreated(
45       TestAudioDeviceModule* send_audio_device,
46       TestAudioDeviceModule* recv_audio_device) override;
47 
48   std::unique_ptr<test::PacketTransport> CreateSendTransport(
49       TaskQueueBase* task_queue,
50       Call* sender_call) override;
51   std::unique_ptr<test::PacketTransport> CreateReceiveTransport(
52       TaskQueueBase* task_queue) override;
53 
54   void ModifyAudioConfigs(AudioSendStream::Config* send_config,
55                           std::vector<AudioReceiveStreamInterface::Config>*
56                               receive_configs) override;
57   void OnAudioStreamsCreated(AudioSendStream* send_stream,
58                              const std::vector<AudioReceiveStreamInterface*>&
59                                  receive_streams) override;
60 
61   void PerformTest() override;
62 
63  private:
64   TestAudioDeviceModule* send_audio_device_ = nullptr;
65   AudioSendStream* send_stream_ = nullptr;
66   AudioReceiveStreamInterface* receive_stream_ = nullptr;
67 };
68 
69 }  // namespace test
70 }  // namespace webrtc
71 
72 #endif  // AUDIO_TEST_AUDIO_END_TO_END_TEST_H_
73