deactivate and remove dparams (libgstcontrol)

Original commit message from CVS:
deactivate and remove dparams (libgstcontrol)
This commit is contained in:
Stefan Kost 2005-08-01 16:20:33 +00:00
parent a6d89f51fa
commit 497b586076
12 changed files with 50 additions and 107 deletions

View file

@ -1,3 +1,21 @@
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):

View file

@ -219,16 +219,6 @@ if test -z $GST_TOOLS_DIR; then
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")

View file

@ -23,15 +23,6 @@ interface for elements that provide color balance operations
</para>
<!-- ##### SIGNAL GstColorBalance::value-changed ##### -->
<para>
</para>
@gstcolorbalance: the object which received the signal.
@arg1:
@arg2:
<!-- ##### STRUCT GstColorBalanceClass ##### -->
<para>

View file

@ -48,12 +48,18 @@ gstmixer
</para>
@parent:
@values:
@_gst_reserved:
<!-- ##### STRUCT GstMixerTrack ##### -->
<para>
</para>
@parent:
@label:
@flags:
<!-- ##### FUNCTION gst_mixer_list_tracks ##### -->
<para>

View file

@ -11,5 +11,5 @@ GTK_SUBDIRS=
# endif
SUBDIRS=$(GTK_SUBDIRS)
#DIST_SUBDIRS=capsfilter dynparams seeking indexing switch
#DIST_SUBDIRS=capsfilter seeking indexing switch
DIST_SUBDIRS=seeking

View file

@ -3,6 +3,6 @@ plugin_LTLIBRARIES = libgstsinesrc.la
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

View file

@ -27,7 +27,6 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <gst/control/control.h>
#include "gstsinesrc.h"
@ -197,20 +196,6 @@ gst_sinesrc_init (GstSineSrc * src)
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);
@ -317,7 +302,7 @@ gst_sinesrc_create (GstBaseSrc * basesrc, guint64 offset,
guint tdiff;
gint16 *samples;
gint i = 0;
gint i;
src = GST_SINESRC (basesrc);
@ -362,12 +347,10 @@ gst_sinesrc_create (GstBaseSrc * basesrc, guint64 offset,
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;
@ -385,8 +368,7 @@ gst_sinesrc_create (GstBaseSrc * basesrc, guint64 offset,
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]
@ -399,9 +381,7 @@ gst_sinesrc_create (GstBaseSrc * basesrc, guint64 offset,
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;
@ -428,11 +408,9 @@ gst_sinesrc_set_property (GObject * object, guint prop_id,
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:
@ -528,9 +506,6 @@ gst_sinesrc_update_table_inc (GstSineSrc * src)
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);
}

View file

@ -53,7 +53,6 @@ struct _GstSineSrc {
/* pads */
GstPad *srcpad;
GstDParamManager *dpman;
/* parameters */
gdouble volume;

View file

@ -5,7 +5,6 @@ libgstvolume_la_CFLAGS = $(GST_CFLAGS)
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)

View file

@ -170,8 +170,6 @@ gst_volume_set_volume (GstMixer * mixer, GstMixerTrack * track, gint * volumes)
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;
@ -203,8 +201,6 @@ gst_volume_set_mute (GstMixer * mixer, GstMixerTrack * track, gboolean mute)
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) {
@ -231,13 +227,7 @@ gst_volume_mixer_init (GstMixerClass * klass)
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)
@ -293,15 +283,6 @@ gst_volume_init (GstVolume * filter)
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)) {
@ -362,11 +343,8 @@ volume_process_float (GstVolume * filter, GstClockTime tstamp,
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;
}
}
@ -375,34 +353,27 @@ volume_process_int16 (GstVolume * filter, GstClockTime tstamp,
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);
}
}
}
@ -455,11 +426,9 @@ volume_set_property (GObject * object, guint prop_id, const GValue * value,
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:
@ -490,8 +459,6 @@ volume_get_property (GObject * object, guint prop_id, GValue * value,
static gboolean
plugin_init (GstPlugin * plugin)
{
gst_control_init (NULL, NULL);
return gst_element_register (plugin, "volume", GST_RANK_NONE,
GST_TYPE_VOLUME);
}

View file

@ -54,8 +54,6 @@ struct _GstVolume {
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 */

View file

@ -11,5 +11,5 @@ GTK_SUBDIRS=
# endif
SUBDIRS=$(GTK_SUBDIRS)
#DIST_SUBDIRS=capsfilter dynparams seeking indexing switch
#DIST_SUBDIRS=capsfilter seeking indexing switch
DIST_SUBDIRS=seeking