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:
@@ -430,15 +430,7 @@ static const char *const faad_mime_types[] = {
|
||||
"audio/aac", "audio/aacp", nullptr
|
||||
};
|
||||
|
||||
const DecoderPlugin faad_decoder_plugin = {
|
||||
"faad",
|
||||
nullptr,
|
||||
nullptr,
|
||||
faad_stream_decode,
|
||||
nullptr,
|
||||
nullptr,
|
||||
faad_scan_stream,
|
||||
nullptr,
|
||||
faad_suffixes,
|
||||
faad_mime_types,
|
||||
};
|
||||
constexpr DecoderPlugin faad_decoder_plugin =
|
||||
DecoderPlugin("faad", faad_stream_decode, faad_scan_stream)
|
||||
.WithSuffixes(faad_suffixes)
|
||||
.WithMimeTypes(faad_mime_types);
|
||||
|
Reference in New Issue
Block a user