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:
@@ -361,15 +361,7 @@ static const char *const dsf_mime_types[] = {
|
||||
nullptr
|
||||
};
|
||||
|
||||
const struct DecoderPlugin dsf_decoder_plugin = {
|
||||
"dsf",
|
||||
nullptr,
|
||||
nullptr,
|
||||
dsf_stream_decode,
|
||||
nullptr,
|
||||
nullptr,
|
||||
dsf_scan_stream,
|
||||
nullptr,
|
||||
dsf_suffixes,
|
||||
dsf_mime_types,
|
||||
};
|
||||
constexpr DecoderPlugin dsf_decoder_plugin =
|
||||
DecoderPlugin("dsf", dsf_stream_decode, dsf_scan_stream)
|
||||
.WithSuffixes(dsf_suffixes)
|
||||
.WithMimeTypes(dsf_mime_types);
|
||||
|
Reference in New Issue
Block a user