Add --disable_decoding flag to video_replay
Bug: webrtc:14508 Change-Id: I8758e4f166e18dbdbe7a6b9b7e55cc94e19366f8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277446 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38287}
This commit is contained in:
@ -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_preview, false, "Disable decoded video preview.");
|
||||||
|
|
||||||
|
ABSL_FLAG(bool, disable_decoding, false, "Disable video decoding.");
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
bool ValidatePayloadType(int32_t payload_type) {
|
bool ValidatePayloadType(int32_t payload_type) {
|
||||||
return payload_type > 0 && payload_type <= 127;
|
return payload_type > 0 && payload_type <= 127;
|
||||||
@ -307,7 +309,13 @@ std::unique_ptr<StreamState> ConfigureFromFile(const std::string& config_path,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (absl::GetFlag(FLAGS_disable_decoding)) {
|
||||||
|
stream_state->decoder_factory =
|
||||||
|
std::make_unique<test::FunctionVideoDecoderFactory>(
|
||||||
|
[]() { return std::make_unique<test::FakeDecoder>(); });
|
||||||
|
} else {
|
||||||
stream_state->decoder_factory = std::make_unique<InternalDecoderFactory>();
|
stream_state->decoder_factory = std::make_unique<InternalDecoderFactory>();
|
||||||
|
}
|
||||||
size_t config_count = 0;
|
size_t config_count = 0;
|
||||||
for (const auto& json : json_configs) {
|
for (const auto& json : json_configs) {
|
||||||
// Create the configuration and parse the JSON into the config.
|
// Create the configuration and parse the JSON into the config.
|
||||||
@ -418,6 +426,10 @@ std::unique_ptr<StreamState> ConfigureFromFlags(
|
|||||||
absl::GetFlag(FLAGS_decoder_ivf_filename).c_str(),
|
absl::GetFlag(FLAGS_decoder_ivf_filename).c_str(),
|
||||||
absl::GetFlag(FLAGS_codec));
|
absl::GetFlag(FLAGS_codec));
|
||||||
});
|
});
|
||||||
|
} else if (absl::GetFlag(FLAGS_disable_decoding)) {
|
||||||
|
stream_state->decoder_factory =
|
||||||
|
std::make_unique<test::FunctionVideoDecoderFactory>(
|
||||||
|
[]() { return std::make_unique<test::FakeDecoder>(); });
|
||||||
} else {
|
} else {
|
||||||
stream_state->decoder_factory = std::make_unique<InternalDecoderFactory>();
|
stream_state->decoder_factory = std::make_unique<InternalDecoderFactory>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user