diff options
Diffstat (limited to 'third_party/libwebrtc/modules/video_coding/codecs/test/video_codec_test.cc')
-rw-r--r-- | third_party/libwebrtc/modules/video_coding/codecs/test/video_codec_test.cc | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/third_party/libwebrtc/modules/video_coding/codecs/test/video_codec_test.cc b/third_party/libwebrtc/modules/video_coding/codecs/test/video_codec_test.cc index 60c2fcbb6e..2ab1106a59 100644 --- a/third_party/libwebrtc/modules/video_coding/codecs/test/video_codec_test.cc +++ b/third_party/libwebrtc/modules/video_coding/codecs/test/video_codec_test.cc @@ -178,7 +178,8 @@ std::string TestOutputPath() { } // namespace std::unique_ptr<VideoCodecStats> RunEncodeDecodeTest( - std::string codec_impl, + std::string encoder_impl, + std::string decoder_impl, const VideoInfo& video_info, const std::map<uint32_t, EncodingSettings>& encoding_settings) { VideoSourceSettings source_settings{ @@ -190,28 +191,34 @@ std::unique_ptr<VideoCodecStats> RunEncodeDecodeTest( encoding_settings.begin()->second.sdp_video_format; std::unique_ptr<VideoEncoderFactory> encoder_factory = - CreateEncoderFactory(codec_impl); + CreateEncoderFactory(encoder_impl); if (!encoder_factory ->QueryCodecSupport(sdp_video_format, /*scalability_mode=*/absl::nullopt) .is_supported) { - RTC_LOG(LS_WARNING) << "No encoder for video format " + RTC_LOG(LS_WARNING) << "No " << encoder_impl << " encoder for video format " << sdp_video_format.ToString(); return nullptr; } std::unique_ptr<VideoDecoderFactory> decoder_factory = - CreateDecoderFactory(codec_impl); + CreateDecoderFactory(decoder_impl); if (!decoder_factory ->QueryCodecSupport(sdp_video_format, /*reference_scaling=*/false) .is_supported) { + RTC_LOG(LS_WARNING) << "No " << decoder_impl << " decoder for video format " + << sdp_video_format.ToString() + << ". Trying built-in decoder."; + // TODO(ssilkin): No H264 support in ffmpeg on ARM. Consider trying HW + // decoder. decoder_factory = CreateDecoderFactory("builtin"); if (!decoder_factory ->QueryCodecSupport(sdp_video_format, /*reference_scaling=*/false) .is_supported) { - RTC_LOG(LS_WARNING) << "No decoder for video format " + RTC_LOG(LS_WARNING) << "No " << decoder_impl + << " decoder for video format " << sdp_video_format.ToString(); return nullptr; } @@ -221,7 +228,7 @@ std::unique_ptr<VideoCodecStats> RunEncodeDecodeTest( VideoCodecTester::EncoderSettings encoder_settings; encoder_settings.pacing_settings.mode = - codec_impl == "builtin" ? PacingMode::kNoPacing : PacingMode::kRealTime; + encoder_impl == "builtin" ? PacingMode::kNoPacing : PacingMode::kRealTime; if (absl::GetFlag(FLAGS_dump_encoder_input)) { encoder_settings.encoder_input_base_path = output_path + "_enc_input"; } @@ -231,7 +238,7 @@ std::unique_ptr<VideoCodecStats> RunEncodeDecodeTest( VideoCodecTester::DecoderSettings decoder_settings; decoder_settings.pacing_settings.mode = - codec_impl == "builtin" ? PacingMode::kNoPacing : PacingMode::kRealTime; + decoder_impl == "builtin" ? PacingMode::kNoPacing : PacingMode::kRealTime; if (absl::GetFlag(FLAGS_dump_decoder_input)) { decoder_settings.decoder_input_base_path = output_path + "_dec_input"; } @@ -318,7 +325,7 @@ TEST_P(SpatialQualityTest, SpatialQuality) { {bitrate_kbps}, framerate_fps, num_frames); std::unique_ptr<VideoCodecStats> stats = - RunEncodeDecodeTest(codec_impl, video_info, frames_settings); + RunEncodeDecodeTest(codec_impl, codec_impl, video_info, frames_settings); VideoCodecStats::Stream stream; if (stats != nullptr) { @@ -348,15 +355,15 @@ INSTANTIATE_TEST_SUITE_P( Values("builtin"), #endif Values(kRawVideos.at("FourPeople_1280x720_30")), - Values(std::make_tuple(320, 180, 30, 32, 28), - std::make_tuple(320, 180, 30, 64, 30), - std::make_tuple(320, 180, 30, 128, 33), + Values(std::make_tuple(320, 180, 30, 32, 26), + std::make_tuple(320, 180, 30, 64, 29), + std::make_tuple(320, 180, 30, 128, 32), std::make_tuple(320, 180, 30, 256, 36), - std::make_tuple(640, 360, 30, 128, 31), + std::make_tuple(640, 360, 30, 128, 29), std::make_tuple(640, 360, 30, 256, 33), std::make_tuple(640, 360, 30, 384, 35), std::make_tuple(640, 360, 30, 512, 36), - std::make_tuple(1280, 720, 30, 256, 32), + std::make_tuple(1280, 720, 30, 256, 30), std::make_tuple(1280, 720, 30, 512, 34), std::make_tuple(1280, 720, 30, 1024, 37), std::make_tuple(1280, 720, 30, 2048, 39))), @@ -538,6 +545,7 @@ TEST(VideoCodecTest, DISABLED_EncodeDecode) { // Sync with changes in Stream::LogMetrics (see TODOs there). std::unique_ptr<VideoCodecStats> stats = RunEncodeDecodeTest( CodecNameToCodecImpl(absl::GetFlag(FLAGS_encoder)), + CodecNameToCodecImpl(absl::GetFlag(FLAGS_decoder)), kRawVideos.at(absl::GetFlag(FLAGS_video_name)), frames_settings); ASSERT_NE(nullptr, stats); |