mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
docs/random/ensonic/dparams.txt: some TODOs for the next dev cycle
Original commit message from CVS: * docs/random/ensonic/dparams.txt: some TODOs for the next dev cycle * libs/gst/controller/gstcontroller.c: (gst_controlled_property_set_interpolation_mode), (gst_controlled_property_new): * libs/gst/controller/gstcontroller.h: use base type to assign acccessor functions
This commit is contained in:
parent
cdfe12031f
commit
5f11755575
4 changed files with 43 additions and 59 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2005-11-28 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
|
* docs/random/ensonic/dparams.txt:
|
||||||
|
some TODOs for the next dev cycle
|
||||||
|
* libs/gst/controller/gstcontroller.c:
|
||||||
|
(gst_controlled_property_set_interpolation_mode),
|
||||||
|
(gst_controlled_property_new):
|
||||||
|
* libs/gst/controller/gstcontroller.h:
|
||||||
|
use base type to assign acccessor functions
|
||||||
|
|
||||||
2005-11-28 Jan Schmidt <thaytan@mad.scientist.com>
|
2005-11-28 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* check/Makefile.am:
|
* check/Makefile.am:
|
||||||
|
|
|
@ -1,43 +1,14 @@
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
* cleanup of dparams
|
* controller changes
|
||||||
* library "namespace"
|
* handling of G_TYPE_XXX is distributed over
|
||||||
* even though it is long try to stick to the prefix "dparam" for the whole library
|
gst-controller.c::gst_controlled_property_set_interpolation_mode()
|
||||||
* e.g. avoid namespace clashes with "dataprotocol" which is using "dp" as well :-(
|
gst-controller.c::gst_controlled_property_new
|
||||||
* use a new namespace "ctrl" for control
|
gst-interpolation.c
|
||||||
* resolve g_return_if_fail() into GST_WARNING and return()
|
* it would be better to put handlers for each type into a struct
|
||||||
in cases where the caller has to handle the problem
|
and register it into a hashmap with the G_TYPE as the key
|
||||||
* rename
|
* functions in gst-controller.c could try the key,
|
||||||
GST_TYPE_DPSMOOTH to GST_TYPE_DPARAM_SMOOTH
|
if no handler is registered the try the type_parent and so on
|
||||||
GST_TYPE_DP_LININT to GST_TYPE_DPARAM_LININT
|
|
||||||
there seems to be nobody using them, as they still look unfinished
|
|
||||||
* move modes into extra modules
|
|
||||||
dparam_mode_synchronous
|
|
||||||
dparam_mode_asynchronous
|
|
||||||
dparam_mode_disabled
|
|
||||||
* split dparam manager api (like e.g. GConf does it)
|
|
||||||
* plugin api : GstCtrlManagerServer
|
|
||||||
* application api : GstCtrlManagerClient
|
|
||||||
* remove "value-changed" signal from DParam?
|
|
||||||
* one can connect to e.g. "notify::value-double" as well
|
|
||||||
* dparam update callback needs to pass more info
|
|
||||||
* GstElement as the first arg
|
|
||||||
* GstDPram as the second arg
|
|
||||||
|
|
||||||
* documentation
|
* implement quadric/qubic interpolation
|
||||||
* state of unitconvert
|
|
||||||
* state of sychronous params
|
|
||||||
* dpman_set/get_rate
|
|
||||||
if element_sampling_rate is 44100 and dpman_rate is 22050, dparams are updated twice a second
|
|
||||||
|
|
||||||
* dparams ng
|
|
||||||
* concept for global, voice params
|
|
||||||
one plugin instance can repeate the processing for the same input, but with
|
|
||||||
different parameter sets (sound synthesizers, effects)
|
|
||||||
* based on gobject params, so that e.g. the GUI can connect to "notify:param"
|
|
||||||
events and update the GUI
|
|
||||||
* implement timelined dparams via queues
|
|
||||||
* the queue contains dparams and timestamps
|
|
||||||
* GST_DPARAM_DO_UPDATE() checks the head of the queue for events that are due now
|
|
||||||
and sets the values
|
|
||||||
|
|
||||||
|
|
|
@ -170,12 +170,7 @@ gst_controlled_property_set_interpolation_mode (GstControlledProperty * self,
|
||||||
|
|
||||||
self->interpolation = mode;
|
self->interpolation = mode;
|
||||||
if (mode != GST_INTERPOLATE_USER) {
|
if (mode != GST_INTERPOLATE_USER) {
|
||||||
/* @todo: if it is not a fundamental type, recursively check parent
|
switch (self->base) {
|
||||||
* until we found the fundamental one
|
|
||||||
* GType base=self->type;
|
|
||||||
* while( base=g_type_get_parent(self->base) ) self->base = base;
|
|
||||||
*/
|
|
||||||
switch (self->type) {
|
|
||||||
case G_TYPE_INT:
|
case G_TYPE_INT:
|
||||||
self->get = interpolation_methods[mode]->get_int;
|
self->get = interpolation_methods[mode]->get_int;
|
||||||
self->get_value_array =
|
self->get_value_array =
|
||||||
|
@ -215,19 +210,15 @@ gst_controlled_property_set_interpolation_mode (GstControlledProperty * self,
|
||||||
self->get = interpolation_methods[mode]->get_uint;
|
self->get = interpolation_methods[mode]->get_uint;
|
||||||
self->get_value_array =
|
self->get_value_array =
|
||||||
interpolation_methods[mode]->get_enum_value_array;
|
interpolation_methods[mode]->get_enum_value_array;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (g_type_is_a (self->type, G_TYPE_ENUM)) {
|
|
||||||
self->get = interpolation_methods[mode]->get_uint;
|
|
||||||
self->get_value_array =
|
|
||||||
interpolation_methods[mode]->get_enum_value_array;
|
|
||||||
} else {
|
|
||||||
self->get = NULL;
|
self->get = NULL;
|
||||||
self->get_value_array = NULL;
|
self->get_value_array = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!self->get) { /* || !self->get_value_array) */
|
if (!self->get) { /* || !self->get_value_array) */
|
||||||
GST_WARNING ("incomplete implementation for type '%d':'%s'", self->type,
|
GST_WARNING ("incomplete implementation for type %d/%d:'%s'/'%s'",
|
||||||
g_type_name (self->type));
|
self->type, self->base,
|
||||||
|
g_type_name (self->type), g_type_name (self->base));
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -282,16 +273,24 @@ gst_controlled_property_new (GObject * object, const gchar * name)
|
||||||
|
|
||||||
if ((prop = g_new0 (GstControlledProperty, 1))) {
|
if ((prop = g_new0 (GstControlledProperty, 1))) {
|
||||||
gchar *signal_name;
|
gchar *signal_name;
|
||||||
|
GType base;
|
||||||
|
|
||||||
prop->name = pspec->name; /* so we don't use the same mem twice */
|
prop->name = pspec->name; /* so we don't use the same mem twice */
|
||||||
prop->type = G_PARAM_SPEC_VALUE_TYPE (pspec);
|
prop->type = G_PARAM_SPEC_VALUE_TYPE (pspec);
|
||||||
gst_controlled_property_set_interpolation_mode (prop,
|
/* get the fundamental base type */
|
||||||
GST_INTERPOLATE_NONE);
|
prop->base = prop->type;
|
||||||
|
while ((base = g_type_parent (prop->base))) {
|
||||||
|
prop->base = base;
|
||||||
|
}
|
||||||
|
/* initialize mode specific accessor callbacks */
|
||||||
|
if (!gst_controlled_property_set_interpolation_mode (prop,
|
||||||
|
GST_INTERPOLATE_NONE))
|
||||||
|
goto Error;
|
||||||
/* prepare our gvalues */
|
/* prepare our gvalues */
|
||||||
g_value_init (&prop->default_value, prop->type);
|
g_value_init (&prop->default_value, prop->type);
|
||||||
g_value_init (&prop->result_value, prop->type);
|
g_value_init (&prop->result_value, prop->type);
|
||||||
g_value_init (&prop->last_value.value, prop->type);
|
g_value_init (&prop->last_value.value, prop->type);
|
||||||
switch (prop->type) {
|
switch (prop->base) {
|
||||||
case G_TYPE_INT:{
|
case G_TYPE_INT:{
|
||||||
GParamSpecInt *tpspec = G_PARAM_SPEC_INT (pspec);
|
GParamSpecInt *tpspec = G_PARAM_SPEC_INT (pspec);
|
||||||
|
|
||||||
|
@ -360,8 +359,11 @@ gst_controlled_property_new (GObject * object, const gchar * name)
|
||||||
GST_WARNING ("class '%s' has no property '%s'", G_OBJECT_TYPE_NAME (object),
|
GST_WARNING ("class '%s' has no property '%s'", G_OBJECT_TYPE_NAME (object),
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (prop);
|
return (prop);
|
||||||
|
Error:
|
||||||
|
if (prop)
|
||||||
|
g_free (prop);
|
||||||
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -140,6 +140,7 @@ typedef struct _GstControlledProperty
|
||||||
{
|
{
|
||||||
gchar *name; /* name of the property */
|
gchar *name; /* name of the property */
|
||||||
GType type; /* type of the handled property */
|
GType type; /* type of the handled property */
|
||||||
|
GType base; /* base-type of the handled property */
|
||||||
GValue default_value; /* default value for the handled property */
|
GValue default_value; /* default value for the handled property */
|
||||||
GValue result_value; /* result value location for the interpolation method */
|
GValue result_value; /* result value location for the interpolation method */
|
||||||
GstTimedValue last_value; /* the last value a _sink call wrote */
|
GstTimedValue last_value; /* the last value a _sink call wrote */
|
||||||
|
|
Loading…
Reference in a new issue