blob: 87200930f492ca19979c2196681d324cc3f71cf1 [file] [log] [blame]
Sebastian Janssonc5017132018-02-02 15:24:161/*
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 Chapovalov44db4362019-09-30 02:16:2815#include <memory>
Sebastian Janssonc5017132018-02-02 15:24:1616
Danil Chapovalov44db4362019-09-30 02:16:2817#include "api/task_queue/task_queue_base.h"
Sebastian Janssonc5017132018-02-02 15:24:1618#include "call/call.h"
19#include "test/direct_transport.h"
20#include "test/frame_generator_capturer.h"
21
22namespace 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.
25class 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 Chapovalov1242d9c2019-11-08 15:17:4138 MultiStreamTester();
Sebastian Janssonc5017132018-02-02 15:24:1639
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);
Tommif6f45432022-05-20 13:21:2053 virtual void UpdateReceiveConfig(
54 size_t stream_index,
55 VideoReceiveStreamInterface::Config* receive_config);
Danil Chapovalov44db4362019-09-30 02:16:2856 virtual std::unique_ptr<test::DirectTransport> CreateSendTransport(
57 TaskQueueBase* task_queue,
Sebastian Janssonc5017132018-02-02 15:24:1658 Call* sender_call);
Danil Chapovalov44db4362019-09-30 02:16:2859 virtual std::unique_ptr<test::DirectTransport> CreateReceiveTransport(
60 TaskQueueBase* task_queue,
Sebastian Janssonc5017132018-02-02 15:24:1661 Call* receiver_call);
Sebastian Janssonc5017132018-02-02 15:24:1662};
63} // namespace webrtc
64#endif // VIDEO_END_TO_END_TESTS_MULTI_STREAM_TESTER_H_