decoder_plugin: rename struct to DecoderPlugin
This commit is contained in:
parent
65e54f6ed1
commit
72af3c0489
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const struct decoder_plugin *const decoder_plugins[] = {
|
const struct DecoderPlugin *const decoder_plugins[] = {
|
||||||
#ifdef HAVE_MAD
|
#ifdef HAVE_MAD
|
||||||
&mad_decoder_plugin,
|
&mad_decoder_plugin,
|
||||||
#endif
|
#endif
|
||||||
|
@ -119,7 +119,7 @@ static constexpr unsigned num_decoder_plugins =
|
||||||
bool decoder_plugins_enabled[num_decoder_plugins];
|
bool decoder_plugins_enabled[num_decoder_plugins];
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
decoder_plugin_index(const struct decoder_plugin *plugin)
|
decoder_plugin_index(const struct DecoderPlugin *plugin)
|
||||||
{
|
{
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
||||||
|
@ -130,16 +130,16 @@ decoder_plugin_index(const struct decoder_plugin *plugin)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
decoder_plugin_next_index(const struct decoder_plugin *plugin)
|
decoder_plugin_next_index(const struct DecoderPlugin *plugin)
|
||||||
{
|
{
|
||||||
return plugin == 0
|
return plugin == 0
|
||||||
? 0 /* start with first plugin */
|
? 0 /* start with first plugin */
|
||||||
: decoder_plugin_index(plugin) + 1;
|
: decoder_plugin_index(plugin) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct decoder_plugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_suffix(const char *suffix,
|
decoder_plugin_from_suffix(const char *suffix,
|
||||||
const struct decoder_plugin *plugin)
|
const struct DecoderPlugin *plugin)
|
||||||
{
|
{
|
||||||
if (suffix == nullptr)
|
if (suffix == nullptr)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -155,7 +155,7 @@ decoder_plugin_from_suffix(const char *suffix,
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct decoder_plugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_mime_type(const char *mimeType, unsigned int next)
|
decoder_plugin_from_mime_type(const char *mimeType, unsigned int next)
|
||||||
{
|
{
|
||||||
static unsigned i = num_decoder_plugins;
|
static unsigned i = num_decoder_plugins;
|
||||||
|
@ -166,7 +166,7 @@ decoder_plugin_from_mime_type(const char *mimeType, unsigned int next)
|
||||||
if (!next)
|
if (!next)
|
||||||
i = 0;
|
i = 0;
|
||||||
for (; decoder_plugins[i] != nullptr; ++i) {
|
for (; decoder_plugins[i] != nullptr; ++i) {
|
||||||
const struct decoder_plugin *plugin = decoder_plugins[i];
|
const struct DecoderPlugin *plugin = decoder_plugins[i];
|
||||||
if (decoder_plugins_enabled[i] &&
|
if (decoder_plugins_enabled[i] &&
|
||||||
decoder_plugin_supports_mime_type(*plugin, mimeType)) {
|
decoder_plugin_supports_mime_type(*plugin, mimeType)) {
|
||||||
++i;
|
++i;
|
||||||
|
@ -177,7 +177,7 @@ decoder_plugin_from_mime_type(const char *mimeType, unsigned int next)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct decoder_plugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_name(const char *name)
|
decoder_plugin_from_name(const char *name)
|
||||||
{
|
{
|
||||||
decoder_plugins_for_each_enabled(plugin)
|
decoder_plugins_for_each_enabled(plugin)
|
||||||
|
@ -216,7 +216,7 @@ void decoder_plugin_init_all(void)
|
||||||
struct config_param empty;
|
struct config_param empty;
|
||||||
|
|
||||||
for (unsigned i = 0; decoder_plugins[i] != nullptr; ++i) {
|
for (unsigned i = 0; decoder_plugins[i] != nullptr; ++i) {
|
||||||
const decoder_plugin &plugin = *decoder_plugins[i];
|
const DecoderPlugin &plugin = *decoder_plugins[i];
|
||||||
const struct config_param *param =
|
const struct config_param *param =
|
||||||
decoder_plugin_config(plugin.name);
|
decoder_plugin_config(plugin.name);
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
#ifndef MPD_DECODER_LIST_HXX
|
#ifndef MPD_DECODER_LIST_HXX
|
||||||
#define MPD_DECODER_LIST_HXX
|
#define MPD_DECODER_LIST_HXX
|
||||||
|
|
||||||
struct decoder_plugin;
|
struct DecoderPlugin;
|
||||||
|
|
||||||
extern const struct decoder_plugin *const decoder_plugins[];
|
extern const struct DecoderPlugin *const decoder_plugins[];
|
||||||
extern bool decoder_plugins_enabled[];
|
extern bool decoder_plugins_enabled[];
|
||||||
|
|
||||||
#define decoder_plugins_for_each(plugin) \
|
#define decoder_plugins_for_each(plugin) \
|
||||||
for (const struct decoder_plugin *plugin, \
|
for (const struct DecoderPlugin *plugin, \
|
||||||
*const*decoder_plugin_iterator = &decoder_plugins[0]; \
|
*const*decoder_plugin_iterator = &decoder_plugins[0]; \
|
||||||
(plugin = *decoder_plugin_iterator) != nullptr; \
|
(plugin = *decoder_plugin_iterator) != nullptr; \
|
||||||
++decoder_plugin_iterator)
|
++decoder_plugin_iterator)
|
||||||
|
@ -44,14 +44,14 @@ extern bool decoder_plugins_enabled[];
|
||||||
* @param plugin the previous plugin, or nullptr to find the first plugin
|
* @param plugin the previous plugin, or nullptr to find the first plugin
|
||||||
* @return a plugin, or nullptr if none matches
|
* @return a plugin, or nullptr if none matches
|
||||||
*/
|
*/
|
||||||
const struct decoder_plugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_suffix(const char *suffix,
|
decoder_plugin_from_suffix(const char *suffix,
|
||||||
const struct decoder_plugin *plugin);
|
const struct DecoderPlugin *plugin);
|
||||||
|
|
||||||
const struct decoder_plugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_mime_type(const char *mimeType, unsigned int next);
|
decoder_plugin_from_mime_type(const char *mimeType, unsigned int next);
|
||||||
|
|
||||||
const struct decoder_plugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_name(const char *name);
|
decoder_plugin_from_name(const char *name);
|
||||||
|
|
||||||
/* this is where we "load" all the "plugins" ;-) */
|
/* this is where we "load" all the "plugins" ;-) */
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
bool
|
bool
|
||||||
decoder_plugin_supports_suffix(const decoder_plugin &plugin,
|
decoder_plugin_supports_suffix(const DecoderPlugin &plugin,
|
||||||
const char *suffix)
|
const char *suffix)
|
||||||
{
|
{
|
||||||
assert(suffix != nullptr);
|
assert(suffix != nullptr);
|
||||||
|
@ -35,7 +35,7 @@ decoder_plugin_supports_suffix(const decoder_plugin &plugin,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
decoder_plugin_supports_mime_type(const decoder_plugin &plugin,
|
decoder_plugin_supports_mime_type(const DecoderPlugin &plugin,
|
||||||
const char *mime_type)
|
const char *mime_type)
|
||||||
{
|
{
|
||||||
assert(mime_type != nullptr);
|
assert(mime_type != nullptr);
|
||||||
|
|
|
@ -31,7 +31,7 @@ struct tag_handler;
|
||||||
*/
|
*/
|
||||||
struct decoder;
|
struct decoder;
|
||||||
|
|
||||||
struct decoder_plugin {
|
struct DecoderPlugin {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +111,7 @@ struct decoder_plugin {
|
||||||
* the plugin is not available
|
* the plugin is not available
|
||||||
*/
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
decoder_plugin_init(const decoder_plugin &plugin,
|
decoder_plugin_init(const DecoderPlugin &plugin,
|
||||||
const config_param ¶m)
|
const config_param ¶m)
|
||||||
{
|
{
|
||||||
return plugin.init != nullptr
|
return plugin.init != nullptr
|
||||||
|
@ -123,7 +123,7 @@ decoder_plugin_init(const decoder_plugin &plugin,
|
||||||
* Deinitialize a decoder plugin which was initialized successfully.
|
* Deinitialize a decoder plugin which was initialized successfully.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
decoder_plugin_finish(const decoder_plugin &plugin)
|
decoder_plugin_finish(const DecoderPlugin &plugin)
|
||||||
{
|
{
|
||||||
if (plugin.finish != nullptr)
|
if (plugin.finish != nullptr)
|
||||||
plugin.finish();
|
plugin.finish();
|
||||||
|
@ -133,7 +133,7 @@ decoder_plugin_finish(const decoder_plugin &plugin)
|
||||||
* Decode a stream.
|
* Decode a stream.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
decoder_plugin_stream_decode(const decoder_plugin &plugin,
|
decoder_plugin_stream_decode(const DecoderPlugin &plugin,
|
||||||
struct decoder *decoder, struct input_stream *is)
|
struct decoder *decoder, struct input_stream *is)
|
||||||
{
|
{
|
||||||
plugin.stream_decode(decoder, is);
|
plugin.stream_decode(decoder, is);
|
||||||
|
@ -143,7 +143,7 @@ decoder_plugin_stream_decode(const decoder_plugin &plugin,
|
||||||
* Decode a file.
|
* Decode a file.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
decoder_plugin_file_decode(const decoder_plugin &plugin,
|
decoder_plugin_file_decode(const DecoderPlugin &plugin,
|
||||||
struct decoder *decoder, const char *path_fs)
|
struct decoder *decoder, const char *path_fs)
|
||||||
{
|
{
|
||||||
plugin.file_decode(decoder, path_fs);
|
plugin.file_decode(decoder, path_fs);
|
||||||
|
@ -153,7 +153,7 @@ decoder_plugin_file_decode(const decoder_plugin &plugin,
|
||||||
* Read the tag of a file.
|
* Read the tag of a file.
|
||||||
*/
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
decoder_plugin_scan_file(const decoder_plugin &plugin,
|
decoder_plugin_scan_file(const DecoderPlugin &plugin,
|
||||||
const char *path_fs,
|
const char *path_fs,
|
||||||
const struct tag_handler *handler, void *handler_ctx)
|
const struct tag_handler *handler, void *handler_ctx)
|
||||||
{
|
{
|
||||||
|
@ -166,7 +166,7 @@ decoder_plugin_scan_file(const decoder_plugin &plugin,
|
||||||
* Read the tag of a stream.
|
* Read the tag of a stream.
|
||||||
*/
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
decoder_plugin_scan_stream(const decoder_plugin &plugin,
|
decoder_plugin_scan_stream(const DecoderPlugin &plugin,
|
||||||
struct input_stream *is,
|
struct input_stream *is,
|
||||||
const struct tag_handler *handler,
|
const struct tag_handler *handler,
|
||||||
void *handler_ctx)
|
void *handler_ctx)
|
||||||
|
@ -180,7 +180,7 @@ decoder_plugin_scan_stream(const decoder_plugin &plugin,
|
||||||
* return "virtual" tracks in a container
|
* return "virtual" tracks in a container
|
||||||
*/
|
*/
|
||||||
static inline char *
|
static inline char *
|
||||||
decoder_plugin_container_scan( const decoder_plugin &plugin,
|
decoder_plugin_container_scan( const DecoderPlugin &plugin,
|
||||||
const char* pathname,
|
const char* pathname,
|
||||||
const unsigned int tnum)
|
const unsigned int tnum)
|
||||||
{
|
{
|
||||||
|
@ -191,14 +191,14 @@ decoder_plugin_container_scan( const decoder_plugin &plugin,
|
||||||
* Does the plugin announce the specified file name suffix?
|
* Does the plugin announce the specified file name suffix?
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
decoder_plugin_supports_suffix(const decoder_plugin &plugin,
|
decoder_plugin_supports_suffix(const DecoderPlugin &plugin,
|
||||||
const char *suffix);
|
const char *suffix);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the plugin announce the specified MIME type?
|
* Does the plugin announce the specified MIME type?
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
decoder_plugin_supports_mime_type(const decoder_plugin &plugin,
|
decoder_plugin_supports_mime_type(const DecoderPlugin &plugin,
|
||||||
const char *mime_type);
|
const char *mime_type);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
static void
|
static void
|
||||||
decoder_plugin_print(Client &client,
|
decoder_plugin_print(Client &client,
|
||||||
const struct decoder_plugin *plugin)
|
const struct DecoderPlugin *plugin)
|
||||||
{
|
{
|
||||||
const char *const*p;
|
const char *const*p;
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ decoder_input_stream_open(decoder_control &dc, const char *uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
decoder_stream_decode(const decoder_plugin &plugin,
|
decoder_stream_decode(const DecoderPlugin &plugin,
|
||||||
struct decoder *decoder,
|
struct decoder *decoder,
|
||||||
struct input_stream *input_stream)
|
struct input_stream *input_stream)
|
||||||
{
|
{
|
||||||
|
@ -144,7 +144,7 @@ decoder_stream_decode(const decoder_plugin &plugin,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
decoder_file_decode(const decoder_plugin &plugin,
|
decoder_file_decode(const DecoderPlugin &plugin,
|
||||||
struct decoder *decoder, const char *path)
|
struct decoder *decoder, const char *path)
|
||||||
{
|
{
|
||||||
assert(plugin.file_decode != nullptr);
|
assert(plugin.file_decode != nullptr);
|
||||||
|
@ -176,9 +176,9 @@ decoder_file_decode(const decoder_plugin &plugin,
|
||||||
* Hack to allow tracking const decoder plugins in a GSList.
|
* Hack to allow tracking const decoder plugins in a GSList.
|
||||||
*/
|
*/
|
||||||
static inline gpointer
|
static inline gpointer
|
||||||
deconst_plugin(const struct decoder_plugin *plugin)
|
deconst_plugin(const struct DecoderPlugin *plugin)
|
||||||
{
|
{
|
||||||
return const_cast<struct decoder_plugin *>(plugin);
|
return const_cast<struct DecoderPlugin *>(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -192,7 +192,7 @@ decoder_run_stream_mime_type(struct decoder *decoder, struct input_stream *is,
|
||||||
{
|
{
|
||||||
assert(tried_r != nullptr);
|
assert(tried_r != nullptr);
|
||||||
|
|
||||||
const struct decoder_plugin *plugin;
|
const struct DecoderPlugin *plugin;
|
||||||
unsigned int next = 0;
|
unsigned int next = 0;
|
||||||
|
|
||||||
if (is->mime.empty())
|
if (is->mime.empty())
|
||||||
|
@ -229,7 +229,7 @@ decoder_run_stream_suffix(struct decoder *decoder, struct input_stream *is,
|
||||||
assert(tried_r != nullptr);
|
assert(tried_r != nullptr);
|
||||||
|
|
||||||
const char *suffix = uri_get_suffix(uri);
|
const char *suffix = uri_get_suffix(uri);
|
||||||
const struct decoder_plugin *plugin = nullptr;
|
const struct DecoderPlugin *plugin = nullptr;
|
||||||
|
|
||||||
if (suffix == nullptr)
|
if (suffix == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
@ -257,7 +257,7 @@ decoder_run_stream_suffix(struct decoder *decoder, struct input_stream *is,
|
||||||
static bool
|
static bool
|
||||||
decoder_run_stream_fallback(struct decoder *decoder, struct input_stream *is)
|
decoder_run_stream_fallback(struct decoder *decoder, struct input_stream *is)
|
||||||
{
|
{
|
||||||
const struct decoder_plugin *plugin;
|
const struct DecoderPlugin *plugin;
|
||||||
|
|
||||||
plugin = decoder_plugin_from_name("mad");
|
plugin = decoder_plugin_from_name("mad");
|
||||||
return plugin != nullptr && plugin->stream_decode != nullptr &&
|
return plugin != nullptr && plugin->stream_decode != nullptr &&
|
||||||
|
@ -326,7 +326,7 @@ decoder_run_file(struct decoder *decoder, const char *path_fs)
|
||||||
{
|
{
|
||||||
decoder_control &dc = decoder->dc;
|
decoder_control &dc = decoder->dc;
|
||||||
const char *suffix = uri_get_suffix(path_fs);
|
const char *suffix = uri_get_suffix(path_fs);
|
||||||
const struct decoder_plugin *plugin = nullptr;
|
const struct DecoderPlugin *plugin = nullptr;
|
||||||
|
|
||||||
if (suffix == nullptr)
|
if (suffix == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -83,7 +83,7 @@ bool
|
||||||
Song::UpdateFile()
|
Song::UpdateFile()
|
||||||
{
|
{
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
const struct decoder_plugin *plugin;
|
const struct DecoderPlugin *plugin;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct input_stream *is = nullptr;
|
struct input_stream *is = nullptr;
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ bool
|
||||||
Song::UpdateFileInArchive()
|
Song::UpdateFileInArchive()
|
||||||
{
|
{
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
const struct decoder_plugin *plugin;
|
const struct DecoderPlugin *plugin;
|
||||||
|
|
||||||
assert(IsFile());
|
assert(IsFile());
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ tag_file_scan(const char *path_fs,
|
||||||
if (suffix == nullptr)
|
if (suffix == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const struct decoder_plugin *plugin =
|
const struct DecoderPlugin *plugin =
|
||||||
decoder_plugin_from_suffix(suffix, nullptr);
|
decoder_plugin_from_suffix(suffix, nullptr);
|
||||||
if (plugin == nullptr)
|
if (plugin == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -68,7 +68,7 @@ bool
|
||||||
update_container_file(Directory &directory,
|
update_container_file(Directory &directory,
|
||||||
const char *name,
|
const char *name,
|
||||||
const struct stat *st,
|
const struct stat *st,
|
||||||
const decoder_plugin &plugin)
|
const DecoderPlugin &plugin)
|
||||||
{
|
{
|
||||||
if (plugin.container_scan == nullptr)
|
if (plugin.container_scan == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,12 +25,12 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
struct Directory;
|
struct Directory;
|
||||||
struct decoder_plugin;
|
struct DecoderPlugin;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
update_container_file(Directory &directory,
|
update_container_file(Directory &directory,
|
||||||
const char *name,
|
const char *name,
|
||||||
const struct stat *st,
|
const struct stat *st,
|
||||||
const decoder_plugin &plugin);
|
const DecoderPlugin &plugin);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
static void
|
static void
|
||||||
update_song_file2(Directory &directory,
|
update_song_file2(Directory &directory,
|
||||||
const char *name, const struct stat *st,
|
const char *name, const struct stat *st,
|
||||||
const decoder_plugin &plugin)
|
const DecoderPlugin &plugin)
|
||||||
{
|
{
|
||||||
db_lock();
|
db_lock();
|
||||||
Song *song = directory.FindSong(name);
|
Song *song = directory.FindSong(name);
|
||||||
|
@ -106,7 +106,7 @@ update_song_file(Directory &directory,
|
||||||
const char *name, const char *suffix,
|
const char *name, const char *suffix,
|
||||||
const struct stat *st)
|
const struct stat *st)
|
||||||
{
|
{
|
||||||
const struct decoder_plugin *plugin =
|
const struct DecoderPlugin *plugin =
|
||||||
decoder_plugin_from_suffix(suffix, nullptr);
|
decoder_plugin_from_suffix(suffix, nullptr);
|
||||||
if (plugin == nullptr)
|
if (plugin == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -127,7 +127,7 @@ static const char *const adplug_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin adplug_decoder_plugin = {
|
const struct DecoderPlugin adplug_decoder_plugin = {
|
||||||
"adplug",
|
"adplug",
|
||||||
adplug_init,
|
adplug_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_ADPLUG_H
|
#ifndef MPD_DECODER_ADPLUG_H
|
||||||
#define MPD_DECODER_ADPLUG_H
|
#define MPD_DECODER_ADPLUG_H
|
||||||
|
|
||||||
extern const struct decoder_plugin adplug_decoder_plugin;
|
extern const struct DecoderPlugin adplug_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -253,7 +253,7 @@ static const char *const audiofile_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin audiofile_decoder_plugin = {
|
const struct DecoderPlugin audiofile_decoder_plugin = {
|
||||||
"audiofile",
|
"audiofile",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_AUDIOFILE_HXX
|
#ifndef MPD_DECODER_AUDIOFILE_HXX
|
||||||
#define MPD_DECODER_AUDIOFILE_HXX
|
#define MPD_DECODER_AUDIOFILE_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin audiofile_decoder_plugin;
|
extern const struct DecoderPlugin audiofile_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -514,7 +514,7 @@ static const char *const dsdiff_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin dsdiff_decoder_plugin = {
|
const struct DecoderPlugin dsdiff_decoder_plugin = {
|
||||||
"dsdiff",
|
"dsdiff",
|
||||||
dsdiff_init,
|
dsdiff_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_DSDIFF_H
|
#ifndef MPD_DECODER_DSDIFF_H
|
||||||
#define MPD_DECODER_DSDIFF_H
|
#define MPD_DECODER_DSDIFF_H
|
||||||
|
|
||||||
extern const struct decoder_plugin dsdiff_decoder_plugin;
|
extern const struct DecoderPlugin dsdiff_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -345,7 +345,7 @@ static const char *const dsf_mime_types[] = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin dsf_decoder_plugin = {
|
const struct DecoderPlugin dsf_decoder_plugin = {
|
||||||
"dsf",
|
"dsf",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_DSF_H
|
#ifndef MPD_DECODER_DSF_H
|
||||||
#define MPD_DECODER_DSF_H
|
#define MPD_DECODER_DSF_H
|
||||||
|
|
||||||
extern const struct decoder_plugin dsf_decoder_plugin;
|
extern const struct DecoderPlugin dsf_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -481,7 +481,7 @@ static const char *const faad_mime_types[] = {
|
||||||
"audio/aac", "audio/aacp", nullptr
|
"audio/aac", "audio/aacp", nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin faad_decoder_plugin = {
|
const struct DecoderPlugin faad_decoder_plugin = {
|
||||||
"faad",
|
"faad",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_FAAD_DECODER_PLUGIN_HXX
|
#ifndef MPD_FAAD_DECODER_PLUGIN_HXX
|
||||||
#define MPD_FAAD_DECODER_PLUGIN_HXX
|
#define MPD_FAAD_DECODER_PLUGIN_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin faad_decoder_plugin;
|
extern const struct DecoderPlugin faad_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -667,7 +667,7 @@ static const char *const ffmpeg_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin ffmpeg_decoder_plugin = {
|
const struct DecoderPlugin ffmpeg_decoder_plugin = {
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
ffmpeg_init,
|
ffmpeg_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_FFMPEG_HXX
|
#ifndef MPD_DECODER_FFMPEG_HXX
|
||||||
#define MPD_DECODER_FFMPEG_HXX
|
#define MPD_DECODER_FFMPEG_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin ffmpeg_decoder_plugin;
|
extern const struct DecoderPlugin ffmpeg_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -355,7 +355,7 @@ static const char *const oggflac_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin oggflac_decoder_plugin = {
|
const struct DecoderPlugin oggflac_decoder_plugin = {
|
||||||
"oggflac",
|
"oggflac",
|
||||||
oggflac_init,
|
oggflac_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
@ -377,7 +377,7 @@ static const char *const flac_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin flac_decoder_plugin = {
|
const struct DecoderPlugin flac_decoder_plugin = {
|
||||||
"flac",
|
"flac",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef MPD_DECODER_FLAC_H
|
#ifndef MPD_DECODER_FLAC_H
|
||||||
#define MPD_DECODER_FLAC_H
|
#define MPD_DECODER_FLAC_H
|
||||||
|
|
||||||
extern const struct decoder_plugin flac_decoder_plugin;
|
extern const struct DecoderPlugin flac_decoder_plugin;
|
||||||
extern const struct decoder_plugin oggflac_decoder_plugin;
|
extern const struct DecoderPlugin oggflac_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -210,7 +210,7 @@ static const char *const fluidsynth_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin fluidsynth_decoder_plugin = {
|
const struct DecoderPlugin fluidsynth_decoder_plugin = {
|
||||||
"fluidsynth",
|
"fluidsynth",
|
||||||
fluidsynth_init,
|
fluidsynth_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_FLUIDSYNTH_HXX
|
#ifndef MPD_DECODER_FLUIDSYNTH_HXX
|
||||||
#define MPD_DECODER_FLUIDSYNTH_HXX
|
#define MPD_DECODER_FLUIDSYNTH_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin fluidsynth_decoder_plugin;
|
extern const struct DecoderPlugin fluidsynth_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -279,8 +279,8 @@ static const char *const gme_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const struct decoder_plugin gme_decoder_plugin;
|
extern const struct DecoderPlugin gme_decoder_plugin;
|
||||||
const struct decoder_plugin gme_decoder_plugin = {
|
const struct DecoderPlugin gme_decoder_plugin = {
|
||||||
"gme",
|
"gme",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_GME_HXX
|
#ifndef MPD_DECODER_GME_HXX
|
||||||
#define MPD_DECODER_GME_HXX
|
#define MPD_DECODER_GME_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin gme_decoder_plugin;
|
extern const struct DecoderPlugin gme_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1171,7 +1171,7 @@ mad_decoder_scan_stream(struct input_stream *is,
|
||||||
static const char *const mp3_suffixes[] = { "mp3", "mp2", nullptr };
|
static const char *const mp3_suffixes[] = { "mp3", "mp2", nullptr };
|
||||||
static const char *const mp3_mime_types[] = { "audio/mpeg", nullptr };
|
static const char *const mp3_mime_types[] = { "audio/mpeg", nullptr };
|
||||||
|
|
||||||
const struct decoder_plugin mad_decoder_plugin = {
|
const struct DecoderPlugin mad_decoder_plugin = {
|
||||||
"mad",
|
"mad",
|
||||||
mp3_plugin_init,
|
mp3_plugin_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_MAD_HXX
|
#ifndef MPD_DECODER_MAD_HXX
|
||||||
#define MPD_DECODER_MAD_HXX
|
#define MPD_DECODER_MAD_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin mad_decoder_plugin;
|
extern const struct DecoderPlugin mad_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -234,7 +234,7 @@ static const char *const mikmod_decoder_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin mikmod_decoder_plugin = {
|
const struct DecoderPlugin mikmod_decoder_plugin = {
|
||||||
"mikmod",
|
"mikmod",
|
||||||
mikmod_decoder_init,
|
mikmod_decoder_init,
|
||||||
mikmod_decoder_finish,
|
mikmod_decoder_finish,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_MIKMOD_HXX
|
#ifndef MPD_DECODER_MIKMOD_HXX
|
||||||
#define MPD_DECODER_MIKMOD_HXX
|
#define MPD_DECODER_MIKMOD_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin mikmod_decoder_plugin;
|
extern const struct DecoderPlugin mikmod_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -200,7 +200,7 @@ static const char *const mod_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin modplug_decoder_plugin = {
|
const struct DecoderPlugin modplug_decoder_plugin = {
|
||||||
"modplug",
|
"modplug",
|
||||||
modplug_decoder_init,
|
modplug_decoder_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_MODPLUG_HXX
|
#ifndef MPD_DECODER_MODPLUG_HXX
|
||||||
#define MPD_DECODER_MODPLUG_HXX
|
#define MPD_DECODER_MODPLUG_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin modplug_decoder_plugin;
|
extern const struct DecoderPlugin modplug_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -267,7 +267,7 @@ mpcdec_scan_stream(struct input_stream *is,
|
||||||
|
|
||||||
static const char *const mpcdec_suffixes[] = { "mpc", nullptr };
|
static const char *const mpcdec_suffixes[] = { "mpc", nullptr };
|
||||||
|
|
||||||
const struct decoder_plugin mpcdec_decoder_plugin = {
|
const struct DecoderPlugin mpcdec_decoder_plugin = {
|
||||||
"mpcdec",
|
"mpcdec",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_MPCDEC_HXX
|
#ifndef MPD_DECODER_MPCDEC_HXX
|
||||||
#define MPD_DECODER_MPCDEC_HXX
|
#define MPD_DECODER_MPCDEC_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin mpcdec_decoder_plugin;
|
extern const struct DecoderPlugin mpcdec_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -241,7 +241,7 @@ static const char *const mpg123_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin mpg123_decoder_plugin = {
|
const struct DecoderPlugin mpg123_decoder_plugin = {
|
||||||
"mpg123",
|
"mpg123",
|
||||||
mpd_mpg123_init,
|
mpd_mpg123_init,
|
||||||
mpd_mpg123_finish,
|
mpd_mpg123_finish,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_MPG123_HXX
|
#ifndef MPD_DECODER_MPG123_HXX
|
||||||
#define MPD_DECODER_MPG123_HXX
|
#define MPD_DECODER_MPG123_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin mpg123_decoder_plugin;
|
extern const struct DecoderPlugin mpg123_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -389,7 +389,7 @@ static const char *const opus_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin opus_decoder_plugin = {
|
const struct DecoderPlugin opus_decoder_plugin = {
|
||||||
"opus",
|
"opus",
|
||||||
mpd_opus_init,
|
mpd_opus_init,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_OPUS_H
|
#ifndef MPD_DECODER_OPUS_H
|
||||||
#define MPD_DECODER_OPUS_H
|
#define MPD_DECODER_OPUS_H
|
||||||
|
|
||||||
extern const struct decoder_plugin opus_decoder_plugin;
|
extern const struct DecoderPlugin opus_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -100,7 +100,7 @@ static const char *const pcm_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin pcm_decoder_plugin = {
|
const struct DecoderPlugin pcm_decoder_plugin = {
|
||||||
"pcm",
|
"pcm",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -28,6 +28,6 @@
|
||||||
#ifndef MPD_DECODER_PCM_HXX
|
#ifndef MPD_DECODER_PCM_HXX
|
||||||
#define MPD_DECODER_PCM_HXX
|
#define MPD_DECODER_PCM_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin pcm_decoder_plugin;
|
extern const struct DecoderPlugin pcm_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -420,8 +420,8 @@ static const char *const sidplay_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const struct decoder_plugin sidplay_decoder_plugin;
|
extern const struct DecoderPlugin sidplay_decoder_plugin;
|
||||||
const struct decoder_plugin sidplay_decoder_plugin = {
|
const struct DecoderPlugin sidplay_decoder_plugin = {
|
||||||
"sidplay",
|
"sidplay",
|
||||||
sidplay_init,
|
sidplay_init,
|
||||||
sidplay_finish,
|
sidplay_finish,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_SIDPLAY_HXX
|
#ifndef MPD_DECODER_SIDPLAY_HXX
|
||||||
#define MPD_DECODER_SIDPLAY_HXX
|
#define MPD_DECODER_SIDPLAY_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin sidplay_decoder_plugin;
|
extern const struct DecoderPlugin sidplay_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -246,7 +246,7 @@ static const char *const sndfile_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin sndfile_decoder_plugin = {
|
const struct DecoderPlugin sndfile_decoder_plugin = {
|
||||||
"sndfile",
|
"sndfile",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_SNDFILE_HXX
|
#ifndef MPD_DECODER_SNDFILE_HXX
|
||||||
#define MPD_DECODER_SNDFILE_HXX
|
#define MPD_DECODER_SNDFILE_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin sndfile_decoder_plugin;
|
extern const struct DecoderPlugin sndfile_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -338,7 +338,7 @@ static const char *const vorbis_mime_types[] = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin vorbis_decoder_plugin = {
|
const struct DecoderPlugin vorbis_decoder_plugin = {
|
||||||
"vorbis",
|
"vorbis",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_VORBIS_H
|
#ifndef MPD_DECODER_VORBIS_H
|
||||||
#define MPD_DECODER_VORBIS_H
|
#define MPD_DECODER_VORBIS_H
|
||||||
|
|
||||||
extern const struct decoder_plugin vorbis_decoder_plugin;
|
extern const struct DecoderPlugin vorbis_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -585,7 +585,7 @@ static char const *const wavpack_mime_types[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin wavpack_decoder_plugin = {
|
const struct DecoderPlugin wavpack_decoder_plugin = {
|
||||||
"wavpack",
|
"wavpack",
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_WAVPACK_HXX
|
#ifndef MPD_DECODER_WAVPACK_HXX
|
||||||
#define MPD_DECODER_WAVPACK_HXX
|
#define MPD_DECODER_WAVPACK_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin wavpack_decoder_plugin;
|
extern const struct DecoderPlugin wavpack_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -144,7 +144,7 @@ static const char *const wildmidi_suffixes[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin wildmidi_decoder_plugin = {
|
const struct DecoderPlugin wildmidi_decoder_plugin = {
|
||||||
"wildmidi",
|
"wildmidi",
|
||||||
wildmidi_init,
|
wildmidi_init,
|
||||||
wildmidi_finish,
|
wildmidi_finish,
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
#ifndef MPD_DECODER_WILDMIDI_HXX
|
#ifndef MPD_DECODER_WILDMIDI_HXX
|
||||||
#define MPD_DECODER_WILDMIDI_HXX
|
#define MPD_DECODER_WILDMIDI_HXX
|
||||||
|
|
||||||
extern const struct decoder_plugin wildmidi_decoder_plugin;
|
extern const struct DecoderPlugin wildmidi_decoder_plugin;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -145,7 +145,7 @@ static const struct tag_handler print_handler = {
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *decoder_name, *path;
|
const char *decoder_name, *path;
|
||||||
const struct decoder_plugin *plugin;
|
const struct DecoderPlugin *plugin;
|
||||||
|
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
/* initialize locale */
|
/* initialize locale */
|
||||||
|
|
|
@ -48,7 +48,7 @@ my_log_func(const gchar *log_domain, gcc_unused GLogLevelFlags log_level,
|
||||||
struct decoder {
|
struct decoder {
|
||||||
const char *uri;
|
const char *uri;
|
||||||
|
|
||||||
const struct decoder_plugin *plugin;
|
const struct DecoderPlugin *plugin;
|
||||||
|
|
||||||
bool initialized;
|
bool initialized;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue