Remove use of SetEncodingDataInternal in MediaOptimization.
Add method FilenameWithParams to TestConfig. Bug: none Change-Id: I9f683e661537148dc01bee25f7510938fa656dc5 Reviewed-on: https://webrtc-review.googlesource.com/21382 Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Commit-Queue: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20651}
This commit is contained in:
@ -193,5 +193,11 @@ std::string TestConfig::CodecName() const {
|
||||
return codec_name;
|
||||
}
|
||||
|
||||
std::string TestConfig::FilenameWithParams() const {
|
||||
std::string implementation_type = hw_encoder ? "hw" : "sw";
|
||||
return filename + "_" + CodecName() + "_" + implementation_type + "_" +
|
||||
std::to_string(codec_settings.startBitrate);
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
@ -57,6 +57,7 @@ struct TestConfig {
|
||||
std::vector<FrameType> FrameTypeForFrame(int frame_idx) const;
|
||||
std::string ToString() const;
|
||||
std::string CodecName() const;
|
||||
std::string FilenameWithParams() const;
|
||||
|
||||
// Plain name of YUV file to process without file extension.
|
||||
std::string filename;
|
||||
|
||||
@ -149,5 +149,14 @@ TEST(TestConfig, ToString_Vp8) {
|
||||
config.ToString());
|
||||
}
|
||||
|
||||
TEST(TestConfig, FilenameWithParams) {
|
||||
TestConfig config;
|
||||
config.filename = "filename";
|
||||
webrtc::test::CodecSettings(kVideoCodecVP8, &config.codec_settings);
|
||||
config.hw_encoder = true;
|
||||
config.codec_settings.startBitrate = 400;
|
||||
EXPECT_EQ("filename_VP8_hw_400", config.FilenameWithParams());
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
@ -407,6 +407,10 @@ void VideoProcessorIntegrationTest::SetUpAndInitObjects(
|
||||
const VisualizationParams* visualization_params) {
|
||||
CreateEncoderAndDecoder();
|
||||
|
||||
config_.codec_settings.minBitrate = 0;
|
||||
config_.codec_settings.startBitrate = initial_bitrate_kbps;
|
||||
config_.codec_settings.maxFramerate = initial_framerate_fps;
|
||||
|
||||
// Create file objects for quality analysis.
|
||||
analysis_frame_reader_.reset(new YuvFrameReaderImpl(
|
||||
config_.input_filename, config_.codec_settings.width,
|
||||
@ -418,15 +422,8 @@ void VideoProcessorIntegrationTest::SetUpAndInitObjects(
|
||||
EXPECT_TRUE(analysis_frame_writer_->Init());
|
||||
|
||||
if (visualization_params) {
|
||||
const std::string codec_name =
|
||||
CodecTypeToPayloadString(config_.codec_settings.codecType);
|
||||
const std::string implementation_type = config_.hw_encoder ? "hw" : "sw";
|
||||
// clang-format off
|
||||
const std::string output_filename_base =
|
||||
OutputPath() + config_.filename + "-" +
|
||||
codec_name + "-" + implementation_type + "-" +
|
||||
std::to_string(initial_bitrate_kbps);
|
||||
// clang-format on
|
||||
OutputPath() + config_.FilenameWithParams();
|
||||
if (visualization_params->save_encoded_ivf) {
|
||||
rtc::File post_encode_file =
|
||||
rtc::File::Create(output_filename_base + ".ivf");
|
||||
@ -445,10 +442,6 @@ void VideoProcessorIntegrationTest::SetUpAndInitObjects(
|
||||
packet_manipulator_.reset(new PacketManipulatorImpl(
|
||||
&packet_reader_, config_.networking_config, false));
|
||||
|
||||
config_.codec_settings.minBitrate = 0;
|
||||
config_.codec_settings.startBitrate = initial_bitrate_kbps;
|
||||
config_.codec_settings.maxFramerate = initial_framerate_fps;
|
||||
|
||||
rtc::Event sync_event(false, false);
|
||||
task_queue->PostTask([this, &sync_event]() {
|
||||
processor_ = rtc::MakeUnique<VideoProcessor>(
|
||||
|
||||
Reference in New Issue
Block a user