diff --git a/rtc_tools/video_replay.cc b/rtc_tools/video_replay.cc index 04828a6d99..173439af12 100644 --- a/rtc_tools/video_replay.cc +++ b/rtc_tools/video_replay.cc @@ -157,6 +157,8 @@ ABSL_FLAG(bool, simulated_time, false, "Run in simulated time"); ABSL_FLAG(bool, disable_preview, false, "Disable decoded video preview."); +ABSL_FLAG(bool, disable_decoding, false, "Disable video decoding."); + namespace { bool ValidatePayloadType(int32_t payload_type) { return payload_type > 0 && payload_type <= 127; @@ -307,7 +309,13 @@ std::unique_ptr ConfigureFromFile(const std::string& config_path, return nullptr; } - stream_state->decoder_factory = std::make_unique(); + if (absl::GetFlag(FLAGS_disable_decoding)) { + stream_state->decoder_factory = + std::make_unique( + []() { return std::make_unique(); }); + } else { + stream_state->decoder_factory = std::make_unique(); + } size_t config_count = 0; for (const auto& json : json_configs) { // Create the configuration and parse the JSON into the config. @@ -418,6 +426,10 @@ std::unique_ptr ConfigureFromFlags( absl::GetFlag(FLAGS_decoder_ivf_filename).c_str(), absl::GetFlag(FLAGS_codec)); }); + } else if (absl::GetFlag(FLAGS_disable_decoding)) { + stream_state->decoder_factory = + std::make_unique( + []() { return std::make_unique(); }); } else { stream_state->decoder_factory = std::make_unique(); }