From 2c155599a12ddf1160836b52dc00a9bcfbd14f3c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 10 Jan 2006 11:04:21 +0000 Subject: [PATCH] gst/audiorate/gstaudiorate.c: Support float audio in audiorate. Original commit message from CVS: * gst/audiorate/gstaudiorate.c: (gst_audio_rate_setcaps): Support float audio in audiorate. Use width rather than depth for selecting sample width. --- ChangeLog | 6 ++++++ gst/audiorate/gstaudiorate.c | 16 +++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8977a6a..1942816 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-01-10 Michael Smith + + * gst/audiorate/gstaudiorate.c: (gst_audio_rate_setcaps): + Support float audio in audiorate. + Use width rather than depth for selecting sample width. + 2006-01-10 Tim-Philipp Müller * gst/videotestsrc/videotestsrc.h: diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c index 7eb8d9e..512fff0 100644 --- a/gst/audiorate/gstaudiorate.c +++ b/gst/audiorate/gstaudiorate.c @@ -87,17 +87,19 @@ enum }; static GstStaticPadTemplate gst_audio_rate_src_template = -GST_STATIC_PAD_TEMPLATE ("src", + GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS) + GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS ";" + GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate gst_audio_rate_sink_template = -GST_STATIC_PAD_TEMPLATE ("sink", + GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS) + GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS ";" + GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS) ); static void gst_audio_rate_base_init (gpointer g_class); @@ -191,7 +193,7 @@ gst_audio_rate_setcaps (GstPad * pad, GstCaps * caps) GstAudioRate *audiorate; GstStructure *structure; GstPad *otherpad; - gint ret, channels, depth; + gint ret, channels, width; audiorate = GST_AUDIO_RATE (gst_pad_get_parent (pad)); @@ -204,12 +206,12 @@ gst_audio_rate_setcaps (GstPad * pad, GstCaps * caps) structure = gst_caps_get_structure (caps, 0); ret = gst_structure_get_int (structure, "channels", &channels); - ret &= gst_structure_get_int (structure, "depth", &depth); + ret &= gst_structure_get_int (structure, "width", &width); if (!ret) return FALSE; - audiorate->bytes_per_sample = channels * (depth / 8); + audiorate->bytes_per_sample = channels * (width / 8); if (audiorate->bytes_per_sample == 0) audiorate->bytes_per_sample = 1; -- 2.7.4