diff options
Diffstat (limited to 'src/encoder_plugin.h')
-rw-r--r-- | src/encoder_plugin.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/encoder_plugin.h b/src/encoder_plugin.h index 958fe97cf..13fb231f4 100644 --- a/src/encoder_plugin.h +++ b/src/encoder_plugin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2009 The Music Player Daemon Project + * Copyright (C) 2003-2010 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -58,6 +58,8 @@ struct encoder_plugin { GError **error); size_t (*read)(struct encoder *encoder, void *dest, size_t length); + + const char *(*get_mime_type)(struct encoder *encoder); }; /** @@ -192,4 +194,19 @@ encoder_read(struct encoder *encoder, void *dest, size_t length) return encoder->plugin->read(encoder, dest, length); } +/** + * Get mime type of encoded content. + * + * @param plugin the encoder plugin + * @return an constant string, NULL on failure + */ +static inline const char * +encoder_get_mime_type(struct encoder *encoder) +{ + /* this method is optional */ + return encoder->plugin->get_mime_type != NULL + ? encoder->plugin->get_mime_type(encoder) + : NULL; +} + #endif |