configure.ac: Depend on gstreamer-0.10.12.1. gst/equalizer/gstiirequalizer.c (ARG_BAN...
authorStefan Kost <ensonic@users.sourceforge.net>
Tue, 22 May 2007 11:14:13 +0000 (11:14 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Tue, 22 May 2007 11:14:13 +0000 (11:14 +0000)
Original commit message from CVS:
* configure.ac:
Depend on gstreamer-0.10.12.1.
* gst/equalizer/gstiirequalizer.c (ARG_BAND_WIDTH, _do_init, ARG_GAIN,
_GstIirEqualizerBand, object, _GstIirEqualizerBandClass,
parent_class, gst_iir_equalizer_band_set_property,
gst_iir_equalizer_band_class_init, gst_iir_equalizer_band_get_type,
gst_iir_equalizer_child_proxy_get_child_by_index,
gst_iir_equalizer_child_proxy_get_children_count,
gst_iir_equalizer_child_proxy_interface_init, setup_filter,
gst_iir_equalizer_compute_frequencies,
gst_iir_equalizer_set_property, gst_iir_equalizer_get_property,
plugin_init):
* gst/equalizer/gstiirequalizer.h (audiofilter):
* gst/equalizer/gstiirequalizernbands.c (ARG_NUM_BANDS,
gst_iir_equalizer_nbands_base_init, gst_iir_equalizer_nbands_init,
gst_iir_equalizer_nbands_set_property):
Use new locking macros.
* gst/filter/gstbpwsinc.c (bpwsinc_set_caps):
Add fixme.
* gst/spectrum/gstspectrum.c (SPECTRUM_WINDOW_BASE,
SPECTRUM_WINDOW_LEN, gst_spectrum_init, gst_spectrum_set_property,
gst_spectrum_event, gst_spectrum_transform_ip):
Use new locking macros. Turn two fixed values into #defines.

ChangeLog
configure.ac
gst/equalizer/gstiirequalizer.c
gst/equalizer/gstiirequalizer.h
gst/equalizer/gstiirequalizernbands.c
gst/filter/gstbpwsinc.c
gst/spectrum/gstspectrum.c

index 344232766d3f84201622a576fe9d651c274c602f..82fc00fc5da6c9c485c629704f84c4973e2ecd80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2007-05-22  Stefan Kost  <ensonic@users.sf.net>
+
+       * configure.ac:
+         Depend on gstreamer-0.10.12.1.
+       
+       * gst/equalizer/gstiirequalizer.c (ARG_BAND_WIDTH, _do_init, ARG_GAIN,
+         _GstIirEqualizerBand, object, _GstIirEqualizerBandClass,
+         parent_class, gst_iir_equalizer_band_set_property,
+         gst_iir_equalizer_band_class_init, gst_iir_equalizer_band_get_type,
+         gst_iir_equalizer_child_proxy_get_child_by_index,
+         gst_iir_equalizer_child_proxy_get_children_count,
+         gst_iir_equalizer_child_proxy_interface_init, setup_filter,
+         gst_iir_equalizer_compute_frequencies,
+         gst_iir_equalizer_set_property, gst_iir_equalizer_get_property,
+         plugin_init):
+       * gst/equalizer/gstiirequalizer.h (audiofilter):
+       * gst/equalizer/gstiirequalizernbands.c (ARG_NUM_BANDS,
+         gst_iir_equalizer_nbands_base_init, gst_iir_equalizer_nbands_init,
+         gst_iir_equalizer_nbands_set_property):
+         Use new locking macros.
+
+       * gst/filter/gstbpwsinc.c (bpwsinc_set_caps):
+         Add fixme.
+
+       * gst/spectrum/gstspectrum.c (SPECTRUM_WINDOW_BASE,
+         SPECTRUM_WINDOW_LEN, gst_spectrum_init, gst_spectrum_set_property,
+         gst_spectrum_event, gst_spectrum_transform_ip):
+         Use new locking macros. Turn two fixed values into #defines.
+
 2007-05-22  Edward Hervey  <edward@fluendo.com>
 
        * docs/plugins/Makefile.am:
index 92c6827e00781ea930bc93501571f83ff4bb0a8b..eaa379b44a8198c40b83003c7e311a87c68a67d9 100644 (file)
@@ -45,8 +45,8 @@ AM_PROG_LIBTOOL
 
 dnl *** required versions of GStreamer stuff ***
 dnl *** remove rtpmanager/equalizer stuff below when this is updated
-GST_REQ=0.10.12
-GSTPB_REQ=0.10.12
+GST_REQ=0.10.12.1
+GSTPB_REQ=0.10.12.1
 
 dnl *** autotools stuff ****
 
index db29adecb97ef267870a87c0f153d9497120278a..926b1e0a6bdff4be934fa703548505a9405d9d34 100644 (file)
@@ -433,7 +433,8 @@ gst_iir_equalizer_set_property (GObject * object, guint prop_id,
 {
   GstIirEqualizer *equ = GST_IIR_EQUALIZER (object);
 
-  GST_EQUALIZER_TRANSFORM_LOCK (equ);
+  g_mutex_lock (((GstBaseTransform *) (equ))->transform_lock);
+  //GST_BASE_TRANSFORM_LOCK (equ);
   GST_OBJECT_LOCK (equ);
   switch (prop_id) {
     case ARG_BAND_WIDTH:
@@ -453,7 +454,7 @@ gst_iir_equalizer_set_property (GObject * object, guint prop_id,
       break;
   }
   GST_OBJECT_UNLOCK (equ);
-  GST_EQUALIZER_TRANSFORM_UNLOCK (equ);
+  GST_BASE_TRANSFORM_UNLOCK (equ);
 }
 
 static void
@@ -462,7 +463,7 @@ gst_iir_equalizer_get_property (GObject * object, guint prop_id,
 {
   GstIirEqualizer *equ = GST_IIR_EQUALIZER (object);
 
-  GST_EQUALIZER_TRANSFORM_LOCK (equ);
+  GST_BASE_TRANSFORM_LOCK (equ);
   GST_OBJECT_LOCK (equ);
   switch (prop_id) {
     case ARG_BAND_WIDTH:
@@ -473,7 +474,7 @@ gst_iir_equalizer_get_property (GObject * object, guint prop_id,
       break;
   }
   GST_OBJECT_UNLOCK (equ);
-  GST_EQUALIZER_TRANSFORM_UNLOCK (equ);
+  GST_BASE_TRANSFORM_UNLOCK (equ);
 }
 
 /* start of code that is type specific */
index 03fe6a727b96f50dfee8a0b6a82bb207d77c0e37..558959c8febb280697cfbef65ad83151f831c1fc 100644 (file)
 #include <gst/audio/gstringbuffer.h>
 #include <gst/controller/gstcontroller.h>
 
-
-#define GST_EQUALIZER_TRANSFORM_LOCK(eq) \
-    g_mutex_lock (GST_BASE_TRANSFORM(eq)->transform_lock)
-
-#define GST_EQUALIZER_TRANSFORM_UNLOCK(eq) \
-    g_mutex_unlock (GST_BASE_TRANSFORM(eq)->transform_lock)
-
-
 typedef struct _GstIirEqualizer GstIirEqualizer;
 typedef struct _GstIirEqualizerClass GstIirEqualizerClass;
 typedef struct _GstIirEqualizerBand GstIirEqualizerBand;
@@ -59,7 +51,7 @@ struct _GstIirEqualizer
   GstAudioFilter audiofilter;
 
   /*< private >*/
-  
+
   GstIirEqualizerBand **bands;
 
   /* properties */
index 939085bb0f58d3a75207e2131c1f0ad3518820b1..c03ca01f7de25802d56233827da6b2133f3a4ed0 100644 (file)
@@ -103,7 +103,7 @@ gst_iir_equalizer_nbands_set_property (GObject * object, guint prop_id,
 {
   GstIirEqualizer *equ = GST_IIR_EQUALIZER (object);
 
-  GST_EQUALIZER_TRANSFORM_LOCK (equ);
+  GST_BASE_TRANSFORM_LOCK (equ);
   GST_OBJECT_LOCK (equ);
   switch (prop_id) {
     case ARG_NUM_BANDS:
@@ -114,7 +114,7 @@ gst_iir_equalizer_nbands_set_property (GObject * object, guint prop_id,
       break;
   }
   GST_OBJECT_UNLOCK (equ);
-  GST_EQUALIZER_TRANSFORM_UNLOCK (equ);
+  GST_BASE_TRANSFORM_UNLOCK (equ);
 }
 
 static void
index 6f3e5cc78032792b71e993cd01021f29f199604f..8ba87fd32db79a79a46f8bf3457e5a43d3639c34 100644 (file)
@@ -181,7 +181,9 @@ bpwsinc_set_caps (GstBaseTransform * base, GstCaps * incaps, GstCaps * outcaps)
       "set_caps: in %" GST_PTR_FORMAT " out %" GST_PTR_FORMAT, incaps, outcaps);
 
   len = this->wing_size;
-  /* fill the lp kernel */
+  /* fill the lp kernel
+   * FIXME: refactor to own function, this is not caps related
+   */
   GST_DEBUG ("bpwsinc: initializing LP kernel of length %d with cut-off %f",
       len * 2 + 1, this->lower_frequency);
   kernel_lp = (double *) g_malloc (sizeof (double) * (2 * len + 1));
index fb42835e79903ede45293eca07bf14357fb6ea7a..3ca5a90a11c753872358fce4dede051f9fe4d93a 100644 (file)
@@ -98,6 +98,9 @@ GST_STATIC_PAD_TEMPLATE ("src",
 #define DEFAULT_BANDS                  128
 #define DEFAULT_THRESHOLD              -60
 
+#define SPECTRUM_WINDOW_BASE 9
+#define SPECTRUM_WINDOW_LEN (1 << (SPECTRUM_WINDOW_BASE+1))
+
 enum
 {
   PROP_0,
@@ -191,12 +194,10 @@ gst_spectrum_init (GstSpectrum * spectrum, GstSpectrumClass * g_class)
   spectrum->interval = DEFAULT_SIGNAL_INTERVAL;
   spectrum->bands = DEFAULT_BANDS;
   spectrum->threshold = DEFAULT_THRESHOLD;
-  spectrum->base = 9;
-  spectrum->len = 1024;         /* 2 ^ (base+1) */
 
-  spectrum->loud = g_malloc (spectrum->len * sizeof (gint16));
-  spectrum->im = g_malloc0 (spectrum->len * sizeof (gint16));
-  spectrum->re = g_malloc0 (spectrum->len * sizeof (gint16));
+  spectrum->loud = g_malloc (SPECTRUM_WINDOW_LEN * sizeof (gint16));
+  spectrum->im = g_malloc0 (SPECTRUM_WINDOW_LEN * sizeof (gint16));
+  spectrum->re = g_malloc0 (SPECTRUM_WINDOW_LEN * sizeof (gint16));
   spectrum->spect = g_malloc (spectrum->bands * sizeof (guchar));
 }
 
@@ -237,11 +238,11 @@ gst_spectrum_set_property (GObject * object, guint prop_id,
       filter->interval = g_value_get_uint64 (value);
       break;
     case PROP_BANDS:
-      GST_OBJECT_LOCK (filter);
+      GST_BASE_TRANSFORM_LOCK (filter);
       filter->bands = g_value_get_uint (value);
       g_free (filter->spect);
       filter->spect = g_malloc (filter->bands * sizeof (guchar));
-      GST_OBJECT_UNLOCK (filter);
+      GST_BASE_TRANSFORM_UNLOCK (filter);
       GST_DEBUG_OBJECT (filter, "reallocation, spect = %p, bands =%d ",
           filter->spect, filter->bands);
       break;
@@ -391,15 +392,15 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * in)
       gst_segment_to_running_time (&spectrum->segment, GST_FORMAT_TIME,
       GST_BUFFER_TIMESTAMP (in));
   GstClockTime blktime =
-      GST_FRAMES_TO_CLOCK_TIME (spectrum->len, spectrum->rate);
+      GST_FRAMES_TO_CLOCK_TIME (SPECTRUM_WINDOW_LEN, spectrum->rate);
 
   GST_LOG_OBJECT (spectrum, "input size: %d bytes", GST_BUFFER_SIZE (in));
 
   gst_adapter_push (spectrum->adapter, gst_buffer_ref (in));
   /* required number of bytes */
-  wanted = spectrum->channels * spectrum->len * sizeof (gint16);
+  wanted = spectrum->channels * SPECTRUM_WINDOW_LEN * sizeof (gint16);
   /* FIXME: 4.0 was 2.0 before, but that include the mirrored spectrum */
-  step = (gfloat) spectrum->len / (spectrum->bands * 4.0);
+  step = (gfloat) SPECTRUM_WINDOW_LEN / (spectrum->bands * 4.0);
 
   while (gst_adapter_available (spectrum->adapter) >= wanted) {
     const gint16 *samples;
@@ -408,17 +409,18 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * in)
 
     /* the current fft code is gint16 based, so supporting other formats would
      * not really benefit now */
-    for (i = 0, j = 0; i < spectrum->len; i++) {
+    for (i = 0, j = 0; i < SPECTRUM_WINDOW_LEN; i++) {
       /* convert to mono */
       for (k = 0, acc = 0; k < spectrum->channels; k++)
         acc += samples[j++];
       spectrum->re[i] = (gint16) (acc / spectrum->channels);
     }
 
-    gst_spectrum_window (spectrum->re, spectrum->len);
-    gst_spectrum_fix_fft (spectrum->re, spectrum->im, spectrum->base, FALSE);
+    gst_spectrum_window (spectrum->re, SPECTRUM_WINDOW_LEN);
+    gst_spectrum_fix_fft (spectrum->re, spectrum->im, SPECTRUM_WINDOW_BASE,
+        FALSE);
     gst_spectrum_fix_loud (spectrum->loud, spectrum->re, spectrum->im,
-        spectrum->len, 0);
+        SPECTRUM_WINDOW_LEN, 0);
 
     /* resample to requested number of bands */
     for (i = 0, pos = 0.0; i < spectrum->bands; i++, pos += step) {
@@ -433,7 +435,7 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * in)
         spect[i] = 0;
     }
 
-    spectrum->num_frames += spectrum->len;
+    spectrum->num_frames += SPECTRUM_WINDOW_LEN;
     endtime += blktime;
     /* do we need to message ? */
     if (spectrum->num_frames >=