summaryrefslogtreecommitdiff
path: root/chromium/third_party/webrtc/video/video_quality_test.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-12 14:07:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 10:29:26 +0000
commitec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch)
tree25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/third_party/webrtc/video/video_quality_test.cc
parentbb09965444b5bb20b096a291445170876225268d (diff)
downloadqtwebengine-chromium-ec02ee4181c49b61fce1c8fb99292dbb8139cc90.tar.gz
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/third_party/webrtc/video/video_quality_test.cc')
-rw-r--r--chromium/third_party/webrtc/video/video_quality_test.cc285
1 files changed, 241 insertions, 44 deletions
diff --git a/chromium/third_party/webrtc/video/video_quality_test.cc b/chromium/third_party/webrtc/video/video_quality_test.cc
index affadc0a765..0baf42c1884 100644
--- a/chromium/third_party/webrtc/video/video_quality_test.cc
+++ b/chromium/third_party/webrtc/video/video_quality_test.cc
@@ -13,6 +13,7 @@
#include <algorithm>
#include <deque>
#include <map>
+#include <set>
#include <sstream>
#include <string>
#include <vector>
@@ -21,6 +22,7 @@
#include "webrtc/base/cpu_time.h"
#include "webrtc/base/event.h"
#include "webrtc/base/format_macros.h"
+#include "webrtc/base/memory_usage.h"
#include "webrtc/base/optional.h"
#include "webrtc/base/platform_file.h"
#include "webrtc/base/timeutils.h"
@@ -33,6 +35,7 @@
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
+#include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h"
#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
#include "webrtc/system_wrappers/include/cpu_info.h"
#include "webrtc/system_wrappers/include/field_trial.h"
@@ -51,11 +54,14 @@ constexpr int kSendStatsPollingIntervalMs = 1000;
constexpr int kPayloadTypeH264 = 122;
constexpr int kPayloadTypeVP8 = 123;
constexpr int kPayloadTypeVP9 = 124;
+
constexpr size_t kMaxComparisons = 10;
constexpr char kSyncGroup[] = "av_sync";
constexpr int kOpusMinBitrateBps = 6000;
constexpr int kOpusBitrateFbBps = 32000;
constexpr int kFramesSentInQuickTest = 1;
+constexpr uint32_t kThumbnailSendSsrcStart = 0xE0000;
+constexpr uint32_t kThumbnailRtxSsrcStart = 0xF0000;
struct VoiceEngineState {
VoiceEngineState()
@@ -138,8 +144,7 @@ class VideoAnalyzer : public PacketReceiver,
const std::string& graph_title,
uint32_t ssrc_to_analyze,
uint32_t rtx_ssrc_to_analyze,
- uint32_t selected_stream_width,
- uint32_t selected_stream_height,
+ size_t selected_stream,
int selected_sl,
int selected_tl,
bool is_quick_test_enabled)
@@ -153,8 +158,7 @@ class VideoAnalyzer : public PacketReceiver,
graph_title_(graph_title),
ssrc_to_analyze_(ssrc_to_analyze),
rtx_ssrc_to_analyze_(rtx_ssrc_to_analyze),
- selected_stream_width_(selected_stream_width),
- selected_stream_height_(selected_stream_height),
+ selected_stream_(selected_stream),
selected_sl_(selected_sl),
selected_tl_(selected_tl),
pre_encode_proxy_(this),
@@ -283,8 +287,7 @@ class VideoAnalyzer : public PacketReceiver,
void PostEncodeFrameCallback(const EncodedFrame& encoded_frame) {
rtc::CritScope lock(&crit_);
if (!first_sent_timestamp_ &&
- encoded_frame.encoded_width_ == selected_stream_width_ &&
- encoded_frame.encoded_height_ == selected_stream_height_) {
+ encoded_frame.stream_id_ == selected_stream_) {
first_sent_timestamp_ = rtc::Optional<uint32_t>(encoded_frame.timestamp_);
}
}
@@ -654,6 +657,8 @@ class VideoAnalyzer : public PacketReceiver,
if (receive_stats.max_decode_ms > 0)
decode_time_max_ms_.AddSample(receive_stats.max_decode_ms);
}
+
+ memory_usage_.AddSample(rtc::GetProcessResidentSizeBytes());
}
}
@@ -744,28 +749,26 @@ class VideoAnalyzer : public PacketReceiver,
PrintResult("receiver_time", receiver_time_, " ms");
PrintResult("total_delay_incl_network", end_to_end_, " ms");
PrintResult("time_between_rendered_frames", rendered_delta_, " ms");
- PrintResult("encoded_frame_size", encoded_frame_size_, " bytes");
PrintResult("encode_frame_rate", encode_frame_rate_, " fps");
PrintResult("encode_time", encode_time_ms_, " ms");
- PrintResult("encode_usage_percent", encode_usage_percent_, " percent");
PrintResult("media_bitrate", media_bitrate_bps_, " bps");
- printf("RESULT actual_bitrate: %s = %.6lf bps\n", test_label_.c_str(),
- GetAverageMediaBitrateBps());
-
if (receive_stream_ != nullptr) {
PrintResult("decode_time", decode_time_ms_, " ms");
- PrintResult("decode_time_max", decode_time_max_ms_, " ms");
}
printf("RESULT dropped_frames: %s = %d frames\n", test_label_.c_str(),
dropped_frames_);
- printf("RESULT dropped_frames_before_first_encode: %s = %d frames\n",
- test_label_.c_str(), dropped_frames_before_first_encode_);
- printf("RESULT dropped_frames_before_rendering: %s = %d frames\n",
- test_label_.c_str(), dropped_frames_before_rendering_);
printf("RESULT cpu_usage: %s = %lf %%\n", test_label_.c_str(),
GetCpuUsagePercent());
+
+#if defined(WEBRTC_WIN)
+ // On Linux and Mac in Resident Set some unused pages may be counted.
+ // Therefore this metric will depend on order in which tests are run and
+ // will be flaky.
+ PrintResult("memory_usage", memory_usage_, " bytes");
+#endif
+
// Disable quality check for quick test, as quality checks may fail
// because too few samples were collected.
if (!is_quick_test_enabled_) {
@@ -946,8 +949,7 @@ class VideoAnalyzer : public PacketReceiver,
const std::string graph_title_;
const uint32_t ssrc_to_analyze_;
const uint32_t rtx_ssrc_to_analyze_;
- const uint32_t selected_stream_width_;
- const uint32_t selected_stream_height_;
+ const size_t selected_stream_;
const int selected_sl_;
const int selected_tl_;
PreEncodeProxy pre_encode_proxy_;
@@ -967,6 +969,8 @@ class VideoAnalyzer : public PacketReceiver,
test::Statistics decode_time_ms_ GUARDED_BY(comparison_lock_);
test::Statistics decode_time_max_ms_ GUARDED_BY(comparison_lock_);
test::Statistics media_bitrate_bps_ GUARDED_BY(comparison_lock_);
+ test::Statistics memory_usage_ GUARDED_BY(comparison_lock_);
+
const int frames_to_process_;
int frames_recorded_;
@@ -1005,19 +1009,52 @@ class VideoAnalyzer : public PacketReceiver,
rtc::Event done_;
};
+class Vp8EncoderFactory : public VideoEncoderFactory {
+ public:
+ Vp8EncoderFactory() = default;
+ ~Vp8EncoderFactory() override { RTC_CHECK(live_encoders_.empty()); }
+
+ VideoEncoder* Create() override {
+ VideoEncoder* encoder = VP8Encoder::Create();
+ live_encoders_.insert(encoder);
+ return encoder;
+ }
+
+ void Destroy(VideoEncoder* encoder) override {
+ auto it = live_encoders_.find(encoder);
+ RTC_CHECK(it != live_encoders_.end());
+ live_encoders_.erase(it);
+ delete encoder;
+ }
+
+ std::set<VideoEncoder*> live_encoders_;
+};
+
VideoQualityTest::VideoQualityTest()
- : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {}
+ : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {
+ payload_type_map_ = test::CallTest::payload_type_map_;
+ RTC_DCHECK(payload_type_map_.find(kPayloadTypeH264) ==
+ payload_type_map_.end());
+ RTC_DCHECK(payload_type_map_.find(kPayloadTypeVP8) ==
+ payload_type_map_.end());
+ RTC_DCHECK(payload_type_map_.find(kPayloadTypeVP9) ==
+ payload_type_map_.end());
+ payload_type_map_[kPayloadTypeH264] = webrtc::MediaType::VIDEO;
+ payload_type_map_[kPayloadTypeVP8] = webrtc::MediaType::VIDEO;
+ payload_type_map_[kPayloadTypeVP9] = webrtc::MediaType::VIDEO;
+}
VideoQualityTest::Params::Params()
: call({false, Call::Config::BitrateConfig()}),
video({false, 640, 480, 30, 50, 800, 800, false, "VP8", 1, -1, 0, false,
false, "", ""}),
- audio({false, false}),
+ audio({false, false, false}),
screenshare({false, 10, 0}),
analyzer({"", 0.0, 0.0, 0, "", ""}),
pipe(),
logs(false),
- ss({std::vector<VideoStream>(), 0, 0, -1, std::vector<SpatialLayer>()}) {}
+ ss({std::vector<VideoStream>(), 0, 0, -1, std::vector<SpatialLayer>()}),
+ num_thumbnails(0) {}
VideoQualityTest::Params::~Params() = default;
@@ -1069,7 +1106,7 @@ void VideoQualityTest::CheckParams() {
RTC_CHECK_GE(stream.min_bitrate_bps, 0);
RTC_CHECK_GE(stream.target_bitrate_bps, stream.min_bitrate_bps);
RTC_CHECK_GE(stream.max_bitrate_bps, stream.target_bitrate_bps);
- RTC_CHECK_EQ(stream.temporal_layer_thresholds_bps.size(),
+ RTC_CHECK_LE(stream.temporal_layer_thresholds_bps.size(),
params_.video.num_temporal_layers - 1);
}
// TODO(ivica): Should we check if the sum of all streams/layers is equal to
@@ -1085,6 +1122,13 @@ void VideoQualityTest::CheckParams() {
} else if (params_.video.codec == "VP9") {
RTC_CHECK_EQ(params_.ss.streams.size(), 1);
}
+ RTC_CHECK_GE(params_.num_thumbnails, 0);
+ if (params_.num_thumbnails > 0) {
+ RTC_CHECK_EQ(params_.ss.num_spatial_layers, 1);
+ RTC_CHECK_EQ(params_.ss.streams.size(), 3);
+ RTC_CHECK_EQ(params_.video.num_temporal_layers, 3);
+ RTC_CHECK_EQ(params_.video.codec, "VP8");
+ }
}
// Static.
@@ -1125,8 +1169,26 @@ VideoStream VideoQualityTest::DefaultVideoStream(const Params& params) {
stream.target_bitrate_bps = params.video.target_bitrate_bps;
stream.max_bitrate_bps = params.video.max_bitrate_bps;
stream.max_qp = 52;
- if (params.video.num_temporal_layers == 2)
+ // TODO(sprang): Can we make this less of a hack?
+ if (params.video.num_temporal_layers == 2) {
stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps);
+ } else if (params.video.num_temporal_layers == 3) {
+ stream.temporal_layer_thresholds_bps.push_back(stream.max_bitrate_bps / 4);
+ stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps);
+ }
+ return stream;
+}
+
+// Static.
+VideoStream VideoQualityTest::DefaultThumbnailStream() {
+ VideoStream stream;
+ stream.width = 320;
+ stream.height = 180;
+ stream.max_framerate = 7;
+ stream.min_bitrate_bps = 7500;
+ stream.target_bitrate_bps = 37500;
+ stream.max_bitrate_bps = 50000;
+ stream.max_qp = 52;
return stream;
}
@@ -1205,7 +1267,15 @@ void VideoQualityTest::SetupVideo(Transport* send_transport,
video_encoder_.reset(H264Encoder::Create(cricket::VideoCodec("H264")));
payload_type = kPayloadTypeH264;
} else if (params_.video.codec == "VP8") {
- video_encoder_.reset(VP8Encoder::Create());
+ if (params_.screenshare.enabled && params_.ss.streams.size() > 1) {
+ // Simulcast screenshare needs a simulcast encoder adapter to work, since
+ // encoders usually can't natively do simulcast with different frame rates
+ // for the different layers.
+ video_encoder_.reset(
+ new SimulcastEncoderAdapter(new Vp8EncoderFactory()));
+ } else {
+ video_encoder_.reset(VP8Encoder::Create());
+ }
payload_type = kPayloadTypeVP8;
} else if (params_.video.codec == "VP9") {
video_encoder_.reset(VP9Encoder::Create());
@@ -1258,6 +1328,16 @@ void VideoQualityTest::SetupVideo(Transport* send_transport,
kSendRtxPayloadType;
video_receive_configs_[i].rtp.transport_cc = params_.call.send_side_bwe;
video_receive_configs_[i].rtp.remb = !params_.call.send_side_bwe;
+ // Force fake decoders on non-selected simulcast streams.
+ if (i != params_.ss.selected_stream) {
+ VideoReceiveStream::Decoder decoder;
+ decoder.decoder = new test::FakeDecoder();
+ decoder.payload_type = video_send_config_.encoder_settings.payload_type;
+ decoder.payload_name = video_send_config_.encoder_settings.payload_name;
+ video_receive_configs_[i].decoders.clear();
+ allocated_decoders_.emplace_back(decoder.decoder);
+ video_receive_configs_[i].decoders.push_back(decoder);
+ }
}
if (params_.video.flexfec) {
@@ -1304,6 +1384,92 @@ void VideoQualityTest::SetupVideo(Transport* send_transport,
}
}
+void VideoQualityTest::SetupThumbnails(Transport* send_transport,
+ Transport* recv_transport) {
+ for (int i = 0; i < params_.num_thumbnails; ++i) {
+ thumbnail_encoders_.emplace_back(VP8Encoder::Create());
+
+ // Thumbnails will be send in the other way: from receiver_call to
+ // sender_call.
+ VideoSendStream::Config thumbnail_send_config(recv_transport);
+ thumbnail_send_config.rtp.ssrcs.push_back(kThumbnailSendSsrcStart + i);
+ thumbnail_send_config.encoder_settings.encoder =
+ thumbnail_encoders_.back().get();
+ thumbnail_send_config.encoder_settings.payload_name = params_.video.codec;
+ thumbnail_send_config.encoder_settings.payload_type = kPayloadTypeVP8;
+ thumbnail_send_config.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
+ thumbnail_send_config.rtp.rtx.payload_type = kSendRtxPayloadType;
+ thumbnail_send_config.rtp.rtx.ssrcs.push_back(kThumbnailRtxSsrcStart + i);
+ thumbnail_send_config.rtp.extensions.clear();
+ if (params_.call.send_side_bwe) {
+ thumbnail_send_config.rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kTransportSequenceNumberUri,
+ test::kTransportSequenceNumberExtensionId));
+ } else {
+ thumbnail_send_config.rtp.extensions.push_back(RtpExtension(
+ RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId));
+ }
+
+ VideoEncoderConfig thumbnail_encoder_config;
+ thumbnail_encoder_config.min_transmit_bitrate_bps = 7500;
+ thumbnail_send_config.suspend_below_min_bitrate =
+ params_.video.suspend_below_min_bitrate;
+ thumbnail_encoder_config.number_of_streams = 1;
+ thumbnail_encoder_config.max_bitrate_bps = 50000;
+ thumbnail_encoder_config.video_stream_factory =
+ new rtc::RefCountedObject<VideoStreamFactory>(
+ std::vector<webrtc::VideoStream>{DefaultThumbnailStream()});
+ thumbnail_encoder_config.spatial_layers = params_.ss.spatial_layers;
+
+ VideoReceiveStream::Config thumbnail_receive_config(send_transport);
+ thumbnail_receive_config.rtp.remb = false;
+ thumbnail_receive_config.rtp.transport_cc = true;
+ thumbnail_receive_config.rtp.local_ssrc = kReceiverLocalVideoSsrc;
+ for (const RtpExtension& extension : thumbnail_send_config.rtp.extensions)
+ thumbnail_receive_config.rtp.extensions.push_back(extension);
+ thumbnail_receive_config.renderer = &fake_renderer_;
+
+ VideoReceiveStream::Decoder decoder =
+ test::CreateMatchingDecoder(thumbnail_send_config.encoder_settings);
+ allocated_decoders_.push_back(
+ std::unique_ptr<VideoDecoder>(decoder.decoder));
+ thumbnail_receive_config.decoders.clear();
+ thumbnail_receive_config.decoders.push_back(decoder);
+ thumbnail_receive_config.rtp.remote_ssrc =
+ thumbnail_send_config.rtp.ssrcs[0];
+
+ thumbnail_receive_config.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
+ thumbnail_receive_config.rtp.rtx_ssrc = kThumbnailRtxSsrcStart + i;
+ thumbnail_receive_config.rtp.rtx_payload_types[kPayloadTypeVP8] =
+ kSendRtxPayloadType;
+ thumbnail_receive_config.rtp.transport_cc = params_.call.send_side_bwe;
+ thumbnail_receive_config.rtp.remb = !params_.call.send_side_bwe;
+
+ thumbnail_encoder_configs_.push_back(thumbnail_encoder_config.Copy());
+ thumbnail_send_configs_.push_back(thumbnail_send_config.Copy());
+ thumbnail_receive_configs_.push_back(thumbnail_receive_config.Copy());
+ }
+
+ for (int i = 0; i < params_.num_thumbnails; ++i) {
+ thumbnail_send_streams_.push_back(receiver_call_->CreateVideoSendStream(
+ thumbnail_send_configs_[i].Copy(),
+ thumbnail_encoder_configs_[i].Copy()));
+ thumbnail_receive_streams_.push_back(sender_call_->CreateVideoReceiveStream(
+ thumbnail_receive_configs_[i].Copy()));
+ }
+}
+
+void VideoQualityTest::DestroyThumbnailStreams() {
+ for (VideoSendStream* thumbnail_send_stream : thumbnail_send_streams_)
+ receiver_call_->DestroyVideoSendStream(thumbnail_send_stream);
+ thumbnail_send_streams_.clear();
+ for (VideoReceiveStream* thumbnail_receive_stream :
+ thumbnail_receive_streams_)
+ sender_call_->DestroyVideoReceiveStream(thumbnail_receive_stream);
+ thumbnail_send_streams_.clear();
+ thumbnail_receive_streams_.clear();
+}
+
void VideoQualityTest::SetupScreenshareOrSVC() {
if (params_.screenshare.enabled) {
// Fill out codec settings.
@@ -1373,6 +1539,16 @@ void VideoQualityTest::SetupScreenshareOrSVC() {
}
}
+void VideoQualityTest::SetupThumbnailCapturers(size_t num_thumbnail_streams) {
+ VideoStream thumbnail = DefaultThumbnailStream();
+ for (size_t i = 0; i < num_thumbnail_streams; ++i) {
+ thumbnail_capturers_.emplace_back(test::FrameGeneratorCapturer::Create(
+ static_cast<int>(thumbnail.width), static_cast<int>(thumbnail.height),
+ thumbnail.max_framerate, clock_));
+ RTC_DCHECK(thumbnail_capturers_.back());
+ }
+}
+
void VideoQualityTest::CreateCapturer() {
if (params_.screenshare.enabled) {
test::FrameGeneratorCapturer* frame_generator_capturer =
@@ -1420,31 +1596,24 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
<< "!";
}
- webrtc::RtcEventLogNullImpl event_log;
- Call::Config call_config(&event_log_);
+ Call::Config call_config(event_log_.get());
call_config.bitrate_config = params.call.call_bitrate_config;
CreateCalls(call_config, call_config);
test::LayerFilteringTransport send_transport(
params_.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9,
- params_.video.selected_tl, params_.ss.selected_sl);
- test::DirectTransport recv_transport(params_.pipe, receiver_call_.get());
+ params_.video.selected_tl, params_.ss.selected_sl, payload_type_map_);
+
+ test::DirectTransport recv_transport(params_.pipe, receiver_call_.get(),
+ payload_type_map_);
std::string graph_title = params_.analyzer.graph_title;
if (graph_title.empty())
graph_title = VideoQualityTest::GenerateGraphTitle();
- // In the case of different resolutions, the functions calculating PSNR and
- // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer
- // aborts if the average psnr/ssim are below the given threshold, which is
- // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary
- // abort.
- VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream];
-
bool is_quick_test_enabled = field_trial::IsEnabled("WebRTC-QuickPerfTest");
VideoAnalyzer analyzer(
&send_transport, params_.analyzer.test_label,
-
params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold,
is_quick_test_enabled
? kFramesSentInQuickTest
@@ -1452,14 +1621,14 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
graph_data_output_file, graph_title,
kVideoSendSsrcs[params_.ss.selected_stream],
kSendRtxSsrcs[params_.ss.selected_stream],
- static_cast<uint32_t>(selected_stream.width),
- static_cast<uint32_t>(selected_stream.height), params.ss.selected_sl,
+ static_cast<size_t>(params_.ss.selected_stream), params.ss.selected_sl,
params_.video.selected_tl, is_quick_test_enabled);
analyzer.SetReceiver(receiver_call_->Receiver());
send_transport.SetReceiver(&analyzer);
recv_transport.SetReceiver(sender_call_->Receiver());
SetupVideo(&analyzer, &recv_transport);
+ SetupThumbnails(&analyzer, &recv_transport);
video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer;
video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy();
RTC_DCHECK(!video_send_config_.post_encode_callback);
@@ -1476,33 +1645,60 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
video_send_stream_->SetSource(analyzer.OutputInterface(),
degradation_preference_);
+ SetupThumbnailCapturers(params_.num_thumbnails);
+ for (size_t i = 0; i < thumbnail_send_streams_.size(); ++i) {
+ thumbnail_send_streams_[i]->SetSource(thumbnail_capturers_[i].get(),
+ degradation_preference_);
+ }
+
CreateCapturer();
+
rtc::VideoSinkWants wants;
video_capturer_->AddOrUpdateSink(analyzer.InputInterface(), wants);
StartEncodedFrameLogs(video_send_stream_);
StartEncodedFrameLogs(video_receive_streams_[0]);
video_send_stream_->Start();
+ for (VideoSendStream* thumbnail_send_stream : thumbnail_send_streams_)
+ thumbnail_send_stream->Start();
for (VideoReceiveStream* receive_stream : video_receive_streams_)
receive_stream->Start();
for (FlexfecReceiveStream* receive_stream : flexfec_receive_streams_)
receive_stream->Start();
+ for (VideoReceiveStream* thumbnail_receive_stream :
+ thumbnail_receive_streams_)
+ thumbnail_receive_stream->Start();
+
analyzer.StartMeasuringCpuProcessTime();
+
video_capturer_->Start();
+ for (std::unique_ptr<test::VideoCapturer>& video_caputurer :
+ thumbnail_capturers_) {
+ video_caputurer->Start();
+ }
analyzer.Wait();
send_transport.StopSending();
recv_transport.StopSending();
+ for (std::unique_ptr<test::VideoCapturer>& video_caputurer :
+ thumbnail_capturers_)
+ video_caputurer->Stop();
video_capturer_->Stop();
+ for (VideoReceiveStream* thumbnail_receive_stream :
+ thumbnail_receive_streams_)
+ thumbnail_receive_stream->Stop();
for (FlexfecReceiveStream* receive_stream : flexfec_receive_streams_)
receive_stream->Stop();
for (VideoReceiveStream* receive_stream : video_receive_streams_)
receive_stream->Stop();
+ for (VideoSendStream* thumbnail_send_stream : thumbnail_send_streams_)
+ thumbnail_send_stream->Stop();
video_send_stream_->Stop();
DestroyStreams();
+ DestroyThumbnailStreams();
if (graph_data_output_file)
fclose(graph_data_output_file);
@@ -1528,8 +1724,8 @@ void VideoQualityTest::SetupAudio(int send_channel_id,
audio_send_config_.max_bitrate_bps = kOpusBitrateFbBps;
}
audio_send_config_.send_codec_spec.codec_inst =
- CodecInst{120, "OPUS", 48000, 960, 2, 64000};
-
+ CodecInst{kAudioSendPayloadType, "OPUS", 48000, 960, 2, 64000};
+ audio_send_config_.send_codec_spec.enable_opus_dtx = params_.audio.dtx;
audio_send_stream_ = call->CreateAudioSendStream(audio_send_config_);
AudioReceiveStream::Config audio_config;
@@ -1540,6 +1736,7 @@ void VideoQualityTest::SetupAudio(int send_channel_id,
audio_config.rtp.transport_cc = params_.call.send_side_bwe;
audio_config.rtp.extensions = audio_send_config_.rtp.extensions;
audio_config.decoder_factory = decoder_factory_;
+ audio_config.decoder_map = {{kAudioSendPayloadType, {"OPUS", 48000, 2}}};
if (params_.video.enabled && params_.audio.sync_video)
audio_config.sync_group = kSyncGroup;
@@ -1552,8 +1749,7 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
// TODO(ivica): Remove bitrate_config and use the default Call::Config(), to
// match the full stack tests.
- webrtc::RtcEventLogNullImpl event_log;
- Call::Config call_config(&event_log_);
+ Call::Config call_config(event_log_.get());
call_config.bitrate_config = params_.call.call_bitrate_config;
::VoiceEngineState voe;
@@ -1571,7 +1767,8 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
// calls.
test::LayerFilteringTransport transport(
params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9,
- params.video.selected_tl, params_.ss.selected_sl);
+ params.video.selected_tl, params_.ss.selected_sl, payload_type_map_);
+
// TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at
// least share as much code as possible. That way this test would also match
// the full stack tests better.
@@ -1695,6 +1892,7 @@ void VideoQualityTest::StartEncodedFrameLogs(VideoSendStream* stream) {
10000000);
}
}
+
void VideoQualityTest::StartEncodedFrameLogs(VideoReceiveStream* stream) {
if (!params_.video.encoded_frame_base_path.empty()) {
std::ostringstream str;
@@ -1705,5 +1903,4 @@ void VideoQualityTest::StartEncodedFrameLogs(VideoReceiveStream* stream) {
10000000);
}
}
-
} // namespace webrtc