From 292fec2a0bd1f221a46ad69c5100995d04c01057 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 6 Jul 2003 20:49:52 +0000 Subject: New mimetypes gone into effect today - this commit changes all old mimetypes over to the new mimetypes spec as descri... Original commit message from CVS: New mimetypes gone into effect today - this commit changes all old mimetypes over to the new mimetypes spec as described in the previous commit's document. Note: some plugins will break, some pipelines will break, expect HEAD to be broken or at least not 100% working for a few days, but don't forget to report bugs --- ext/flac/gstflac.c | 17 +++++++++-------- ext/flac/gstflacdec.c | 4 +--- ext/flac/gstflacenc.c | 12 +++++++++++- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'ext/flac') diff --git a/ext/flac/gstflac.c b/ext/flac/gstflac.c index e955c2cc..af10d794 100644 --- a/ext/flac/gstflac.c +++ b/ext/flac/gstflac.c @@ -37,8 +37,11 @@ flac_caps_factory (void) return gst_caps_new ( "flac_flac", - "application/x-flac", - NULL); + "audio/x-flac", + /*gst_props_new ( + "rate", GST_PROPS_INT_RANGE (11025, 48000), + "channels", GST_PROPS_INT_RANGE (1, 2), + NULL)*/ NULL); } static GstCaps* @@ -47,10 +50,8 @@ raw_caps_factory (void) return gst_caps_new ( "flac_raw", - "audio/raw", + "audio/x-raw-int", gst_props_new ( - "format", GST_PROPS_STRING ("int"), - "law", GST_PROPS_INT (0), "endianness", GST_PROPS_INT (G_BYTE_ORDER), "signed", GST_PROPS_BOOLEAN (TRUE), "width", GST_PROPS_INT (16), @@ -61,8 +62,8 @@ raw_caps_factory (void) } static GstTypeDefinition flacdefinition = { - "flac_application/x-flac", - "application/x-flac", + "flac_audio/x-flac", + "audio/x-flac", ".flac", flac_type_find, }; @@ -75,7 +76,7 @@ flac_type_find (GstBuffer *buf, gpointer private) if (head != 0x664C6143) return NULL; - return gst_caps_new ("flac_type_find", "application/x-flac", NULL); + return gst_caps_new ("flac_type_find", "audio/x-flac", NULL); } diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index b439f044..c11be9f6 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -460,9 +460,7 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder, gst_pad_try_set_caps (flacdec->srcpad, GST_CAPS_NEW ( "flac_caps", - "audio/raw", - "format", GST_PROPS_STRING ("int"), - "law", GST_PROPS_INT (0), + "audio/x-raw-int", "endianness", GST_PROPS_INT (G_BYTE_ORDER), "signed", GST_PROPS_BOOLEAN (TRUE), "width", GST_PROPS_INT (depth), diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index aa1a0195..ef9e5386 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -325,6 +325,7 @@ gst_flacenc_dispose (GObject *object) static GstPadLinkReturn gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps) { + GstPadLinkReturn ret; FlacEnc *flacenc; flacenc = GST_FLACENC (gst_pad_get_parent (pad)); @@ -336,6 +337,15 @@ gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps) gst_caps_get_int (caps, "depth", &flacenc->depth); gst_caps_get_int (caps, "rate", &flacenc->sample_rate); + caps = GST_CAPS_NEW ("flacenc_srccaps", + "audio/x-flac", + "channels", GST_PROPS_INT (flacenc->channels), + "rate", GST_PROPS_INT (flacenc->sample_rate)); + ret = gst_pad_try_set_caps (flacenc->srcpad, caps); + if (ret <= 0) { + return ret; + } + FLAC__seekable_stream_encoder_set_bits_per_sample (flacenc->encoder, flacenc->depth); FLAC__seekable_stream_encoder_set_sample_rate (flacenc->encoder, @@ -345,7 +355,7 @@ gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps) flacenc->negotiated = TRUE; - return GST_PAD_LINK_OK; + return ret; } static gboolean -- cgit