encoders: implement new get_mime_types method

This commit is contained in:
Viliam Mateicka 2009-12-03 20:11:32 +01:00
parent 6d11711a01
commit 7b80e73810
5 changed files with 45 additions and 0 deletions

View File

@ -332,6 +332,14 @@ flac_encoder_read(struct encoder *_encoder, void *dest, size_t length)
return length;
}
static const char *flac_encoder_mime_type = "audio/flac";
static const char *
flac_encoder_get_mime_type(G_GNUC_UNUSED struct encoder *_encoder)
{
return flac_encoder_mime_type;
}
const struct encoder_plugin flac_encoder_plugin = {
.name = "flac",
.init = flac_encoder_init,
@ -341,5 +349,6 @@ const struct encoder_plugin flac_encoder_plugin = {
.flush = flac_encoder_flush,
.write = flac_encoder_write,
.read = flac_encoder_read,
.get_mime_type = flac_encoder_get_mime_type,
};

View File

@ -275,6 +275,14 @@ lame_encoder_read(struct encoder *_encoder, void *dest, size_t length)
return length;
}
static const char *lame_encoder_mime_type = "audio/mpeg";
static const char *
lame_encoder_get_mime_type(G_GNUC_UNUSED struct encoder *_encoder)
{
return lame_encoder_mime_type;
}
const struct encoder_plugin lame_encoder_plugin = {
.name = "lame",
.init = lame_encoder_init,
@ -283,4 +291,5 @@ const struct encoder_plugin lame_encoder_plugin = {
.close = lame_encoder_close,
.write = lame_encoder_write,
.read = lame_encoder_read,
.get_mime_type = lame_encoder_get_mime_type,
};

View File

@ -288,6 +288,14 @@ twolame_encoder_read(struct encoder *_encoder, void *dest, size_t length)
return length;
}
static const char *twolame_encoder_mime_type = "audio/mpeg";
static const char *
twolame_encoder_get_mime_type(G_GNUC_UNUSED struct encoder *_encoder)
{
return twolame_encoder_mime_type;
}
const struct encoder_plugin twolame_encoder_plugin = {
.name = "twolame",
.init = twolame_encoder_init,
@ -297,4 +305,5 @@ const struct encoder_plugin twolame_encoder_plugin = {
.flush = twolame_encoder_flush,
.write = twolame_encoder_write,
.read = twolame_encoder_read,
.get_mime_type = twolame_encoder_get_mime_type,
};

View File

@ -382,6 +382,14 @@ vorbis_encoder_read(struct encoder *_encoder, void *_dest, size_t length)
return nbytes;
}
static const char *vorbis_encoder_mime_type = "application/x-ogg";
static const char *
vorbis_encoder_get_mime_type(G_GNUC_UNUSED struct encoder *_encoder)
{
return vorbis_encoder_mime_type;
}
const struct encoder_plugin vorbis_encoder_plugin = {
.name = "vorbis",
.init = vorbis_encoder_init,
@ -392,4 +400,5 @@ const struct encoder_plugin vorbis_encoder_plugin = {
.tag = vorbis_encoder_tag,
.write = vorbis_encoder_write,
.read = vorbis_encoder_read,
.get_mime_type = vorbis_encoder_get_mime_type,
};

View File

@ -253,6 +253,14 @@ wave_encoder_read(struct encoder *_encoder, void *dest, size_t length)
return length;
}
static const char *wave_encoder_mime_type = "audio/wav";
static const char *
wave_encoder_get_mime_type(G_GNUC_UNUSED struct encoder *_encoder)
{
return wave_encoder_mime_type;
}
const struct encoder_plugin wave_encoder_plugin = {
.name = "wave",
.init = wave_encoder_init,
@ -260,4 +268,5 @@ const struct encoder_plugin wave_encoder_plugin = {
.open = wave_encoder_open,
.write = wave_encoder_write,
.read = wave_encoder_read,
.get_mime_type = wave_encoder_get_mime_type,
};