+2008-07-27 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+ * ext/lame/gstlame.c: (gst_lame_sink_setcaps):
+ * gst/mpegaudioparse/gstmpegaudioparse.c:
+ (mp3_type_frame_length_from_header), (mp3_caps_create),
+ (gst_mp3parse_chain):
+ Put the MPEG audio version into the caps as "mpegaudioversion".
+ This is different from "mpegversion".
+
2008-07-22 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* ext/lame/gstlame.c: (gst_lame_class_init), (gst_lame_init),
{
GstLame *lame;
gint out_samplerate;
+ gint version;
GstStructure *structure;
GstCaps *othercaps;
out_samplerate, lame->samplerate);
}
+ version = lame_get_version (lame->lgf);
+ if (version == 0)
+ version = 2;
+ else if (version == 1)
+ version = 1;
+ else if (version == 2)
+ version = 3;
+
othercaps =
gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1,
+ "mpegaudioversion", G_TYPE_INT, version,
"layer", G_TYPE_INT, 3,
"channels", G_TYPE_INT, lame->mode == MONO ? 1 : lame->num_channels,
"rate", G_TYPE_INT, out_samplerate, NULL);
guint * put_crc)
{
guint length;
-
gulong mode, samplerate, bitrate, layer, channels, padding, crc;
-
+ gulong version;
gint lsf, mpg25;
GEnumValue *mode_enum;
mpg25 = 1;
}
+ version = 1 + lsf + mpg25;
+
layer = 4 - ((header >> 17) & 0x3);
crc = (header >> 16) & 0x1;
GST_DEBUG_OBJECT (mp3parse, "Calculated mp3 frame length of %u bytes",
length);
- GST_DEBUG_OBJECT (mp3parse, "samplerate = %lu, bitrate = %lu, layer = %lu, "
- "channels = %lu, mode = %s", samplerate, bitrate, layer, channels,
- mode_enum->value_nick);
+ GST_DEBUG_OBJECT (mp3parse, "samplerate = %lu, bitrate = %lu, version = %lu, "
+ "layer = %lu, channels = %lu, mode = %s", samplerate, bitrate, version,
+ layer, channels, mode_enum->value_nick);
if (put_version)
- *put_version = lsf ? 2 : 1;
+ *put_version = version;
if (put_layer)
*put_layer = layer;
if (put_channels)
}
static GstCaps *
-mp3_caps_create (guint layer, guint channels, guint samplerate)
+mp3_caps_create (guint version, guint layer, guint channels, guint samplerate)
{
GstCaps *new;
+ g_assert (version);
g_assert (layer);
g_assert (samplerate);
g_assert (channels);
new = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1,
+ "mpegaudioversion", G_TYPE_INT, version,
"layer", G_TYPE_INT, layer,
"rate", G_TYPE_INT, samplerate,
"channels", G_TYPE_INT, channels, "parsed", G_TYPE_BOOLEAN, TRUE, NULL);
}
if (channels != mp3parse->channels ||
- rate != mp3parse->rate || layer != mp3parse->layer) {
+ rate != mp3parse->rate || layer != mp3parse->layer ||
+ version != mp3parse->version) {
GstCaps *caps;
- caps = mp3_caps_create (layer, channels, rate);
+ caps = mp3_caps_create (version, layer, channels, rate);
gst_pad_set_caps (mp3parse->srcpad, caps);
gst_caps_unref (caps);