diff --git a/src/utils/video_pattern_generator.cpp b/src/utils/video_pattern_generator.cpp index 33e92c6f6..f055277b0 100644 --- a/src/utils/video_pattern_generator.cpp +++ b/src/utils/video_pattern_generator.cpp @@ -61,7 +61,6 @@ #include #include #include -#include #include #include @@ -87,7 +86,6 @@ using std::make_unique; using std::max; using std::min; using std::move; -using std::set; using std::string; using std::swap; using std::unique_ptr; @@ -99,8 +97,6 @@ enum class generator_depth { bits16 }; -static const set native_16b{ RG48, R12L, R10k, v210, Y416, Y216 }; - class image_pattern { public: static unique_ptr create(string const & config); @@ -339,8 +335,10 @@ unique_ptr image_pattern::create(string const &config) { if (config == "help") { cout << "Pattern to use, one of: " << BOLD("bars, blank, ebu_bars, gradient[=0x], gradient2, noise, raw=0xXX[YYZZ..], smpte_bars, 0x\n"); cout << "\t\t- patterns 'gradient2' and 'noise' generate full bit-depth patterns with"; - for (auto & c : native_16b) { - cout << " " << BOLD(get_codec_name(c)); + for (codec_t c = VIDEO_CODEC_FIRST; c != VIDEO_CODEC_COUNT; c = static_cast(static_cast(c) + 1)) { + if (get_decoder_from_to(RG48, c, true) != NULL) { + cout << " " << BOLD(get_codec_name(c)); + } } cout << "\n"; cout << "\t\t- pattern 'raw' generates repeating sequence of given bytes without any color conversion\n"; @@ -419,7 +417,7 @@ video_pattern_generate(std::string const & config, int width, int height, codec_ auto data = generator->init(width, height, generator_depth::bits8); codec_t codec_src = RGBA; - if (native_16b.find(color_spec) != native_16b.end()) { + if (get_decoder_from_to(RG48, color_spec, true) != NULL) { data = generator->init(width, height, generator_depth::bits16); codec_src = RG48; }