gst/audiorate/gstaudiorate.c: Support float audio in audiorate.
authorMichael Smith <msmith@xiph.org>
Tue, 10 Jan 2006 11:04:21 +0000 (11:04 +0000)
committerMichael Smith <msmith@xiph.org>
Tue, 10 Jan 2006 11:04:21 +0000 (11:04 +0000)
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
gst/audiorate/gstaudiorate.c

index 8977a6a..1942816 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-10  Michael Smith  <msmith@fluendo.com>
+
+       * 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  <tim at centricular dot net>
 
        * gst/videotestsrc/videotestsrc.h:
index 7eb8d9e..512fff0 100644 (file)
@@ -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;