aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/encoder_plugin.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/encoder_plugin.h b/src/encoder_plugin.h
index 958fe97cf..e8f2e4527 100644
--- a/src/encoder_plugin.h
+++ b/src/encoder_plugin.h
@@ -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