OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef WEBRTC_TEST_COMMON_CALL_TEST_H_ | 10 #ifndef WEBRTC_TEST_COMMON_CALL_TEST_H_ |
(...skipping 28 matching lines...) Expand all Loading... |
39 static const uint8_t kRedPayloadType; | 39 static const uint8_t kRedPayloadType; |
40 static const uint8_t kRtxRedPayloadType; | 40 static const uint8_t kRtxRedPayloadType; |
41 static const uint8_t kUlpfecPayloadType; | 41 static const uint8_t kUlpfecPayloadType; |
42 static const uint32_t kSendRtxSsrcs[kNumSsrcs]; | 42 static const uint32_t kSendRtxSsrcs[kNumSsrcs]; |
43 static const uint32_t kSendSsrcs[kNumSsrcs]; | 43 static const uint32_t kSendSsrcs[kNumSsrcs]; |
44 static const uint32_t kReceiverLocalSsrc; | 44 static const uint32_t kReceiverLocalSsrc; |
45 static const int kNackRtpHistoryMs; | 45 static const int kNackRtpHistoryMs; |
46 static const int kAbsSendTimeExtensionId; | 46 static const int kAbsSendTimeExtensionId; |
47 | 47 |
48 protected: | 48 protected: |
49 void RunBaseTest(BaseTest* test); | 49 void RunBaseTest(BaseTest* test, const FakeNetworkPipe::Config& config); |
50 | 50 |
51 void CreateCalls(const Call::Config& sender_config, | 51 void CreateCalls(const Call::Config& sender_config, |
52 const Call::Config& receiver_config); | 52 const Call::Config& receiver_config); |
53 void CreateSenderCall(const Call::Config& config); | 53 void CreateSenderCall(const Call::Config& config); |
54 void CreateReceiverCall(const Call::Config& config); | 54 void CreateReceiverCall(const Call::Config& config); |
55 void DestroyCalls(); | 55 void DestroyCalls(); |
56 | 56 |
57 void CreateSendConfig(size_t num_streams, Transport* send_transport); | 57 void CreateSendConfig(size_t num_streams, Transport* send_transport); |
58 void CreateMatchingReceiveConfigs(Transport* rtcp_send_transport); | 58 void CreateMatchingReceiveConfigs(Transport* rtcp_send_transport); |
59 | 59 |
60 void CreateFrameGeneratorCapturer(); | 60 void CreateFrameGeneratorCapturer(); |
61 | 61 |
62 void CreateStreams(); | 62 void CreateStreams(); |
63 void Start(); | 63 void Start(); |
64 void Stop(); | 64 void Stop(); |
65 void DestroyStreams(); | 65 void DestroyStreams(); |
66 | 66 |
67 Clock* const clock_; | 67 Clock* const clock_; |
68 | 68 |
69 rtc::scoped_ptr<Call> sender_call_; | 69 rtc::scoped_ptr<Call> sender_call_; |
| 70 rtc::scoped_ptr<PacketTransport> send_transport_; |
70 VideoSendStream::Config send_config_; | 71 VideoSendStream::Config send_config_; |
71 VideoEncoderConfig encoder_config_; | 72 VideoEncoderConfig encoder_config_; |
72 VideoSendStream* send_stream_; | 73 VideoSendStream* send_stream_; |
73 | 74 |
74 rtc::scoped_ptr<Call> receiver_call_; | 75 rtc::scoped_ptr<Call> receiver_call_; |
| 76 rtc::scoped_ptr<PacketTransport> receive_transport_; |
75 std::vector<VideoReceiveStream::Config> receive_configs_; | 77 std::vector<VideoReceiveStream::Config> receive_configs_; |
76 std::vector<VideoReceiveStream*> receive_streams_; | 78 std::vector<VideoReceiveStream*> receive_streams_; |
77 | 79 |
78 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; | 80 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; |
79 test::FakeEncoder fake_encoder_; | 81 test::FakeEncoder fake_encoder_; |
80 ScopedVector<VideoDecoder> allocated_decoders_; | 82 ScopedVector<VideoDecoder> allocated_decoders_; |
81 }; | 83 }; |
82 | 84 |
83 class BaseTest : public RtpRtcpObserver { | 85 class BaseTest : public RtpRtcpObserver { |
84 public: | 86 public: |
85 explicit BaseTest(unsigned int timeout_ms); | 87 explicit BaseTest(unsigned int timeout_ms); |
86 BaseTest(unsigned int timeout_ms, const FakeNetworkPipe::Config& config); | |
87 virtual ~BaseTest(); | 88 virtual ~BaseTest(); |
88 | 89 |
89 virtual void PerformTest() = 0; | 90 virtual void PerformTest() = 0; |
90 virtual bool ShouldCreateReceivers() const = 0; | 91 virtual bool ShouldCreateReceivers() const = 0; |
91 | 92 |
92 virtual size_t GetNumStreams() const; | 93 virtual size_t GetNumStreams() const; |
93 | 94 |
94 virtual Call::Config GetSenderCallConfig(); | 95 virtual Call::Config GetSenderCallConfig(); |
95 virtual Call::Config GetReceiverCallConfig(); | 96 virtual Call::Config GetReceiverCallConfig(); |
96 virtual void OnCallsCreated(Call* sender_call, Call* receiver_call); | 97 virtual void OnCallsCreated(Call* sender_call, Call* receiver_call); |
97 | 98 |
98 virtual void ModifyConfigs( | 99 virtual void ModifyConfigs( |
99 VideoSendStream::Config* send_config, | 100 VideoSendStream::Config* send_config, |
100 std::vector<VideoReceiveStream::Config>* receive_configs, | 101 std::vector<VideoReceiveStream::Config>* receive_configs, |
101 VideoEncoderConfig* encoder_config); | 102 VideoEncoderConfig* encoder_config); |
102 virtual void OnStreamsCreated( | 103 virtual void OnStreamsCreated( |
103 VideoSendStream* send_stream, | 104 VideoSendStream* send_stream, |
104 const std::vector<VideoReceiveStream*>& receive_streams); | 105 const std::vector<VideoReceiveStream*>& receive_streams); |
105 | 106 |
106 virtual void OnFrameGeneratorCapturerCreated( | 107 virtual void OnFrameGeneratorCapturerCreated( |
107 FrameGeneratorCapturer* frame_generator_capturer); | 108 FrameGeneratorCapturer* frame_generator_capturer); |
108 }; | 109 }; |
109 | 110 |
110 class SendTest : public BaseTest { | 111 class SendTest : public BaseTest { |
111 public: | 112 public: |
112 explicit SendTest(unsigned int timeout_ms); | 113 explicit SendTest(unsigned int timeout_ms); |
113 SendTest(unsigned int timeout_ms, const FakeNetworkPipe::Config& config); | |
114 | 114 |
115 bool ShouldCreateReceivers() const override; | 115 bool ShouldCreateReceivers() const override; |
116 }; | 116 }; |
117 | 117 |
118 class EndToEndTest : public BaseTest { | 118 class EndToEndTest : public BaseTest { |
119 public: | 119 public: |
120 explicit EndToEndTest(unsigned int timeout_ms); | 120 explicit EndToEndTest(unsigned int timeout_ms); |
121 EndToEndTest(unsigned int timeout_ms, const FakeNetworkPipe::Config& config); | |
122 | 121 |
123 bool ShouldCreateReceivers() const override; | 122 bool ShouldCreateReceivers() const override; |
124 }; | 123 }; |
125 | 124 |
126 } // namespace test | 125 } // namespace test |
127 } // namespace webrtc | 126 } // namespace webrtc |
128 | 127 |
129 #endif // WEBRTC_TEST_COMMON_CALL_TEST_H_ | 128 #endif // WEBRTC_TEST_COMMON_CALL_TEST_H_ |
OLD | NEW |