diff options
Diffstat (limited to 'src/encoder/EncoderPlugin.hxx')
-rw-r--r-- | src/encoder/EncoderPlugin.hxx | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/src/encoder/EncoderPlugin.hxx b/src/encoder/EncoderPlugin.hxx index 851f233f2..de37f6d35 100644 --- a/src/encoder/EncoderPlugin.hxx +++ b/src/encoder/EncoderPlugin.hxx @@ -20,44 +20,25 @@ #ifndef MPD_ENCODER_PLUGIN_HXX #define MPD_ENCODER_PLUGIN_HXX -#include <stddef.h> - -struct Encoder; +struct PreparedEncoder; +class Encoder; struct AudioFormat; struct ConfigBlock; -struct Tag; class Error; struct EncoderPlugin { const char *name; - Encoder *(*init)(const ConfigBlock &block, - Error &error); - - void (*finish)(Encoder *encoder); - - bool (*open)(Encoder *encoder, - AudioFormat &audio_format, - Error &error); - - void (*close)(Encoder *encoder); + PreparedEncoder *(*init)(const ConfigBlock &block, + Error &error); - bool (*end)(Encoder *encoder, Error &error); + void (*finish)(PreparedEncoder *encoder); - bool (*flush)(Encoder *encoder, Error &error); - - bool (*pre_tag)(Encoder *encoder, Error &error); - - bool (*tag)(Encoder *encoder, const Tag &tag, - Error &error); - - bool (*write)(Encoder *encoder, - const void *data, size_t length, - Error &error); - - size_t (*read)(Encoder *encoder, void *dest, size_t length); + Encoder *(*open)(PreparedEncoder *encoder, + AudioFormat &audio_format, + Error &error); - const char *(*get_mime_type)(Encoder *encoder); + const char *(*get_mime_type)(PreparedEncoder *encoder); }; /** @@ -67,7 +48,7 @@ struct EncoderPlugin { * @param error location to store the error occurring, or nullptr to ignore errors. * @return an encoder object on success, nullptr on failure */ -static inline Encoder * +static inline PreparedEncoder * encoder_init(const EncoderPlugin &plugin, const ConfigBlock &block, Error &error) { |