From 8b8776f69c49dee77073e805b6d23fed1054c960 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 29 Apr 2004 00:00:25 +0000 Subject: New DTS decoder. Original commit message from CVS: * configure.ac: * ext/Makefile.am: * ext/dts/Makefile.am: * ext/dts/gstdtsdec.c: (gst_dtsdec_get_type), (gst_dtsdec_base_init), (gst_dtsdec_class_init), (gst_dtsdec_init), (gst_dtsdec_channels), (gst_dtsdec_renegotiate), (gst_dtsdec_handle_event), (gst_dtsdec_update_streaminfo), (gst_dtsdec_loop), (gst_dtsdec_change_state), (gst_dtsdec_set_property), (gst_dtsdec_get_property), (plugin_init): * ext/dts/gstdtsdec.h: New DTS decoder. * ext/faad/gstfaad.c: (gst_faad_sinkconnect), (gst_faad_srcconnect): Add ESDS atom handling (.m4a). --- ext/faad/gstfaad.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'ext/faad/gstfaad.c') diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c index 719fb89d..6c526c32 100644 --- a/ext/faad/gstfaad.c +++ b/ext/faad/gstfaad.c @@ -146,8 +146,33 @@ gst_faad_init (GstFaad * faad) static GstPadLinkReturn gst_faad_sinkconnect (GstPad * pad, const GstCaps * caps) { - /* oh, we really don't care what's in here. We'll - * get AAC audio (MPEG-2/4) anyway, so why bother? */ + GstFaad *faad = GST_FAAD (gst_pad_get_parent (pad)); + GstStructure *str = gst_caps_get_structure (caps, 0); + const GValue *value; + GstBuffer *buf; + + if ((value = gst_structure_get_value (str, "codec_data"))) { + GstPadLinkReturn ret; + gulong samplerate; + guchar channels; + + buf = g_value_get_boxed (value); + if (faacDecInit2 (faad->handle, GST_BUFFER_DATA (buf), + GST_BUFFER_SIZE (buf), &samplerate, &channels) < 0) + return GST_PAD_LINK_REFUSED; + + faad->samplerate = samplerate; + faad->channels = channels; + + ret = gst_pad_renegotiate (faad->srcpad); + if (ret == GST_PAD_LINK_DELAYED) + ret = GST_PAD_LINK_OK; + + return ret; + } + + /* if there's no decoderspecificdata, it's all fine. We cannot know + * much more at this point... */ return GST_PAD_LINK_OK; } @@ -229,7 +254,7 @@ gst_faad_srcconnect (GstPad * pad, const GstCaps * caps) { GstStructure *structure; const gchar *mimetype; - gint fmt = 0; + gint fmt = -1; gint depth, rate, channels; GstFaad *faad = GST_FAAD (gst_pad_get_parent (pad)); @@ -282,7 +307,7 @@ gst_faad_srcconnect (GstPad * pad, const GstCaps * caps) } } - if (fmt) { + if (fmt != -1) { faacDecConfiguration *conf; conf = faacDecGetCurrentConfiguration (faad->handle); -- cgit v1.2.1