Remove pc level test framework redundant code.
After the migration to passing frame video source implementation directly, part of the peer connection framework code became redundant. Removing screen_share_config and capturing_device_index from the VideoConfig is to be done in later reviews. Bug: webrtc:11534 Change-Id: I7a8ea85d26d00fb5bfe7ec0d2facef9c44a0f749 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174541 Commit-Queue: Andrey Logvin <landrey@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31178}
This commit is contained in:
committed by
Commit Bot
parent
d6b10943c7
commit
1e83d34fc1
@ -274,7 +274,6 @@ if (rtc_include_tests) {
|
||||
"../..:platform_video_capturer",
|
||||
"../..:video_test_common",
|
||||
"../../../api:create_frame_generator",
|
||||
"../../../api:create_peer_connection_quality_test_frame_generator",
|
||||
"../../../api:frame_generator_api",
|
||||
"../../../api:peer_connection_quality_test_fixture_api",
|
||||
"../../../api/video:video_frame",
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
#include <utility>
|
||||
|
||||
#include "api/test/create_frame_generator.h"
|
||||
#include "api/test/create_peer_connection_quality_test_frame_generator.h"
|
||||
#include "test/frame_generator_capturer.h"
|
||||
#include "test/platform_video_capturer.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
@ -109,37 +108,10 @@ std::unique_ptr<test::TestVideoCapturer> MediaHelper::CreateVideoCapturer(
|
||||
return capturer;
|
||||
}
|
||||
|
||||
std::unique_ptr<test::FrameGeneratorInterface> frame_generator = nullptr;
|
||||
if (generator) {
|
||||
frame_generator = std::move(generator);
|
||||
} else if (video_config.generator) {
|
||||
absl::optional<test::FrameGeneratorInterface::OutputType>
|
||||
frame_generator_type = absl::nullopt;
|
||||
if (video_config.generator == VideoGeneratorType::kDefault) {
|
||||
frame_generator_type = test::FrameGeneratorInterface::OutputType::kI420;
|
||||
} else if (video_config.generator == VideoGeneratorType::kI420A) {
|
||||
frame_generator_type = test::FrameGeneratorInterface::OutputType::kI420A;
|
||||
} else if (video_config.generator == VideoGeneratorType::kI010) {
|
||||
frame_generator_type = test::FrameGeneratorInterface::OutputType::kI010;
|
||||
}
|
||||
frame_generator =
|
||||
test::CreateSquareFrameGenerator(static_cast<int>(video_config.width),
|
||||
static_cast<int>(video_config.height),
|
||||
frame_generator_type, absl::nullopt);
|
||||
} else if (video_config.input_file_name) {
|
||||
frame_generator = test::CreateFromYuvFileFrameGenerator(
|
||||
std::vector<std::string>(/*count=*/1,
|
||||
video_config.input_file_name.value()),
|
||||
video_config.width, video_config.height, /*frame_repeat_count=*/1);
|
||||
} else if (video_config.screen_share_config) {
|
||||
frame_generator = CreateScreenShareFrameGenerator(
|
||||
video_config, *video_config.screen_share_config);
|
||||
}
|
||||
RTC_CHECK(frame_generator) << "Unsupported video_config input source";
|
||||
RTC_CHECK(generator) << "No input source.";
|
||||
|
||||
auto capturer = std::make_unique<test::FrameGeneratorCapturer>(
|
||||
clock_, std::move(frame_generator), video_config.fps,
|
||||
*task_queue_factory_);
|
||||
clock_, std::move(generator), video_config.fps, *task_queue_factory_);
|
||||
capturer->SetFramePreprocessor(std::move(frame_preprocessor));
|
||||
capturer->Init();
|
||||
return capturer;
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
namespace webrtc_pc_e2e {
|
||||
namespace {
|
||||
|
||||
using AudioConfig = PeerConnectionE2EQualityTestFixture::AudioConfig;
|
||||
using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig;
|
||||
@ -25,25 +24,6 @@ using VideoGeneratorType =
|
||||
PeerConnectionE2EQualityTestFixture::VideoGeneratorType;
|
||||
using VideoCodecConfig = PeerConnectionE2EQualityTestFixture::VideoCodecConfig;
|
||||
|
||||
std::string VideoConfigSourcePresenceToString(
|
||||
const VideoConfig& video_config,
|
||||
bool has_user_provided_generator) {
|
||||
char buf[1024];
|
||||
rtc::SimpleStringBuilder builder(buf);
|
||||
builder << "video_config.generator=" << video_config.generator.has_value()
|
||||
<< "; video_config.input_file_name="
|
||||
<< video_config.input_file_name.has_value()
|
||||
<< "; video_config.screen_share_config="
|
||||
<< video_config.screen_share_config.has_value()
|
||||
<< "; video_config.capturing_device_index="
|
||||
<< video_config.capturing_device_index.has_value()
|
||||
<< "; has_user_provided_generator=" << has_user_provided_generator
|
||||
<< ";";
|
||||
return builder.str();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void SetDefaultValuesForMissingParams(
|
||||
RunParams* run_params,
|
||||
std::vector<std::unique_ptr<PeerConfigurerImpl>>* peers) {
|
||||
@ -54,15 +34,7 @@ void SetDefaultValuesForMissingParams(
|
||||
for (size_t i = 0; i < peers->size(); ++i) {
|
||||
auto* peer = peers->at(i).get();
|
||||
auto* p = peer->params();
|
||||
for (size_t j = 0; j < p->video_configs.size(); ++j) {
|
||||
VideoConfig& video_config = p->video_configs[j];
|
||||
std::unique_ptr<test::FrameGeneratorInterface>& video_generator =
|
||||
(*peer->video_generators())[j];
|
||||
if (!video_config.generator && !video_config.input_file_name &&
|
||||
!video_config.screen_share_config &&
|
||||
!video_config.capturing_device_index && !video_generator) {
|
||||
video_config.generator = VideoGeneratorType::kDefault;
|
||||
}
|
||||
for (VideoConfig& video_config : p->video_configs) {
|
||||
if (!video_config.stream_label) {
|
||||
std::string label;
|
||||
do {
|
||||
@ -107,40 +79,14 @@ void ValidateParams(
|
||||
}
|
||||
media_streams_count += p->video_configs.size();
|
||||
|
||||
// Validate that each video config has exactly one of |generator|,
|
||||
// |input_file_name| or |screen_share_config| set. Also validate that all
|
||||
// video stream labels are unique.
|
||||
for (size_t j = 0; j < p->video_configs.size(); ++j) {
|
||||
VideoConfig& video_config = p->video_configs[j];
|
||||
// Validate that all video stream labels are unique.
|
||||
for (const VideoConfig& video_config : p->video_configs) {
|
||||
RTC_CHECK(video_config.stream_label);
|
||||
bool inserted =
|
||||
video_labels.insert(video_config.stream_label.value()).second;
|
||||
RTC_CHECK(inserted) << "Duplicate video_config.stream_label="
|
||||
<< video_config.stream_label.value();
|
||||
bool user_provided_generator = false;
|
||||
int input_sources_count = 0;
|
||||
if ((*peers[i]->video_generators())[j]) {
|
||||
user_provided_generator = true;
|
||||
++input_sources_count;
|
||||
}
|
||||
if (video_config.generator)
|
||||
++input_sources_count;
|
||||
if (video_config.input_file_name)
|
||||
++input_sources_count;
|
||||
if (video_config.screen_share_config)
|
||||
++input_sources_count;
|
||||
if (video_config.capturing_device_index)
|
||||
++input_sources_count;
|
||||
|
||||
RTC_CHECK(input_sources_count == 1 ||
|
||||
(input_sources_count == 2 && user_provided_generator))
|
||||
<< VideoConfigSourcePresenceToString(video_config,
|
||||
user_provided_generator);
|
||||
|
||||
if (video_config.screen_share_config) {
|
||||
ValidateScreenShareConfig(video_config,
|
||||
*video_config.screen_share_config);
|
||||
}
|
||||
if (video_config.simulcast_config) {
|
||||
has_simulcast = true;
|
||||
RTC_CHECK(!video_config.max_encode_bitrate_bps)
|
||||
|
||||
Reference in New Issue
Block a user