audio_end_to_end_test.h 2.3 KB

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