2015-09-17 05:30:24 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2015 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 VIDEO_VIDEO_QUALITY_TEST_H_
|
|
|
|
|
#define VIDEO_VIDEO_QUALITY_TEST_H_
|
2015-09-17 05:30:24 -07:00
|
|
|
|
2017-04-10 16:57:57 -07:00
|
|
|
#include <map>
|
2016-03-01 11:52:33 -08:00
|
|
|
#include <memory>
|
2015-09-17 05:30:24 -07:00
|
|
|
#include <string>
|
2015-12-09 07:07:59 -08:00
|
|
|
#include <vector>
|
2015-09-17 05:30:24 -07:00
|
|
|
|
2018-06-21 16:58:01 +02:00
|
|
|
#include "api/fec_controller.h"
|
2019-06-26 15:49:47 +02:00
|
|
|
#include "api/rtc_event_log/rtc_event_log_factory.h"
|
2019-09-30 04:16:28 +02:00
|
|
|
#include "api/task_queue/task_queue_base.h"
|
2019-04-01 09:16:12 +02:00
|
|
|
#include "api/task_queue/task_queue_factory.h"
|
2018-06-21 16:58:01 +02:00
|
|
|
#include "api/test/video_quality_test_fixture.h"
|
2018-11-08 10:02:56 -08:00
|
|
|
#include "api/video/video_bitrate_allocator_factory.h"
|
2018-06-21 16:58:01 +02:00
|
|
|
#include "call/fake_network_pipe.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "media/engine/internal_decoder_factory.h"
|
|
|
|
|
#include "media/engine/internal_encoder_factory.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/call_test.h"
|
|
|
|
|
#include "test/frame_generator.h"
|
2017-11-13 13:03:52 +01:00
|
|
|
#include "test/layer_filtering_transport.h"
|
2018-10-10 10:58:52 +02:00
|
|
|
#include "video/video_analyzer.h"
|
2018-08-27 16:13:37 +02:00
|
|
|
#ifdef WEBRTC_WIN
|
|
|
|
|
#include "modules/audio_device/win/core_audio_utility_win.h"
|
|
|
|
|
#endif
|
2015-09-17 05:30:24 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2018-06-21 16:58:01 +02:00
|
|
|
class VideoQualityTest : public test::CallTest,
|
|
|
|
|
public VideoQualityTestFixtureInterface {
|
2015-09-17 05:30:24 -07:00
|
|
|
public:
|
Revert "Revert "Enables PeerConnectionFactory using external fec controller""
This reverts commit 00733015fafbbc61ddc12dfdc88b21a9fcd9d122.
Reason for revert: The reason for a downstream test failure on the original commit and a workaround has been found. Solution is to keep a PeerConnectionFactory constructor implementation as the same as before.
Original change's description:
> Revert "Enables PeerConnectionFactory using external fec controller"
>
> This reverts commit 4f07bdb25567d8ef528311e0b50a62c61d543fc3.
>
> Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java
>
> Original change's description:
> > Enables PeerConnectionFactory using external fec controller
> >
> > Bug: webrtc:8799
> > Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> > Reviewed-on: https://webrtc-review.googlesource.com/43961
> > Commit-Queue: Ying Wang <yinwa@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22038}
>
> TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org
>
> Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8799
> Reviewed-on: https://webrtc-review.googlesource.com/54080
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22040}
TBR=deadbeef@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org
Bug: webrtc:8799
Change-Id: If9f3292bfcc739782967530c49f006d0abbc38a8
Reviewed-on: https://webrtc-review.googlesource.com/55400
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22100}
2018-02-20 12:50:27 +01:00
|
|
|
explicit VideoQualityTest(
|
2018-08-29 09:59:23 +02:00
|
|
|
std::unique_ptr<InjectionComponents> injection_components);
|
2018-06-21 16:58:01 +02:00
|
|
|
|
|
|
|
|
void RunWithAnalyzer(const Params& params) override;
|
|
|
|
|
void RunWithRenderers(const Params& params) override;
|
|
|
|
|
|
|
|
|
|
const std::map<uint8_t, webrtc::MediaType>& payload_type_map() override {
|
|
|
|
|
return payload_type_map_;
|
|
|
|
|
}
|
2015-09-17 05:30:24 -07:00
|
|
|
|
2015-11-02 07:23:20 -08:00
|
|
|
static void FillScalabilitySettings(
|
|
|
|
|
Params* params,
|
2017-12-21 18:02:59 +01:00
|
|
|
size_t video_idx,
|
2015-11-02 07:23:20 -08:00
|
|
|
const std::vector<std::string>& stream_descriptors,
|
2017-06-21 09:00:17 -07:00
|
|
|
int num_streams,
|
2015-11-02 07:23:20 -08:00
|
|
|
size_t selected_stream,
|
|
|
|
|
int num_spatial_layers,
|
|
|
|
|
int selected_sl,
|
2018-05-15 09:12:05 +02:00
|
|
|
InterLayerPredMode inter_layer_pred,
|
2015-11-02 07:23:20 -08:00
|
|
|
const std::vector<std::string>& sl_descriptors);
|
|
|
|
|
|
2018-06-21 16:58:01 +02:00
|
|
|
// Helper static methods.
|
|
|
|
|
static VideoStream DefaultVideoStream(const Params& params, size_t video_idx);
|
|
|
|
|
static VideoStream DefaultThumbnailStream();
|
|
|
|
|
static std::vector<int> ParseCSV(const std::string& str);
|
|
|
|
|
|
2015-09-17 05:30:24 -07:00
|
|
|
protected:
|
2017-04-10 16:57:57 -07:00
|
|
|
std::map<uint8_t, webrtc::MediaType> payload_type_map_;
|
|
|
|
|
|
2015-09-17 05:30:24 -07:00
|
|
|
// No-op implementation to be able to instantiate this class from non-TEST_F
|
|
|
|
|
// locations.
|
|
|
|
|
void TestBody() override;
|
|
|
|
|
|
2015-11-02 07:23:20 -08:00
|
|
|
// Helper methods accessing only params_.
|
|
|
|
|
std::string GenerateGraphTitle() const;
|
2018-08-29 09:59:23 +02:00
|
|
|
void CheckParamsAndInjectionComponents();
|
2015-11-02 07:23:20 -08:00
|
|
|
|
|
|
|
|
// Helper methods for setting up the call.
|
2017-12-21 18:02:59 +01:00
|
|
|
void CreateCapturers();
|
|
|
|
|
std::unique_ptr<test::FrameGenerator> CreateFrameGenerator(size_t video_idx);
|
2017-03-07 04:21:04 -08:00
|
|
|
void SetupThumbnailCapturers(size_t num_thumbnail_streams);
|
2018-09-28 09:07:24 +02:00
|
|
|
std::unique_ptr<VideoDecoder> CreateVideoDecoder(
|
|
|
|
|
const SdpVideoFormat& format);
|
2018-10-10 10:58:52 +02:00
|
|
|
std::unique_ptr<VideoEncoder> CreateVideoEncoder(const SdpVideoFormat& format,
|
|
|
|
|
VideoAnalyzer* analyzer);
|
2016-11-01 05:59:29 -07:00
|
|
|
void SetupVideo(Transport* send_transport, Transport* recv_transport);
|
2017-03-07 04:21:04 -08:00
|
|
|
void SetupThumbnails(Transport* send_transport, Transport* recv_transport);
|
2018-08-07 17:07:24 +02:00
|
|
|
void StartAudioStreams();
|
2018-08-07 14:10:56 +02:00
|
|
|
void StartThumbnails();
|
|
|
|
|
void StopThumbnails();
|
2017-03-07 04:21:04 -08:00
|
|
|
void DestroyThumbnailStreams();
|
2018-08-27 16:13:37 +02:00
|
|
|
// Helper method for creating a real ADM (using hardware) for all platforms.
|
|
|
|
|
rtc::scoped_refptr<AudioDeviceModule> CreateAudioDevice();
|
2018-08-07 14:10:56 +02:00
|
|
|
void InitializeAudioDevice(Call::Config* send_call_config,
|
2018-08-27 16:13:37 +02:00
|
|
|
Call::Config* recv_call_config,
|
|
|
|
|
bool use_real_adm);
|
2018-07-13 13:29:03 +02:00
|
|
|
void SetupAudio(Transport* transport);
|
2015-09-17 05:30:24 -07:00
|
|
|
|
2016-09-28 06:19:48 -07:00
|
|
|
void StartEncodedFrameLogs(VideoReceiveStream* stream);
|
|
|
|
|
|
2017-11-13 13:03:52 +01:00
|
|
|
virtual std::unique_ptr<test::LayerFilteringTransport> CreateSendTransport();
|
|
|
|
|
virtual std::unique_ptr<test::DirectTransport> CreateReceiveTransport();
|
|
|
|
|
|
2018-12-18 16:08:11 +01:00
|
|
|
std::vector<std::unique_ptr<rtc::VideoSourceInterface<VideoFrame>>>
|
|
|
|
|
thumbnail_capturers_;
|
2018-07-11 15:00:41 +02:00
|
|
|
Clock* const clock_;
|
2019-04-01 09:16:12 +02:00
|
|
|
const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
2019-04-11 15:18:18 +02:00
|
|
|
RtcEventLogFactory rtc_event_log_factory_;
|
2017-03-09 09:23:30 -08:00
|
|
|
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory video_decoder_factory_;
|
2019-06-12 09:47:14 -05:00
|
|
|
std::unique_ptr<VideoDecoderFactory> decoder_factory_;
|
2018-07-11 15:00:41 +02:00
|
|
|
test::FunctionVideoEncoderFactory video_encoder_factory_;
|
2018-10-10 10:58:52 +02:00
|
|
|
test::FunctionVideoEncoderFactory video_encoder_factory_with_analyzer_;
|
2018-11-08 10:02:56 -08:00
|
|
|
std::unique_ptr<VideoBitrateAllocatorFactory>
|
|
|
|
|
video_bitrate_allocator_factory_;
|
2019-06-12 09:47:14 -05:00
|
|
|
std::unique_ptr<VideoEncoderFactory> encoder_factory_;
|
2017-03-07 04:21:04 -08:00
|
|
|
std::vector<VideoSendStream::Config> thumbnail_send_configs_;
|
|
|
|
|
std::vector<VideoEncoderConfig> thumbnail_encoder_configs_;
|
|
|
|
|
std::vector<VideoSendStream*> thumbnail_send_streams_;
|
|
|
|
|
std::vector<VideoReceiveStream::Config> thumbnail_receive_configs_;
|
|
|
|
|
std::vector<VideoReceiveStream*> thumbnail_receive_streams_;
|
|
|
|
|
|
2016-09-28 06:19:48 -07:00
|
|
|
int receive_logs_;
|
|
|
|
|
int send_logs_;
|
|
|
|
|
|
2015-11-02 07:23:20 -08:00
|
|
|
Params params_;
|
2018-08-29 09:59:23 +02:00
|
|
|
std::unique_ptr<InjectionComponents> injection_components_;
|
2017-12-05 13:19:45 +01:00
|
|
|
|
2018-10-10 10:58:52 +02:00
|
|
|
// Set non-null when running with analyzer.
|
|
|
|
|
std::unique_ptr<VideoAnalyzer> analyzer_;
|
|
|
|
|
|
2018-07-13 13:29:03 +02:00
|
|
|
// Note: not same as similarly named member in CallTest. This is the number of
|
|
|
|
|
// separate send streams, the one in CallTest is the number of substreams for
|
|
|
|
|
// a single send stream.
|
2017-12-21 18:02:59 +01:00
|
|
|
size_t num_video_streams_;
|
2018-08-27 16:13:37 +02:00
|
|
|
|
|
|
|
|
#ifdef WEBRTC_WIN
|
|
|
|
|
// Windows Core Audio based ADM needs to run on a COM initialized thread.
|
|
|
|
|
// Only referenced in combination with --audio --use_real_adm flags.
|
|
|
|
|
std::unique_ptr<webrtc_win::ScopedCOMInitializer> com_initializer_;
|
|
|
|
|
#endif
|
2015-09-17 05:30:24 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // VIDEO_VIDEO_QUALITY_TEST_H_
|