aboutsummaryrefslogtreecommitdiff
path: root/src/decoder_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_plugin.h')
-rw-r--r--src/decoder_plugin.h190
1 files changed, 95 insertions, 95 deletions
diff --git a/src/decoder_plugin.h b/src/decoder_plugin.h
index 933ba675..e00d3383 100644
--- a/src/decoder_plugin.h
+++ b/src/decoder_plugin.h
@@ -35,74 +35,74 @@ struct tag_handler;
struct decoder;
struct decoder_plugin {
- const char *name;
-
- /**
- * Initialize the decoder plugin. Optional method.
- *
- * @param param a configuration block for this plugin, or NULL
- * if none is configured
- * @return true if the plugin was initialized successfully,
- * false if the plugin is not available
- */
- bool (*init)(const struct config_param *param);
-
- /**
- * Deinitialize a decoder plugin which was initialized
- * successfully. Optional method.
- */
- void (*finish)(void);
-
- /**
- * Decode a stream (data read from an #input_stream object).
- *
- * Either implement this method or file_decode(). If
- * possible, it is recommended to implement this method,
- * because it is more versatile.
- */
- void (*stream_decode)(struct decoder *decoder,
- struct input_stream *is);
-
- /**
- * Decode a local file.
- *
- * Either implement this method or stream_decode().
- */
- void (*file_decode)(struct decoder *decoder, const char *path_fs);
-
- /**
- * Scan metadata of a file.
- *
- * @return false if the operation has failed
- */
- bool (*scan_file)(const char *path_fs,
- const struct tag_handler *handler,
- void *handler_ctx);
-
- /**
- * Scan metadata of a file.
- *
- * @return false if the operation has failed
- */
- bool (*scan_stream)(struct input_stream *is,
- const struct tag_handler *handler,
- void *handler_ctx);
-
- /**
- * @brief Return a "virtual" filename for subtracks in
- * container formats like flac
- * @param const char* pathname full pathname for the file on fs
- * @param const unsigned int tnum track number
- *
- * @return NULL if there are no multiple files
- * a filename for every single track according to tnum (param 2)
- * do not include full pathname here, just the "virtual" file
- */
- char* (*container_scan)(const char *path_fs, const unsigned int tnum);
-
- /* last element in these arrays must always be a NULL: */
- const char *const*suffixes;
- const char *const*mime_types;
+ const char *name;
+
+ /**
+ * Initialize the decoder plugin. Optional method.
+ *
+ * @param param a configuration block for this plugin, or NULL
+ * if none is configured
+ * @return true if the plugin was initialized successfully,
+ * false if the plugin is not available
+ */
+ bool (*init)(const struct config_param *param);
+
+ /**
+ * Deinitialize a decoder plugin which was initialized
+ * successfully. Optional method.
+ */
+ void (*finish)(void);
+
+ /**
+ * Decode a stream (data read from an #input_stream object).
+ *
+ * Either implement this method or file_decode(). If
+ * possible, it is recommended to implement this method,
+ * because it is more versatile.
+ */
+ void (*stream_decode)(struct decoder *decoder,
+ struct input_stream *is);
+
+ /**
+ * Decode a local file.
+ *
+ * Either implement this method or stream_decode().
+ */
+ void (*file_decode)(struct decoder *decoder, const char *path_fs);
+
+ /**
+ * Scan metadata of a file.
+ *
+ * @return false if the operation has failed
+ */
+ bool (*scan_file)(const char *path_fs,
+ const struct tag_handler *handler,
+ void *handler_ctx);
+
+ /**
+ * Scan metadata of a file.
+ *
+ * @return false if the operation has failed
+ */
+ bool (*scan_stream)(struct input_stream *is,
+ const struct tag_handler *handler,
+ void *handler_ctx);
+
+ /**
+ * @brief Return a "virtual" filename for subtracks in
+ * container formats like flac
+ * @param const char* pathname full pathname for the file on fs
+ * @param const unsigned int tnum track number
+ *
+ * @return NULL if there are no multiple files
+ * a filename for every single track according to tnum (param 2)
+ * do not include full pathname here, just the "virtual" file
+ */
+ char* (*container_scan)(const char *path_fs, const unsigned int tnum);
+
+ /* last element in these arrays must always be a NULL: */
+ const char *const*suffixes;
+ const char *const*mime_types;
};
/**
@@ -115,11 +115,11 @@ struct decoder_plugin {
*/
static inline bool
decoder_plugin_init(const struct decoder_plugin *plugin,
- const struct config_param *param)
+ const struct config_param *param)
{
- return plugin->init != NULL
- ? plugin->init(param)
- : true;
+ return plugin->init != NULL
+ ? plugin->init(param)
+ : true;
}
/**
@@ -128,8 +128,8 @@ decoder_plugin_init(const struct decoder_plugin *plugin,
static inline void
decoder_plugin_finish(const struct decoder_plugin *plugin)
{
- if (plugin->finish != NULL)
- plugin->finish();
+ if (plugin->finish != NULL)
+ plugin->finish();
}
/**
@@ -137,9 +137,9 @@ decoder_plugin_finish(const struct decoder_plugin *plugin)
*/
static inline void
decoder_plugin_stream_decode(const struct decoder_plugin *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);
}
/**
@@ -147,9 +147,9 @@ decoder_plugin_stream_decode(const struct decoder_plugin *plugin,
*/
static inline void
decoder_plugin_file_decode(const struct decoder_plugin *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);
}
/**
@@ -157,12 +157,12 @@ decoder_plugin_file_decode(const struct decoder_plugin *plugin,
*/
static inline bool
decoder_plugin_scan_file(const struct decoder_plugin *plugin,
- const char *path_fs,
- const struct tag_handler *handler, void *handler_ctx)
+ const char *path_fs,
+ const struct tag_handler *handler, void *handler_ctx)
{
- return plugin->scan_file != NULL
- ? plugin->scan_file(path_fs, handler, handler_ctx)
- : false;
+ return plugin->scan_file != NULL
+ ? plugin->scan_file(path_fs, handler, handler_ctx)
+ : false;
}
/**
@@ -170,24 +170,24 @@ decoder_plugin_scan_file(const struct decoder_plugin *plugin,
*/
static inline bool
decoder_plugin_scan_stream(const struct decoder_plugin *plugin,
- struct input_stream *is,
- const struct tag_handler *handler,
- void *handler_ctx)
+ struct input_stream *is,
+ const struct tag_handler *handler,
+ void *handler_ctx)
{
- return plugin->scan_stream != NULL
- ? plugin->scan_stream(is, handler, handler_ctx)
- : false;
+ return plugin->scan_stream != NULL
+ ? plugin->scan_stream(is, handler, handler_ctx)
+ : false;
}
/**
* return "virtual" tracks in a container
*/
static inline char *
-decoder_plugin_container_scan( const struct decoder_plugin *plugin,
- const char* pathname,
- const unsigned int tnum)
+decoder_plugin_container_scan( const struct decoder_plugin *plugin,
+ const char* pathname,
+ const unsigned int tnum)
{
- return plugin->container_scan(pathname, tnum);
+ return plugin->container_scan(pathname, tnum);
}
/**
@@ -195,13 +195,13 @@ decoder_plugin_container_scan( const struct decoder_plugin *plugin,
*/
bool
decoder_plugin_supports_suffix(const struct decoder_plugin *plugin,
- const char *suffix);
+ const char *suffix);
/**
* Does the plugin announce the specified MIME type?
*/
bool
decoder_plugin_supports_mime_type(const struct decoder_plugin *plugin,
- const char *mime_type);
+ const char *mime_type);
#endif