+2005-08-01 Stefan Kost <ensonic@users.sf.net>
+
+ * configure.ac:
+ * docs/libs/tmpl/gstcolorbalance.sgml:
+ * docs/libs/tmpl/gstmixer.sgml:
+ * examples/Makefile.am:
+ * gst/sine/Makefile.am:
+ * gst/sine/gstsinesrc.c: (gst_sinesrc_init), (gst_sinesrc_create),
+ (gst_sinesrc_set_property), (plugin_init):
+ * gst/sine/gstsinesrc.h:
+ * gst/volume/Makefile.am:
+ * gst/volume/gstvolume.c: (gst_volume_set_volume),
+ (gst_volume_set_mute), (gst_volume_dispose), (gst_volume_init),
+ (volume_process_float), (volume_process_int16),
+ (volume_set_property), (plugin_init):
+ * gst/volume/gstvolume.h:
+ deactivate and remove dparams (libgstcontrol)
+
2005-07-29 Wim Taymans <wim@fluendo.com>
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_link_src):
fi
AC_SUBST(GST_TOOLS_DIR)
-dnl check for gstreamer-control; uninstalled is selected preferentially
-PKG_CHECK_MODULES(GST_CONTROL, gstreamer-control-$GST_MAJORMINOR >= $GST_REQ,
- HAVE_GST_CONTROL="yes", HAVE_GST_CONTROL="no")
-
-if test "x$HAVE_GST_CONTROL" = "xno"; then
- AC_MSG_ERROR(no GStreamer Control Libs found)
-fi
-
-AC_SUBST(GST_CONTROL_LIBS)
-
dnl check for gstreamer-dataprotocol; uninstalled is selected preferentially
PKG_CHECK_MODULES(GST_GDP, gstreamer-dataprotocol-$GST_MAJORMINOR >= $GST_REQ,
HAVE_GST_GDP="yes", HAVE_GST_GDP="no")
</para>
-<!-- ##### SIGNAL GstColorBalance::value-changed ##### -->
-<para>
-
-</para>
-
-@gstcolorbalance: the object which received the signal.
-@arg1:
-@arg2:
-
<!-- ##### STRUCT GstColorBalanceClass ##### -->
<para>
</para>
+@parent:
+@values:
+@_gst_reserved:
<!-- ##### STRUCT GstMixerTrack ##### -->
<para>
</para>
+@parent:
+@label:
+@flags:
<!-- ##### FUNCTION gst_mixer_list_tracks ##### -->
<para>
# endif
SUBDIRS=$(GTK_SUBDIRS)
-#DIST_SUBDIRS=capsfilter dynparams seeking indexing switch
+#DIST_SUBDIRS=capsfilter seeking indexing switch
DIST_SUBDIRS=seeking
libgstsinesrc_la_SOURCES = gstsinesrc.c
libgstsinesrc_la_CFLAGS = $(GST_CFLAGS)
libgstsinesrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-libgstsinesrc_la_LIBADD = $(GST_CONTROL_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)
+libgstsinesrc_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)
noinst_HEADERS = gstsinesrc.h
#include <math.h>
#include <stdlib.h>
#include <string.h>
-#include <gst/control/control.h>
#include "gstsinesrc.h"
src->seq = 0;
- src->dpman = gst_dpman_new ("sinesrc_dpman", GST_ELEMENT (src));
-
- gst_dpman_add_required_dparam_callback (src->dpman,
- g_param_spec_double ("freq", "Frequency (Hz)", "Frequency of the tone",
- 10.0, 10000.0, 350.0, G_PARAM_READWRITE),
- "hertz", gst_sinesrc_update_freq, src);
-
- gst_dpman_add_required_dparam_direct (src->dpman,
- g_param_spec_double ("volume", "Volume", "Volume of the tone",
- 0.0, 1.0, 0.8, G_PARAM_READWRITE), "scalar", &(src->volume)
- );
-
- gst_dpman_set_rate (src->dpman, src->samplerate);
-
gst_sinesrc_populate_sinetable (src);
gst_sinesrc_update_table_inc (src);
guint tdiff;
gint16 *samples;
- gint i = 0;
+ gint i;
src = GST_SINESRC (basesrc);
samples = (gint16 *) GST_BUFFER_DATA (buf);
- GST_DPMAN_PREPROCESS (src->dpman, src->samples_per_buffer, src->timestamp);
-
src->timestamp += tdiff;
src->offset += src->samples_per_buffer;
- while (GST_DPMAN_PROCESS (src->dpman, i)) {
+ for (i = 0; i < src->samples_per_buffer; i++) {
#if 0
src->table_lookup = (gint) (src->table_pos);
src->table_lookup_next = src->table_lookup + 1;
src->table_pos += src->table_inc;
/*no interpolation */
- /*samples[i] = src->table_data[src->table_lookup] */
- /* * src->volume * 32767.0; */
+ /*samples[i] = src->table_data[src->table_lookup] * src->volume * 32767.0; */
/*linear interpolation */
samples[i] = ((src->table_interp * (src->table_data[src->table_lookup_next]
if (src->accumulator >= 2 * M_PI) {
src->accumulator -= 2 * M_PI;
}
- samples[i] = sin (src->accumulator) * src->volume * 32767.0;
-
- i++;
+ *samples++ = sin (src->accumulator) * src->volume * 32767.0;
}
*buffer = buf;
src->samples_per_buffer = g_value_get_int (value);
break;
case ARG_FREQ:
- gst_dpman_bypass_dparam (src->dpman, "freq");
gst_sinesrc_update_freq (value, src);
break;
case ARG_VOLUME:
- gst_dpman_bypass_dparam (src->dpman, "volume");
src->volume = g_value_get_double (value);
break;
case ARG_SYNC:
static gboolean
plugin_init (GstPlugin * plugin)
{
- /* initialize dparam support library */
- gst_control_init (NULL, NULL);
-
return gst_element_register (plugin, "sinesrc",
GST_RANK_NONE, GST_TYPE_SINESRC);
}
/* pads */
GstPad *srcpad;
- GstDParamManager *dpman;
/* parameters */
gdouble volume;
libgstvolume_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstvolume_la_LIBADD = \
$(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
- $(GST_CONTROL_LIBS) \
$(GST_BASE_LIBS) \
$(GST_LIBS)
g_return_if_fail (filter != NULL);
g_return_if_fail (GST_IS_VOLUME (filter));
- gst_dpman_bypass_dparam (filter->dpman, "volume");
-
filter->volume_f = (gfloat) volumes[0] / VOLUME_STEPS;
filter->volume_i = filter->volume_f * VOLUME_UNITY_INT;
g_return_if_fail (filter != NULL);
g_return_if_fail (GST_IS_VOLUME (filter));
- gst_dpman_bypass_dparam (filter->dpman, "volume");
-
filter->mute = mute;
if (filter->mute) {
static void
gst_volume_dispose (GObject * object)
{
- GstVolume *volume;
-
- volume = GST_VOLUME (object);
-
- if (volume->dpman)
- g_object_unref (G_OBJECT (volume->dpman));
- volume->dpman = NULL;
+ GstVolume *volume = GST_VOLUME (object);
if (volume->tracklist) {
if (volume->tracklist->data)
filter->real_vol_f = 1.0;
filter->tracklist = NULL;
- filter->dpman = gst_dpman_new ("volume_dpman", GST_ELEMENT (filter));
- gst_dpman_add_required_dparam_callback (filter->dpman,
- g_param_spec_int ("mute", "Mute", "Mute the audio",
- 0, 1, 0, G_PARAM_READWRITE), "int", volume_update_mute, filter);
- gst_dpman_add_required_dparam_callback (filter->dpman,
- g_param_spec_double ("volume", "Volume", "Volume of the audio",
- 0.0, VOLUME_MAX_DOUBLE, 1.0, G_PARAM_READWRITE),
- "scalar", volume_update_volume, filter);
-
track = g_object_new (GST_TYPE_MIXER_TRACK, NULL);
if (GST_IS_MIXER_TRACK (track)) {
data = (gfloat *) bytes;
num_samples = n_bytes / sizeof (gfloat);
- GST_DPMAN_PREPROCESS (filter->dpman, num_samples, tstamp);
-
- i = 0;
- while (GST_DPMAN_PROCESS (filter->dpman, i)) {
- data[i++] *= filter->real_vol_f;
+ for (i = 0; i < num_samples; i++) {
+ *data++ *= filter->real_vol_f;
}
}
gpointer bytes, gint n_bytes)
{
gint16 *data;
- gint i, num_samples;
+ gint i, val, num_samples;
data = (gint16 *) bytes;
num_samples = n_bytes / sizeof (gint16);
- GST_DPMAN_PREPROCESS (filter->dpman, num_samples, tstamp);
- i = 0;
-
/* need... liboil... */
- while (GST_DPMAN_PROCESS (filter->dpman, i)) {
- /* only clamp if the gain is greater than 1.0 */
- if (filter->real_vol_i > VOLUME_UNITY_INT) {
- while (i < GST_DPMAN_NEXT_UPDATE_FRAME (filter->dpman)) {
- /* we use bitshifting instead of dividing by UNITY_INT for speed */
- data[i] =
- (gint16) CLAMP ((filter->real_vol_i *
- (gint) data[i]) >> VOLUME_UNITY_BIT_SHIFT, VOLUME_MIN_INT16,
- VOLUME_MAX_INT16);
- i++;
- }
- } else {
- while (i < GST_DPMAN_NEXT_UPDATE_FRAME (filter->dpman)) {
- /* we use bitshifting instead of dividing by UNITY_INT for speed */
- data[i] =
- (gint16) ((filter->real_vol_i *
- (gint) data[i]) >> VOLUME_UNITY_BIT_SHIFT);
- i++;
- }
+ /* only clamp if the gain is greater than 1.0 */
+ if (filter->real_vol_i > VOLUME_UNITY_INT) {
+ for (i = 0; i < num_samples; i++) {
+ /* we use bitshifting instead of dividing by UNITY_INT for speed */
+ val = (gint) * data;
+ *data++ =
+ (gint16) CLAMP ((filter->real_vol_i *
+ val) >> VOLUME_UNITY_BIT_SHIFT, VOLUME_MIN_INT16,
+ VOLUME_MAX_INT16);
+ }
+ } else {
+ for (i = 0; i < num_samples; i++) {
+ /* we use bitshifting instead of dividing by UNITY_INT for speed */
+ val = (gint) * data;
+ *data++ = (gint16) ((filter->real_vol_i * val) >> VOLUME_UNITY_BIT_SHIFT);
}
}
}
switch (prop_id) {
case PROP_MUTE:
- gst_dpman_bypass_dparam (filter->dpman, "mute");
volume_update_mute (value, filter);
break;
case PROP_VOLUME:
- gst_dpman_bypass_dparam (filter->dpman, "volume");
volume_update_volume (value, filter);
break;
default:
static gboolean
plugin_init (GstPlugin * plugin)
{
- gst_control_init (NULL, NULL);
-
return gst_element_register (plugin, "volume", GST_RANK_NONE,
GST_TYPE_VOLUME);
}
void (*process)(GstVolume*, GstClockTime, gpointer, gint);
- GstDParamManager *dpman;
-
gboolean mute;
gint volume_i, real_vol_i; /* the _i(nt) values get synchronized with the */
gfloat volume_f, real_vol_f; /* _f(loat) values on each update */
# endif
SUBDIRS=$(GTK_SUBDIRS)
-#DIST_SUBDIRS=capsfilter dynparams seeking indexing switch
+#DIST_SUBDIRS=capsfilter seeking indexing switch
DIST_SUBDIRS=seeking