Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 | |
| 11 | #ifndef VIDEO_END_TO_END_TESTS_MULTI_STREAM_TESTER_H_ |
| 12 | #define VIDEO_END_TO_END_TESTS_MULTI_STREAM_TESTER_H_ |
| 13 | |
| 14 | #include <map> |
Danil Chapovalov | 44db436 | 2019-09-30 02:16:28 | [diff] [blame] | 15 | #include <memory> |
Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 16 | |
Danil Chapovalov | 44db436 | 2019-09-30 02:16:28 | [diff] [blame] | 17 | #include "api/task_queue/task_queue_base.h" |
Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 18 | #include "call/call.h" |
| 19 | #include "test/direct_transport.h" |
| 20 | #include "test/frame_generator_capturer.h" |
| 21 | |
| 22 | namespace webrtc { |
| 23 | // Test sets up a Call multiple senders with different resolutions and SSRCs. |
| 24 | // Another is set up to receive all three of these with different renderers. |
| 25 | class MultiStreamTester { |
| 26 | public: |
| 27 | static constexpr size_t kNumStreams = 3; |
| 28 | const uint8_t kVideoPayloadType = 124; |
| 29 | const std::map<uint8_t, MediaType> payload_type_map_ = { |
| 30 | {kVideoPayloadType, MediaType::VIDEO}}; |
| 31 | |
| 32 | struct CodecSettings { |
| 33 | uint32_t ssrc; |
| 34 | int width; |
| 35 | int height; |
| 36 | } codec_settings[kNumStreams]; |
| 37 | |
Danil Chapovalov | 1242d9c | 2019-11-08 15:17:41 | [diff] [blame] | 38 | MultiStreamTester(); |
Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 39 | |
| 40 | virtual ~MultiStreamTester(); |
| 41 | |
| 42 | void RunTest(); |
| 43 | |
| 44 | protected: |
| 45 | virtual void Wait() = 0; |
| 46 | // Note: frame_generator is a point-to-pointer, since the actual instance |
| 47 | // hasn't been created at the time of this call. Only when packets/frames |
| 48 | // start flowing should this be dereferenced. |
| 49 | virtual void UpdateSendConfig(size_t stream_index, |
| 50 | VideoSendStream::Config* send_config, |
| 51 | VideoEncoderConfig* encoder_config, |
| 52 | test::FrameGeneratorCapturer** frame_generator); |
Tommi | f6f4543 | 2022-05-20 13:21:20 | [diff] [blame] | 53 | virtual void UpdateReceiveConfig( |
| 54 | size_t stream_index, |
| 55 | VideoReceiveStreamInterface::Config* receive_config); |
Danil Chapovalov | 44db436 | 2019-09-30 02:16:28 | [diff] [blame] | 56 | virtual std::unique_ptr<test::DirectTransport> CreateSendTransport( |
| 57 | TaskQueueBase* task_queue, |
Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 58 | Call* sender_call); |
Danil Chapovalov | 44db436 | 2019-09-30 02:16:28 | [diff] [blame] | 59 | virtual std::unique_ptr<test::DirectTransport> CreateReceiveTransport( |
| 60 | TaskQueueBase* task_queue, |
Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 61 | Call* receiver_call); |
Sebastian Jansson | c501713 | 2018-02-02 15:24:16 | [diff] [blame] | 62 | }; |
| 63 | } // namespace webrtc |
| 64 | #endif // VIDEO_END_TO_END_TESTS_MULTI_STREAM_TESTER_H_ |