decoder/Plugin: simplify compile-time initialization
Add a `constexpr` constructor and several `constexpr` methods to construct a DecoderPlugin at compile time, in a way which allows adding new methods later without having to edit each plugin.
This commit is contained in:
@@ -266,17 +266,9 @@ static const char *const hybrid_dsd_suffixes[] = {
|
||||
nullptr
|
||||
};
|
||||
|
||||
const struct DecoderPlugin hybrid_dsd_decoder_plugin = {
|
||||
"hybrid_dsd",
|
||||
InitHybridDsdDecoder,
|
||||
nullptr,
|
||||
HybridDsdDecode,
|
||||
nullptr,
|
||||
nullptr,
|
||||
constexpr DecoderPlugin hybrid_dsd_decoder_plugin =
|
||||
/* no scan method here; the FFmpeg plugin will do that for us,
|
||||
and we only do the decoding */
|
||||
nullptr,
|
||||
nullptr,
|
||||
hybrid_dsd_suffixes,
|
||||
nullptr,
|
||||
};
|
||||
DecoderPlugin("hybrid_dsd", HybridDsdDecode, nullptr)
|
||||
.WithInit(InitHybridDsdDecoder)
|
||||
.WithSuffixes(hybrid_dsd_suffixes);
|
||||
|
Reference in New Issue
Block a user