+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:
#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,
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));
}
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;
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;
/* 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) {
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 >=