mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Provide Environment when creating VideoEncoder in test code
Bug: webrtc:15860 Change-Id: I8c79ff58619716842e02f33e78a0529c631494e6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342280 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41884}
This commit is contained in:
parent
a1d8665c31
commit
329f0ead43
20 changed files with 87 additions and 42 deletions
|
@ -14,6 +14,7 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
|
@ -29,6 +30,10 @@ class MockVideoEncoderFactory : public webrtc::VideoEncoderFactory {
|
|||
GetSupportedFormats,
|
||||
(),
|
||||
(const, override));
|
||||
MOCK_METHOD(std::unique_ptr<VideoEncoder>,
|
||||
Create,
|
||||
(const Environment&, const SdpVideoFormat&),
|
||||
(override));
|
||||
MOCK_METHOD(std::unique_ptr<VideoEncoder>,
|
||||
CreateVideoEncoder,
|
||||
(const SdpVideoFormat&),
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
|
@ -30,11 +31,13 @@ class FunctionVideoEncoderFactory final : public VideoEncoderFactory {
|
|||
public:
|
||||
explicit FunctionVideoEncoderFactory(
|
||||
std::function<std::unique_ptr<VideoEncoder>()> create)
|
||||
: create_([create = std::move(create)](const SdpVideoFormat&) {
|
||||
: create_([create = std::move(create)](const Environment&,
|
||||
const SdpVideoFormat&) {
|
||||
return create();
|
||||
}) {}
|
||||
explicit FunctionVideoEncoderFactory(
|
||||
std::function<std::unique_ptr<VideoEncoder>(const SdpVideoFormat&)>
|
||||
std::function<std::unique_ptr<VideoEncoder>(const Environment&,
|
||||
const SdpVideoFormat&)>
|
||||
create)
|
||||
: create_(std::move(create)) {}
|
||||
|
||||
|
@ -44,13 +47,14 @@ class FunctionVideoEncoderFactory final : public VideoEncoderFactory {
|
|||
return {};
|
||||
}
|
||||
|
||||
std::unique_ptr<VideoEncoder> CreateVideoEncoder(
|
||||
std::unique_ptr<VideoEncoder> Create(const Environment& env,
|
||||
const SdpVideoFormat& format) override {
|
||||
return create_(format);
|
||||
return create_(env, format);
|
||||
}
|
||||
|
||||
private:
|
||||
const std::function<std::unique_ptr<VideoEncoder>(const SdpVideoFormat&)>
|
||||
const std::function<std::unique_ptr<VideoEncoder>(const Environment&,
|
||||
const SdpVideoFormat&)>
|
||||
create_;
|
||||
};
|
||||
|
||||
|
|
|
@ -1415,7 +1415,7 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) {
|
|||
|
||||
// Mock encoder creation. `engine` take ownership of the encoder.
|
||||
const webrtc::SdpVideoFormat format("VP8");
|
||||
EXPECT_CALL(*encoder_factory, CreateVideoEncoder(format)).WillOnce([&] {
|
||||
EXPECT_CALL(*encoder_factory, Create(_, format)).WillOnce([&] {
|
||||
return std::make_unique<FakeWebRtcVideoEncoder>(nullptr);
|
||||
});
|
||||
|
||||
|
|
|
@ -258,6 +258,7 @@ std::unique_ptr<VideoCodecStats> RunEncodeDecodeTest(
|
|||
}
|
||||
|
||||
std::unique_ptr<VideoCodecStats> RunEncodeTest(
|
||||
const Environment& env,
|
||||
std::string codec_type,
|
||||
std::string codec_impl,
|
||||
const VideoInfo& video_info,
|
||||
|
@ -292,7 +293,8 @@ std::unique_ptr<VideoCodecStats> RunEncodeTest(
|
|||
encoder_settings.encoder_output_base_path = output_path + "_enc_output";
|
||||
}
|
||||
|
||||
return VideoCodecTester::RunEncodeTest(source_settings, encoder_factory.get(),
|
||||
return VideoCodecTester::RunEncodeTest(env, source_settings,
|
||||
encoder_factory.get(),
|
||||
encoder_settings, encoding_settings);
|
||||
}
|
||||
|
||||
|
@ -394,6 +396,7 @@ class BitrateAdaptationTest
|
|||
|
||||
TEST_P(BitrateAdaptationTest, BitrateAdaptation) {
|
||||
auto [codec_type, codec_impl, video_info, bitrate_kbps] = GetParam();
|
||||
const Environment env = CreateEnvironment();
|
||||
|
||||
int duration_s = 10; // Duration of fixed rate interval.
|
||||
int num_frames =
|
||||
|
@ -417,7 +420,7 @@ TEST_P(BitrateAdaptationTest, BitrateAdaptation) {
|
|||
encoding_settings.merge(encoding_settings2);
|
||||
|
||||
std::unique_ptr<VideoCodecStats> stats =
|
||||
RunEncodeTest(codec_type, codec_impl, video_info, encoding_settings);
|
||||
RunEncodeTest(env, codec_type, codec_impl, video_info, encoding_settings);
|
||||
|
||||
VideoCodecStats::Stream stream;
|
||||
if (stats != nullptr) {
|
||||
|
@ -472,6 +475,7 @@ class FramerateAdaptationTest
|
|||
|
||||
TEST_P(FramerateAdaptationTest, FramerateAdaptation) {
|
||||
auto [codec_type, codec_impl, video_info, framerate_fps] = GetParam();
|
||||
const Environment env = CreateEnvironment();
|
||||
|
||||
int duration_s = 10; // Duration of fixed rate interval.
|
||||
|
||||
|
@ -497,7 +501,7 @@ TEST_P(FramerateAdaptationTest, FramerateAdaptation) {
|
|||
encoding_settings.merge(encoding_settings2);
|
||||
|
||||
std::unique_ptr<VideoCodecStats> stats =
|
||||
RunEncodeTest(codec_type, codec_impl, video_info, encoding_settings);
|
||||
RunEncodeTest(env, codec_type, codec_impl, video_info, encoding_settings);
|
||||
|
||||
VideoCodecStats::Stream stream;
|
||||
if (stats != nullptr) {
|
||||
|
|
|
@ -123,7 +123,7 @@ INSTANTIATE_TEST_SUITE_P(MultipleEncodersDecoders,
|
|||
TEST_P(VideoEncoderDecoderInstantiationTest, DISABLED_InstantiateVp8Codecs) {
|
||||
for (int i = 0; i < num_encoders_; ++i) {
|
||||
std::unique_ptr<VideoEncoder> encoder =
|
||||
encoder_factory_->CreateVideoEncoder(vp8_format_);
|
||||
encoder_factory_->Create(env_, vp8_format_);
|
||||
EXPECT_EQ(0, InitEncoder(kVideoCodecVP8, encoder.get()));
|
||||
encoders_.emplace_back(std::move(encoder));
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ TEST_P(VideoEncoderDecoderInstantiationTest,
|
|||
DISABLED_InstantiateH264CBPCodecs) {
|
||||
for (int i = 0; i < num_encoders_; ++i) {
|
||||
std::unique_ptr<VideoEncoder> encoder =
|
||||
encoder_factory_->CreateVideoEncoder(h264cbp_format_);
|
||||
encoder_factory_->Create(env_, h264cbp_format_);
|
||||
EXPECT_EQ(0, InitEncoder(kVideoCodecH264, encoder.get()));
|
||||
encoders_.emplace_back(std::move(encoder));
|
||||
}
|
||||
|
|
|
@ -703,7 +703,7 @@ bool VideoCodecTestFixtureImpl::CreateEncoderAndDecoder() {
|
|||
decoder_format = *config_.decoder_format;
|
||||
}
|
||||
|
||||
encoder_ = encoder_factory_->CreateVideoEncoder(encoder_format);
|
||||
encoder_ = encoder_factory_->Create(env, encoder_format);
|
||||
EXPECT_TRUE(encoder_) << "Encoder not successfully created.";
|
||||
if (encoder_ == nullptr) {
|
||||
return false;
|
||||
|
|
|
@ -261,7 +261,7 @@ SimulcastTestFixtureImpl::SimulcastTestFixtureImpl(
|
|||
SdpVideoFormat video_format)
|
||||
: codec_type_(PayloadStringToCodecType(video_format.name)) {
|
||||
Environment env = CreateEnvironment();
|
||||
encoder_ = encoder_factory->CreateVideoEncoder(video_format);
|
||||
encoder_ = encoder_factory->Create(env, video_format);
|
||||
decoder_ = decoder_factory->Create(env, video_format);
|
||||
SetUpCodec((codec_type_ == kVideoCodecVP8 || codec_type_ == kVideoCodecH264)
|
||||
? kDefaultTemporalLayerProfile
|
||||
|
|
|
@ -477,6 +477,8 @@ if (!build_with_chromium) {
|
|||
deps = [
|
||||
"//api:create_frame_generator",
|
||||
"//api:frame_generator_api",
|
||||
"//api/environment",
|
||||
"//api/environment:environment_factory",
|
||||
"//api/video:builtin_video_bitrate_allocator_factory",
|
||||
"//api/video_codecs:builtin_video_encoder_factory",
|
||||
"//api/video_codecs:video_codecs_api",
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "absl/flags/flag.h"
|
||||
#include "absl/flags/parse.h"
|
||||
#include "absl/flags/usage.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/environment/environment_factory.h"
|
||||
#include "api/test/create_frame_generator.h"
|
||||
#include "api/test/frame_generator_interface.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
|
@ -308,6 +310,7 @@ class TestVideoEncoderFactoryWrapper final {
|
|||
}
|
||||
|
||||
std::unique_ptr<VideoEncoder> CreateAndInitializeVideoEncoder(
|
||||
const Environment& env,
|
||||
const VideoCodec& video_codec_setting) {
|
||||
const std::string video_codec_string =
|
||||
CodecTypeToPayloadString(video_codec_setting.codecType);
|
||||
|
@ -316,8 +319,8 @@ class TestVideoEncoderFactoryWrapper final {
|
|||
|
||||
// Create video encoder.
|
||||
std::unique_ptr<VideoEncoder> video_encoder =
|
||||
builtin_video_encoder_factory_->CreateVideoEncoder(
|
||||
SdpVideoFormat(video_codec_string));
|
||||
builtin_video_encoder_factory_->Create(
|
||||
env, SdpVideoFormat(video_codec_string));
|
||||
RTC_CHECK(video_encoder);
|
||||
|
||||
// Initialize video encoder.
|
||||
|
@ -408,6 +411,8 @@ int main(int argc, char* argv[]) {
|
|||
const uint32_t key_frame_interval = absl::GetFlag(FLAGS_key_frame_interval);
|
||||
const uint32_t maximum_number_of_frames = absl::GetFlag(FLAGS_frames);
|
||||
|
||||
const webrtc::Environment env = webrtc::CreateEnvironment();
|
||||
|
||||
std::unique_ptr<webrtc::TestVideoEncoderFactoryWrapper>
|
||||
test_video_encoder_factory_wrapper =
|
||||
std::make_unique<webrtc::TestVideoEncoderFactoryWrapper>();
|
||||
|
@ -514,7 +519,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
std::unique_ptr<webrtc::VideoEncoder> video_encoder =
|
||||
test_video_encoder_factory_wrapper->CreateAndInitializeVideoEncoder(
|
||||
video_codec_setting);
|
||||
env, video_codec_setting);
|
||||
RTC_CHECK(video_encoder);
|
||||
|
||||
// Create `TestEncodedImageCallback`.
|
||||
|
|
|
@ -1370,6 +1370,7 @@ rtc_library("video_codec_tester") {
|
|||
deps = [
|
||||
":scoped_key_value_config",
|
||||
"../api:array_view",
|
||||
"../api/environment",
|
||||
"../api/numerics:numerics",
|
||||
"../api/test/metrics:metric",
|
||||
"../api/test/metrics:metrics_logger",
|
||||
|
|
|
@ -153,6 +153,7 @@ rtc_library("quality_analyzing_video_encoder") {
|
|||
deps = [
|
||||
":encoded_image_data_injector_api",
|
||||
"../../../../../api:video_quality_analyzer_api",
|
||||
"../../../../../api/environment",
|
||||
"../../../../../api/test/pclf:media_configuration",
|
||||
"../../../../../api/video:video_frame",
|
||||
"../../../../../api/video_codecs:video_codecs_api",
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <utility>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/video/video_codec_type.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "modules/video_coding/include/video_error_codes.h"
|
||||
|
@ -410,5 +411,13 @@ QualityAnalyzingVideoEncoderFactory::CreateVideoEncoder(
|
|||
stream_to_sfu_config_, injector_, analyzer_);
|
||||
}
|
||||
|
||||
std::unique_ptr<VideoEncoder> QualityAnalyzingVideoEncoderFactory::Create(
|
||||
const Environment& env,
|
||||
const SdpVideoFormat& format) {
|
||||
return std::make_unique<QualityAnalyzingVideoEncoder>(
|
||||
peer_name_, delegate_->Create(env, format), bitrate_multiplier_,
|
||||
stream_to_sfu_config_, injector_, analyzer_);
|
||||
}
|
||||
|
||||
} // namespace webrtc_pc_e2e
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/test/pclf/media_configuration.h"
|
||||
#include "api/test/video_quality_analyzer_interface.h"
|
||||
#include "api/video/video_frame.h"
|
||||
|
@ -178,6 +179,8 @@ class QualityAnalyzingVideoEncoderFactory : public VideoEncoderFactory {
|
|||
absl::optional<std::string> scalability_mode) const override;
|
||||
std::unique_ptr<VideoEncoder> CreateVideoEncoder(
|
||||
const SdpVideoFormat& format) override;
|
||||
std::unique_ptr<VideoEncoder> Create(const Environment& env,
|
||||
const SdpVideoFormat& format) override;
|
||||
|
||||
private:
|
||||
const std::string peer_name_;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <utility>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
|
@ -883,10 +884,12 @@ class Encoder : public EncodedImageCallback {
|
|||
using EncodeCallback =
|
||||
absl::AnyInvocable<void(const EncodedImage& encoded_frame)>;
|
||||
|
||||
Encoder(VideoEncoderFactory* encoder_factory,
|
||||
Encoder(const Environment& env,
|
||||
VideoEncoderFactory* encoder_factory,
|
||||
const EncoderSettings& encoder_settings,
|
||||
VideoCodecAnalyzer* analyzer)
|
||||
: encoder_factory_(encoder_factory),
|
||||
: env_(env),
|
||||
encoder_factory_(encoder_factory),
|
||||
analyzer_(analyzer),
|
||||
pacer_(encoder_settings.pacing_settings) {
|
||||
RTC_CHECK(analyzer_) << "Analyzer must be provided";
|
||||
|
@ -903,8 +906,8 @@ class Encoder : public EncodedImageCallback {
|
|||
}
|
||||
|
||||
void Initialize(const EncodingSettings& encoding_settings) {
|
||||
encoder_ = encoder_factory_->CreateVideoEncoder(
|
||||
encoding_settings.sdp_video_format);
|
||||
encoder_ =
|
||||
encoder_factory_->Create(env_, encoding_settings.sdp_video_format);
|
||||
RTC_CHECK(encoder_) << "Could not create encoder for video format "
|
||||
<< encoding_settings.sdp_video_format.ToString();
|
||||
|
||||
|
@ -1192,6 +1195,7 @@ class Encoder : public EncodedImageCallback {
|
|||
return encoded_frame;
|
||||
}
|
||||
|
||||
const Environment env_;
|
||||
VideoEncoderFactory* const encoder_factory_;
|
||||
std::unique_ptr<VideoEncoder> encoder_;
|
||||
VideoCodecAnalyzer* const analyzer_;
|
||||
|
@ -1552,6 +1556,7 @@ VideoCodecTester::RunDecodeTest(const Environment& env,
|
|||
|
||||
std::unique_ptr<VideoCodecTester::VideoCodecStats>
|
||||
VideoCodecTester::RunEncodeTest(
|
||||
const Environment& env,
|
||||
const VideoSourceSettings& source_settings,
|
||||
VideoEncoderFactory* encoder_factory,
|
||||
const EncoderSettings& encoder_settings,
|
||||
|
@ -1559,7 +1564,7 @@ VideoCodecTester::RunEncodeTest(
|
|||
VideoSource video_source(source_settings);
|
||||
std::unique_ptr<VideoCodecAnalyzer> analyzer =
|
||||
std::make_unique<VideoCodecAnalyzer>(/*video_source=*/nullptr);
|
||||
Encoder encoder(encoder_factory, encoder_settings, analyzer.get());
|
||||
Encoder encoder(env, encoder_factory, encoder_settings, analyzer.get());
|
||||
encoder.Initialize(encoding_settings.begin()->second);
|
||||
|
||||
for (const auto& [timestamp_rtp, frame_settings] : encoding_settings) {
|
||||
|
@ -1589,7 +1594,7 @@ VideoCodecTester::RunEncodeDecodeTest(
|
|||
std::unique_ptr<VideoCodecAnalyzer> analyzer =
|
||||
std::make_unique<VideoCodecAnalyzer>(&video_source);
|
||||
const EncodingSettings& frame_settings = encoding_settings.begin()->second;
|
||||
Encoder encoder(encoder_factory, encoder_settings, analyzer.get());
|
||||
Encoder encoder(env, encoder_factory, encoder_settings, analyzer.get());
|
||||
encoder.Initialize(frame_settings);
|
||||
|
||||
int num_spatial_layers =
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/numerics/samples_stats_counter.h"
|
||||
#include "api/test/metrics/metric.h"
|
||||
#include "api/test/metrics/metrics_logger.h"
|
||||
|
@ -207,6 +208,7 @@ class VideoCodecTester {
|
|||
|
||||
// Encodes video, collects and returns encode metrics.
|
||||
static std::unique_ptr<VideoCodecStats> RunEncodeTest(
|
||||
const Environment& env,
|
||||
const VideoSourceSettings& source_settings,
|
||||
VideoEncoderFactory* encoder_factory,
|
||||
const EncoderSettings& encoder_settings,
|
||||
|
|
|
@ -194,11 +194,10 @@ class VideoCodecTesterTest : public ::testing::Test {
|
|||
.framerate = kTargetFramerate};
|
||||
|
||||
NiceMock<MockVideoEncoderFactory> encoder_factory;
|
||||
ON_CALL(encoder_factory, CreateVideoEncoder)
|
||||
.WillByDefault([&](const SdpVideoFormat&) {
|
||||
ON_CALL(encoder_factory, Create).WillByDefault(WithoutArgs([&] {
|
||||
return std::make_unique<NiceMock<TestVideoEncoder>>(scalability_mode,
|
||||
encoded_frames);
|
||||
});
|
||||
}));
|
||||
|
||||
NiceMock<MockVideoDecoderFactory> decoder_factory;
|
||||
ON_CALL(decoder_factory, Create).WillByDefault(WithoutArgs([&] {
|
||||
|
@ -610,16 +609,16 @@ class VideoCodecTesterTestPacing
|
|||
|
||||
TEST_P(VideoCodecTesterTestPacing, PaceEncode) {
|
||||
auto [pacing_settings, expected_delta_ms] = GetParam();
|
||||
const Environment env = CreateEnvironment();
|
||||
VideoSourceSettings video_source{
|
||||
.file_path = source_yuv_file_path_,
|
||||
.resolution = {.width = kSourceWidth, .height = kSourceHeight},
|
||||
.framerate = kTargetFramerate};
|
||||
|
||||
NiceMock<MockVideoEncoderFactory> encoder_factory;
|
||||
ON_CALL(encoder_factory, CreateVideoEncoder(_))
|
||||
.WillByDefault([](const SdpVideoFormat&) {
|
||||
ON_CALL(encoder_factory, Create).WillByDefault(WithoutArgs([] {
|
||||
return std::make_unique<NiceMock<MockVideoEncoder>>();
|
||||
});
|
||||
}));
|
||||
|
||||
std::map<uint32_t, EncodingSettings> encoding_settings =
|
||||
VideoCodecTester::CreateEncodingSettings(
|
||||
|
@ -629,7 +628,7 @@ TEST_P(VideoCodecTesterTestPacing, PaceEncode) {
|
|||
EncoderSettings encoder_settings;
|
||||
encoder_settings.pacing_settings = pacing_settings;
|
||||
std::vector<Frame> frames =
|
||||
VideoCodecTester::RunEncodeTest(video_source, &encoder_factory,
|
||||
VideoCodecTester::RunEncodeTest(env, video_source, &encoder_factory,
|
||||
encoder_settings, encoding_settings)
|
||||
->Slice(/*filter=*/{}, /*merge=*/false);
|
||||
ASSERT_THAT(frames, SizeIs(kNumFrames));
|
||||
|
|
|
@ -199,7 +199,8 @@ void MultiCodecReceiveTest::RunTestWithCodecs(
|
|||
EXPECT_TRUE(!configs.empty());
|
||||
|
||||
test::FunctionVideoEncoderFactory encoder_factory(
|
||||
[](const SdpVideoFormat& format) -> std::unique_ptr<VideoEncoder> {
|
||||
[](const Environment& env,
|
||||
const SdpVideoFormat& format) -> std::unique_ptr<VideoEncoder> {
|
||||
if (format.name == "VP8") {
|
||||
return VP8Encoder::Create();
|
||||
}
|
||||
|
|
|
@ -87,7 +87,8 @@ class ScalingObserver : public test::SendTest {
|
|||
bool expect_scaling)
|
||||
: SendTest(expect_scaling ? kTimeout * 4 : kTimeout),
|
||||
encoder_factory_(
|
||||
[](const SdpVideoFormat& format) -> std::unique_ptr<VideoEncoder> {
|
||||
[](const Environment& env,
|
||||
const SdpVideoFormat& format) -> std::unique_ptr<VideoEncoder> {
|
||||
if (format.name == "VP8")
|
||||
return VP8Encoder::Create();
|
||||
if (format.name == "VP9")
|
||||
|
|
|
@ -312,6 +312,7 @@ std::unique_ptr<VideoDecoder> VideoQualityTest::CreateVideoDecoder(
|
|||
}
|
||||
|
||||
std::unique_ptr<VideoEncoder> VideoQualityTest::CreateVideoEncoder(
|
||||
const Environment& env,
|
||||
const SdpVideoFormat& format,
|
||||
VideoAnalyzer* analyzer) {
|
||||
std::unique_ptr<VideoEncoder> encoder;
|
||||
|
@ -321,7 +322,7 @@ std::unique_ptr<VideoEncoder> VideoQualityTest::CreateVideoEncoder(
|
|||
} else if (format.name == "FakeCodec") {
|
||||
encoder = webrtc::FakeVideoEncoderFactory::CreateVideoEncoder();
|
||||
} else {
|
||||
encoder = encoder_factory_->CreateVideoEncoder(format);
|
||||
encoder = encoder_factory_->Create(env, format);
|
||||
}
|
||||
|
||||
std::vector<FileWrapper> encoded_frame_dump_files;
|
||||
|
@ -372,12 +373,13 @@ VideoQualityTest::VideoQualityTest(
|
|||
[this](const Environment& env, const SdpVideoFormat& format) {
|
||||
return this->CreateVideoDecoder(env, format);
|
||||
}),
|
||||
video_encoder_factory_([this](const SdpVideoFormat& format) {
|
||||
return this->CreateVideoEncoder(format, nullptr);
|
||||
video_encoder_factory_(
|
||||
[this](const Environment& env, const SdpVideoFormat& format) {
|
||||
return this->CreateVideoEncoder(env, format, nullptr);
|
||||
}),
|
||||
video_encoder_factory_with_analyzer_(
|
||||
[this](const SdpVideoFormat& format) {
|
||||
return this->CreateVideoEncoder(format, analyzer_.get());
|
||||
[this](const Environment& env, const SdpVideoFormat& format) {
|
||||
return this->CreateVideoEncoder(env, format, analyzer_.get());
|
||||
}),
|
||||
video_bitrate_allocator_factory_(
|
||||
CreateBuiltinVideoBitrateAllocatorFactory()),
|
||||
|
|
|
@ -82,7 +82,8 @@ class VideoQualityTest : public test::CallTest,
|
|||
std::unique_ptr<VideoDecoder> CreateVideoDecoder(
|
||||
const Environment& env,
|
||||
const SdpVideoFormat& format);
|
||||
std::unique_ptr<VideoEncoder> CreateVideoEncoder(const SdpVideoFormat& format,
|
||||
std::unique_ptr<VideoEncoder> CreateVideoEncoder(const Environment& env,
|
||||
const SdpVideoFormat& format,
|
||||
VideoAnalyzer* analyzer);
|
||||
void SetupVideo(Transport* send_transport, Transport* recv_transport);
|
||||
void SetupThumbnails(Transport* send_transport, Transport* recv_transport);
|
||||
|
|
Loading…
Reference in a new issue