2014-06-27 08:47:52 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef TEST_CALL_TEST_H_
|
|
|
|
|
#define TEST_CALL_TEST_H_
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2019-01-16 17:45:05 +01:00
|
|
|
#include <map>
|
2016-03-31 10:24:26 -07:00
|
|
|
#include <memory>
|
2019-01-16 17:45:05 +01:00
|
|
|
#include <string>
|
2014-06-27 08:47:52 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
#include "absl/types/optional.h"
|
2019-08-07 12:24:53 +02:00
|
|
|
#include "api/rtc_event_log/rtc_event_log.h"
|
2019-09-30 04:16:28 +02:00
|
|
|
#include "api/task_queue/task_queue_base.h"
|
2019-04-18 10:58:56 +02:00
|
|
|
#include "api/task_queue/task_queue_factory.h"
|
2018-10-26 15:57:48 +02:00
|
|
|
#include "api/test/video/function_video_decoder_factory.h"
|
|
|
|
|
#include "api/test/video/function_video_encoder_factory.h"
|
2019-11-28 13:44:25 +01:00
|
|
|
#include "api/transport/field_trial_based_config.h"
|
2018-11-08 10:02:56 -08:00
|
|
|
#include "api/video/video_bitrate_allocator_factory.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "call/call.h"
|
2018-03-07 14:44:00 +01:00
|
|
|
#include "modules/audio_device/include/test_audio_device.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/encoder_settings.h"
|
|
|
|
|
#include "test/fake_decoder.h"
|
|
|
|
|
#include "test/fake_videorenderer.h"
|
2018-08-27 14:12:27 +02:00
|
|
|
#include "test/fake_vp8_encoder.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/frame_generator_capturer.h"
|
|
|
|
|
#include "test/rtp_rtcp_observer.h"
|
2020-05-05 15:35:45 +02:00
|
|
|
#include "test/run_loop.h"
|
2014-06-27 08:47:52 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
class BaseTest;
|
|
|
|
|
|
|
|
|
|
class CallTest : public ::testing::Test {
|
|
|
|
|
public:
|
|
|
|
|
CallTest();
|
2016-01-07 17:43:18 +01:00
|
|
|
virtual ~CallTest();
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2017-12-21 18:02:59 +01:00
|
|
|
static constexpr size_t kNumSsrcs = 6;
|
|
|
|
|
static const int kNumSimulcastStreams = 3;
|
2016-10-02 23:45:26 -07:00
|
|
|
static const int kDefaultWidth = 320;
|
|
|
|
|
static const int kDefaultHeight = 180;
|
|
|
|
|
static const int kDefaultFramerate = 30;
|
2015-12-10 13:02:50 +01:00
|
|
|
static const int kDefaultTimeoutMs;
|
|
|
|
|
static const int kLongTimeoutMs;
|
2018-03-16 11:12:06 +01:00
|
|
|
enum classPayloadTypes : uint8_t {
|
|
|
|
|
kSendRtxPayloadType = 98,
|
|
|
|
|
kRtxRedPayloadType = 99,
|
|
|
|
|
kVideoSendPayloadType = 100,
|
|
|
|
|
kAudioSendPayloadType = 103,
|
|
|
|
|
kRedPayloadType = 118,
|
|
|
|
|
kUlpfecPayloadType = 119,
|
|
|
|
|
kFlexfecPayloadType = 120,
|
|
|
|
|
kPayloadTypeH264 = 122,
|
|
|
|
|
kPayloadTypeVP8 = 123,
|
|
|
|
|
kPayloadTypeVP9 = 124,
|
2019-06-13 16:28:14 +02:00
|
|
|
kPayloadTypeGeneric = 125,
|
|
|
|
|
kFakeVideoSendPayloadType = 126,
|
2018-03-16 11:12:06 +01:00
|
|
|
};
|
2014-07-07 13:06:48 +00:00
|
|
|
static const uint32_t kSendRtxSsrcs[kNumSsrcs];
|
2016-01-07 17:43:18 +01:00
|
|
|
static const uint32_t kVideoSendSsrcs[kNumSsrcs];
|
|
|
|
|
static const uint32_t kAudioSendSsrc;
|
2016-11-15 07:10:52 -08:00
|
|
|
static const uint32_t kFlexfecSendSsrc;
|
2016-01-07 17:43:18 +01:00
|
|
|
static const uint32_t kReceiverLocalVideoSsrc;
|
|
|
|
|
static const uint32_t kReceiverLocalAudioSsrc;
|
2014-06-27 08:47:52 +00:00
|
|
|
static const int kNackRtpHistoryMs;
|
2017-04-10 16:57:57 -07:00
|
|
|
static const std::map<uint8_t, MediaType> payload_type_map_;
|
2014-06-27 08:47:52 +00:00
|
|
|
|
|
|
|
|
protected:
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
void RegisterRtpExtension(const RtpExtension& extension);
|
|
|
|
|
|
2018-01-11 13:52:30 +01:00
|
|
|
// RunBaseTest overwrites the audio_state of the send and receive Call configs
|
|
|
|
|
// to simplify test code.
|
2016-01-08 06:47:13 -08:00
|
|
|
void RunBaseTest(BaseTest* test);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2018-07-13 10:43:20 +02:00
|
|
|
void CreateCalls();
|
2014-06-27 08:47:52 +00:00
|
|
|
void CreateCalls(const Call::Config& sender_config,
|
|
|
|
|
const Call::Config& receiver_config);
|
2018-07-13 10:43:20 +02:00
|
|
|
void CreateSenderCall();
|
2014-06-27 08:47:52 +00:00
|
|
|
void CreateSenderCall(const Call::Config& config);
|
|
|
|
|
void CreateReceiverCall(const Call::Config& config);
|
2015-10-22 10:49:27 +02:00
|
|
|
void DestroyCalls();
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2017-12-21 18:02:59 +01:00
|
|
|
void CreateVideoSendConfig(VideoSendStream::Config* video_config,
|
|
|
|
|
size_t num_video_streams,
|
|
|
|
|
size_t num_used_ssrcs,
|
|
|
|
|
Transport* send_transport);
|
|
|
|
|
void CreateAudioAndFecSendConfigs(size_t num_audio_streams,
|
|
|
|
|
size_t num_flexfec_streams,
|
|
|
|
|
Transport* send_transport);
|
2018-07-13 13:29:03 +02:00
|
|
|
void SetAudioConfig(const AudioSendStream::Config& config);
|
|
|
|
|
|
|
|
|
|
void SetSendFecConfig(std::vector<uint32_t> video_send_ssrcs);
|
|
|
|
|
void SetSendUlpFecConfig(VideoSendStream::Config* send_config);
|
|
|
|
|
void SetReceiveUlpFecConfig(VideoReceiveStream::Config* receive_config);
|
2016-01-07 17:43:18 +01:00
|
|
|
void CreateSendConfig(size_t num_video_streams,
|
|
|
|
|
size_t num_audio_streams,
|
2016-11-15 07:10:52 -08:00
|
|
|
size_t num_flexfec_streams,
|
2016-01-07 17:43:18 +01:00
|
|
|
Transport* send_transport);
|
2017-03-07 04:21:04 -08:00
|
|
|
|
2018-07-13 13:29:03 +02:00
|
|
|
void CreateMatchingVideoReceiveConfigs(
|
2017-12-21 18:02:59 +01:00
|
|
|
const VideoSendStream::Config& video_send_config,
|
|
|
|
|
Transport* rtcp_send_transport);
|
2018-07-13 13:29:03 +02:00
|
|
|
void CreateMatchingVideoReceiveConfigs(
|
|
|
|
|
const VideoSendStream::Config& video_send_config,
|
|
|
|
|
Transport* rtcp_send_transport,
|
|
|
|
|
bool send_side_bwe,
|
2018-09-28 09:07:24 +02:00
|
|
|
VideoDecoderFactory* decoder_factory,
|
2018-07-13 13:29:03 +02:00
|
|
|
absl::optional<size_t> decode_sub_stream,
|
|
|
|
|
bool receiver_reference_time_report,
|
|
|
|
|
int rtp_history_ms);
|
|
|
|
|
void AddMatchingVideoReceiveConfigs(
|
|
|
|
|
std::vector<VideoReceiveStream::Config>* receive_configs,
|
|
|
|
|
const VideoSendStream::Config& video_send_config,
|
|
|
|
|
Transport* rtcp_send_transport,
|
|
|
|
|
bool send_side_bwe,
|
2018-09-28 09:07:24 +02:00
|
|
|
VideoDecoderFactory* decoder_factory,
|
2018-07-13 13:29:03 +02:00
|
|
|
absl::optional<size_t> decode_sub_stream,
|
|
|
|
|
bool receiver_reference_time_report,
|
|
|
|
|
int rtp_history_ms);
|
|
|
|
|
|
2017-12-21 18:02:59 +01:00
|
|
|
void CreateMatchingAudioAndFecConfigs(Transport* rtcp_send_transport);
|
2018-07-13 13:29:03 +02:00
|
|
|
void CreateMatchingAudioConfigs(Transport* transport, std::string sync_group);
|
|
|
|
|
static AudioReceiveStream::Config CreateMatchingAudioConfig(
|
|
|
|
|
const AudioSendStream::Config& send_config,
|
|
|
|
|
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
|
|
|
|
|
Transport* transport,
|
|
|
|
|
std::string sync_group);
|
|
|
|
|
void CreateMatchingFecConfig(
|
|
|
|
|
Transport* transport,
|
|
|
|
|
const VideoSendStream::Config& video_send_config);
|
2015-09-28 09:59:31 -07:00
|
|
|
void CreateMatchingReceiveConfigs(Transport* rtcp_send_transport);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2016-10-02 23:45:26 -07:00
|
|
|
void CreateFrameGeneratorCapturerWithDrift(Clock* drift_clock,
|
|
|
|
|
float speed,
|
|
|
|
|
int framerate,
|
|
|
|
|
int width,
|
|
|
|
|
int height);
|
|
|
|
|
void CreateFrameGeneratorCapturer(int framerate, int width, int height);
|
2017-03-23 03:40:03 -07:00
|
|
|
void CreateFakeAudioDevices(
|
2018-03-07 14:44:00 +01:00
|
|
|
std::unique_ptr<TestAudioDeviceModule::Capturer> capturer,
|
|
|
|
|
std::unique_ptr<TestAudioDeviceModule::Renderer> renderer);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2016-01-07 17:43:18 +01:00
|
|
|
void CreateVideoStreams();
|
2018-07-13 09:49:00 +02:00
|
|
|
void CreateVideoSendStreams();
|
|
|
|
|
void CreateVideoSendStream(const VideoEncoderConfig& encoder_config);
|
2016-01-07 17:43:18 +01:00
|
|
|
void CreateAudioStreams();
|
2016-11-15 07:10:52 -08:00
|
|
|
void CreateFlexfecStreams();
|
2017-08-02 07:39:07 -07:00
|
|
|
|
2018-07-13 09:49:00 +02:00
|
|
|
void ConnectVideoSourcesToStreams();
|
|
|
|
|
|
2017-08-02 07:39:07 -07:00
|
|
|
void AssociateFlexfecStreamsWithVideoStreams();
|
|
|
|
|
void DissociateFlexfecStreamsFromVideoStreams();
|
|
|
|
|
|
2014-06-27 08:47:52 +00:00
|
|
|
void Start();
|
2018-07-13 09:49:00 +02:00
|
|
|
void StartVideoStreams();
|
2014-06-27 08:47:52 +00:00
|
|
|
void Stop();
|
2018-07-13 13:29:03 +02:00
|
|
|
void StopVideoStreams();
|
2014-06-27 08:47:52 +00:00
|
|
|
void DestroyStreams();
|
2018-07-13 09:49:00 +02:00
|
|
|
void DestroyVideoSendStreams();
|
2016-04-19 15:01:23 +02:00
|
|
|
void SetFakeVideoCaptureRotation(VideoRotation rotation);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2018-07-13 09:49:00 +02:00
|
|
|
void SetVideoDegradation(DegradationPreference preference);
|
|
|
|
|
|
|
|
|
|
VideoSendStream::Config* GetVideoSendConfig();
|
|
|
|
|
void SetVideoSendConfig(const VideoSendStream::Config& config);
|
|
|
|
|
VideoEncoderConfig* GetVideoEncoderConfig();
|
|
|
|
|
void SetVideoEncoderConfig(const VideoEncoderConfig& config);
|
|
|
|
|
VideoSendStream* GetVideoSendStream();
|
2018-07-13 13:29:03 +02:00
|
|
|
FlexfecReceiveStream::Config* GetFlexFecConfig();
|
2019-11-13 11:19:53 +01:00
|
|
|
TaskQueueBase* task_queue() { return task_queue_.get(); }
|
2018-07-13 09:49:00 +02:00
|
|
|
|
2020-05-05 15:35:45 +02:00
|
|
|
test::RunLoop loop_;
|
|
|
|
|
|
2014-07-07 13:06:48 +00:00
|
|
|
Clock* const clock_;
|
2019-11-28 13:44:25 +01:00
|
|
|
const FieldTrialBasedConfig field_trials_;
|
2014-07-07 13:06:48 +00:00
|
|
|
|
2019-04-18 10:58:56 +02:00
|
|
|
std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
2018-07-13 10:43:20 +02:00
|
|
|
std::unique_ptr<webrtc::RtcEventLog> send_event_log_;
|
|
|
|
|
std::unique_ptr<webrtc::RtcEventLog> recv_event_log_;
|
2016-05-01 14:53:46 -07:00
|
|
|
std::unique_ptr<Call> sender_call_;
|
|
|
|
|
std::unique_ptr<PacketTransport> send_transport_;
|
2018-07-13 13:29:03 +02:00
|
|
|
std::vector<VideoSendStream::Config> video_send_configs_;
|
|
|
|
|
std::vector<VideoEncoderConfig> video_encoder_configs_;
|
|
|
|
|
std::vector<VideoSendStream*> video_send_streams_;
|
2016-01-07 17:43:18 +01:00
|
|
|
AudioSendStream::Config audio_send_config_;
|
|
|
|
|
AudioSendStream* audio_send_stream_;
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2016-05-01 14:53:46 -07:00
|
|
|
std::unique_ptr<Call> receiver_call_;
|
|
|
|
|
std::unique_ptr<PacketTransport> receive_transport_;
|
2015-12-21 03:14:00 -08:00
|
|
|
std::vector<VideoReceiveStream::Config> video_receive_configs_;
|
|
|
|
|
std::vector<VideoReceiveStream*> video_receive_streams_;
|
2016-01-07 17:43:18 +01:00
|
|
|
std::vector<AudioReceiveStream::Config> audio_receive_configs_;
|
|
|
|
|
std::vector<AudioReceiveStream*> audio_receive_streams_;
|
2016-11-15 07:10:52 -08:00
|
|
|
std::vector<FlexfecReceiveStream::Config> flexfec_receive_configs_;
|
|
|
|
|
std::vector<FlexfecReceiveStream*> flexfec_receive_streams_;
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2018-07-13 13:29:03 +02:00
|
|
|
test::FrameGeneratorCapturer* frame_generator_capturer_;
|
2018-12-18 16:08:11 +01:00
|
|
|
std::vector<std::unique_ptr<rtc::VideoSourceInterface<VideoFrame>>>
|
|
|
|
|
video_sources_;
|
2018-07-13 13:29:03 +02:00
|
|
|
DegradationPreference degradation_preference_ =
|
|
|
|
|
DegradationPreference::MAINTAIN_FRAMERATE;
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory_;
|
2019-04-16 11:12:49 +02:00
|
|
|
std::unique_ptr<NetworkStatePredictorFactoryInterface>
|
|
|
|
|
network_state_predictor_factory_;
|
2019-04-30 14:23:51 +02:00
|
|
|
std::unique_ptr<NetworkControllerFactoryInterface>
|
|
|
|
|
network_controller_factory_;
|
2018-07-13 13:29:03 +02:00
|
|
|
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory fake_encoder_factory_;
|
|
|
|
|
int fake_encoder_max_bitrate_ = -1;
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory fake_decoder_factory_;
|
2018-11-08 10:02:56 -08:00
|
|
|
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
|
2018-07-13 13:29:03 +02:00
|
|
|
// Number of simulcast substreams.
|
2016-01-07 17:43:18 +01:00
|
|
|
size_t num_video_streams_;
|
|
|
|
|
size_t num_audio_streams_;
|
2016-11-15 07:10:52 -08:00
|
|
|
size_t num_flexfec_streams_;
|
2018-03-28 14:16:04 +02:00
|
|
|
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory_;
|
|
|
|
|
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory_;
|
2016-09-30 06:19:08 -07:00
|
|
|
test::FakeVideoRenderer fake_renderer_;
|
2016-01-07 17:43:18 +01:00
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
|
2016-01-07 17:43:18 +01:00
|
|
|
private:
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
absl::optional<RtpExtension> GetRtpExtensionByUri(
|
|
|
|
|
const std::string& uri) const;
|
|
|
|
|
|
|
|
|
|
void AddRtpExtensionByUri(const std::string& uri,
|
|
|
|
|
std::vector<RtpExtension>* extensions) const;
|
|
|
|
|
|
2019-11-13 11:19:53 +01:00
|
|
|
std::unique_ptr<TaskQueueBase, TaskQueueDeleter> task_queue_;
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
std::vector<RtpExtension> rtp_extensions_;
|
2017-06-29 08:32:09 -07:00
|
|
|
rtc::scoped_refptr<AudioProcessing> apm_send_;
|
|
|
|
|
rtc::scoped_refptr<AudioProcessing> apm_recv_;
|
2018-03-07 14:44:00 +01:00
|
|
|
rtc::scoped_refptr<TestAudioDeviceModule> fake_send_audio_device_;
|
|
|
|
|
rtc::scoped_refptr<TestAudioDeviceModule> fake_recv_audio_device_;
|
2014-06-27 08:47:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class BaseTest : public RtpRtcpObserver {
|
|
|
|
|
public:
|
2017-03-21 03:24:27 -07:00
|
|
|
BaseTest();
|
2018-07-13 13:19:42 +02:00
|
|
|
explicit BaseTest(int timeout_ms);
|
2014-06-27 08:47:52 +00:00
|
|
|
virtual ~BaseTest();
|
|
|
|
|
|
|
|
|
|
virtual void PerformTest() = 0;
|
|
|
|
|
virtual bool ShouldCreateReceivers() const = 0;
|
|
|
|
|
|
2016-01-07 17:43:18 +01:00
|
|
|
virtual size_t GetNumVideoStreams() const;
|
|
|
|
|
virtual size_t GetNumAudioStreams() const;
|
2016-11-15 07:10:52 -08:00
|
|
|
virtual size_t GetNumFlexfecStreams() const;
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2018-03-07 14:44:00 +01:00
|
|
|
virtual std::unique_ptr<TestAudioDeviceModule::Capturer> CreateCapturer();
|
|
|
|
|
virtual std::unique_ptr<TestAudioDeviceModule::Renderer> CreateRenderer();
|
|
|
|
|
virtual void OnFakeAudioDevicesCreated(
|
|
|
|
|
TestAudioDeviceModule* send_audio_device,
|
|
|
|
|
TestAudioDeviceModule* recv_audio_device);
|
2017-03-23 03:40:03 -07:00
|
|
|
|
2018-11-13 15:10:33 +01:00
|
|
|
virtual void ModifySenderBitrateConfig(BitrateConstraints* bitrate_config);
|
|
|
|
|
virtual void ModifyReceiverBitrateConfig(BitrateConstraints* bitrate_config);
|
2018-07-13 13:19:42 +02:00
|
|
|
|
2014-06-27 08:47:52 +00:00
|
|
|
virtual void OnCallsCreated(Call* sender_call, Call* receiver_call);
|
2016-01-08 06:47:13 -08:00
|
|
|
|
2019-09-30 04:16:28 +02:00
|
|
|
virtual std::unique_ptr<test::PacketTransport> CreateSendTransport(
|
|
|
|
|
TaskQueueBase* task_queue,
|
2017-08-22 04:02:52 -07:00
|
|
|
Call* sender_call);
|
2019-09-30 04:16:28 +02:00
|
|
|
virtual std::unique_ptr<test::PacketTransport> CreateReceiveTransport(
|
|
|
|
|
TaskQueueBase* task_queue);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2015-12-21 03:14:00 -08:00
|
|
|
virtual void ModifyVideoConfigs(
|
2014-06-30 13:19:09 +00:00
|
|
|
VideoSendStream::Config* send_config,
|
|
|
|
|
std::vector<VideoReceiveStream::Config>* receive_configs,
|
2014-09-19 12:30:25 +00:00
|
|
|
VideoEncoderConfig* encoder_config);
|
2016-10-02 23:45:26 -07:00
|
|
|
virtual void ModifyVideoCaptureStartResolution(int* width,
|
|
|
|
|
int* heigt,
|
|
|
|
|
int* frame_rate);
|
2018-11-05 14:11:44 +01:00
|
|
|
virtual void ModifyVideoDegradationPreference(
|
|
|
|
|
DegradationPreference* degradation_preference);
|
|
|
|
|
|
2015-12-21 03:14:00 -08:00
|
|
|
virtual void OnVideoStreamsCreated(
|
2014-06-30 13:19:09 +00:00
|
|
|
VideoSendStream* send_stream,
|
|
|
|
|
const std::vector<VideoReceiveStream*>& receive_streams);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2016-01-07 17:43:18 +01:00
|
|
|
virtual void ModifyAudioConfigs(
|
|
|
|
|
AudioSendStream::Config* send_config,
|
|
|
|
|
std::vector<AudioReceiveStream::Config>* receive_configs);
|
|
|
|
|
virtual void OnAudioStreamsCreated(
|
|
|
|
|
AudioSendStream* send_stream,
|
|
|
|
|
const std::vector<AudioReceiveStream*>& receive_streams);
|
|
|
|
|
|
2016-11-15 07:10:52 -08:00
|
|
|
virtual void ModifyFlexfecConfigs(
|
|
|
|
|
std::vector<FlexfecReceiveStream::Config>* receive_configs);
|
|
|
|
|
virtual void OnFlexfecStreamsCreated(
|
|
|
|
|
const std::vector<FlexfecReceiveStream*>& receive_streams);
|
|
|
|
|
|
2014-06-27 08:47:52 +00:00
|
|
|
virtual void OnFrameGeneratorCapturerCreated(
|
|
|
|
|
FrameGeneratorCapturer* frame_generator_capturer);
|
2016-10-07 11:53:05 -07:00
|
|
|
|
2017-09-14 14:46:47 +02:00
|
|
|
virtual void OnStreamsStopped();
|
2014-06-27 08:47:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SendTest : public BaseTest {
|
|
|
|
|
public:
|
2018-07-13 13:19:42 +02:00
|
|
|
explicit SendTest(int timeout_ms);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
bool ShouldCreateReceivers() const override;
|
2014-06-27 08:47:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class EndToEndTest : public BaseTest {
|
|
|
|
|
public:
|
2017-03-21 03:24:27 -07:00
|
|
|
EndToEndTest();
|
2018-07-13 13:19:42 +02:00
|
|
|
explicit EndToEndTest(int timeout_ms);
|
2014-06-27 08:47:52 +00:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
bool ShouldCreateReceivers() const override;
|
2014-06-27 08:47:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // TEST_CALL_TEST_H_
|