+2005-09-28 Stefan Kost <ensonic@users.sf.net>
+
+ * gst/gstinfo.c: (gst_debug_log_default):
+ don't do dummy g_strdup()s
+ * libs/gst/controller/gstcontroller.c:
+ (on_object_controlled_property_changed),
+ (gst_controlled_property_new), (gst_controller_new_valist),
+ (gst_controller_new_list),
+ (gst_controller_remove_properties_valist), (gst_controller_set),
+ (gst_controller_get), (gst_controller_sync_values),
+ (gst_controller_get_value_array), (_gst_controller_class_init),
+ (gst_controller_get_type):
+ * libs/gst/controller/gstcontroller.h:
+ * libs/gst/controller/gstinterpolation.c:
+ (gst_controlled_property_find_timed_value_node):
+ convert // to /**/ comments
+
2005-09-28 Wim Taymans <wim@fluendo.com>
* gst/gstbus.c: (marshal_VOID__MINIOBJECT), (gst_bus_class_init),
* gst/elements/gstfdsrc.c: Cleaned up a bit.
-2005-09-28 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-28 Tim-Philipp M??ller <tim at centricular dot net>
* gst/elements/gstcapsfilter.c:
* gst/elements/gstfakesink.c:
Leak fixes, the fold functions need to unref the passed object and
_get_parent_*() returns ref to parent.
-2005-09-27 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-27 Tim-Philipp M??ller <tim at centricular dot net>
* check/gst/gstbuffer.c: (test_make_writable):
Plug leak in test case and fix 'make check-valgrind'
-2005-09-27 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-27 Tim-Philipp M??ller <tim at centricular dot net>
* gst/gstbuffer.c: (gst_subbuffer_init):
Set READONLY flag on subbuffers, so that gst_buffer_make_writable()
(main):
Fix compilation of some tests.
-2005-09-27 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-27 Tim-Philipp M??ller <tim at centricular dot net>
* gst/gsterror.h:
Remove comment. GST_TYPE_G_ERROR is here to stay,
* gst/gstpad.c: (gst_pad_dispose):
Added some debug info first.
-2005-09-26 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-26 Tim-Philipp M??ller <tim at centricular dot net>
* docs/design/draft-push-pull.txt:
* docs/design/part-events.txt:
inlined two more docs
factored gstpadtemplate out of gstpad
-2005-09-24 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-24 Tim-Philipp M??ller <tim at centricular dot net>
* check/gst/gstbin.c: (test_children_state_change_order_flagged_sink),
(test_children_state_change_order_semi_sink):
* gst/gststructure.c:
some doc updates
-2005-09-23 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-23 Tim-Philipp M??ller <tim at centricular dot net>
* docs/design/part-gstbin.txt:
* docs/design/part-gstbus.txt:
* gst/gststructure.h:
add a method to get a GstClockTime out of a structure
-2005-09-23 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-23 Tim-Philipp M??ller <tim at centricular dot net>
* check/gst/gstbin.c: (test_children_state_change_order_flagged_sink),
(test_children_state_change_order_semi_sink), (gst_bin_suite):
* gst/gstquery.h:
Added new query.
-2005-09-22 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-22 Tim-Philipp M??ller <tim at centricular dot net>
* check/gst/gstvalue.c: (test_date), (gst_value_suite):
Add simplistic test suite for GST_TYPE_DATE serialisation and
deserialisation.
-2005-09-22 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-22 Tim-Philipp M??ller <tim at centricular dot net>
* docs/gst/gstreamer-sections.txt:
* gst/gststructure.c: (gst_structure_set_valist),
2005-09-21 Francis Labonte <francis_labonte at hotmail dot com>
- Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
+ Reviewed by: Tim-Philipp M??ller <tim at centricular dot net>
* gst/gstinfo.c: (_gst_debug_nameof_funcptr),
(_gst_debug_register_funcptr):
* gst/registries/.cvsignore:
Remove left-over file.
-2005-09-21 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-21 Tim-Philipp M??ller <tim at centricular dot net>
* docs/pwg/appendix-porting.xml:
And something about newsegment events and caps-on-buffers to
(gst_pad_class_init): have-data is now a detailed signal, yes it
is.
-2005-09-21 Tim-Philipp Müller <tim at centricular dot net>
+2005-09-21 Tim-Philipp M??ller <tim at centricular dot net>
* gst/base/gstbasetransform.c: (gst_base_transform_transform_size):
* gst/gstutils.c: (gst_util_set_value_from_string),
#ifdef HAVE_VALGRIND
#include <valgrind/valgrind.h>
#endif
+#include <glib/gprintf.h> /* g_sprintf */
/* underscore is to prevent conflict with GST_CAT_DEBUG define */
GST_DEBUG_CATEGORY_STATIC (_GST_CAT_DEBUG);
const gchar * file, const gchar * function, gint line,
GObject * object, GstDebugMessage * message, gpointer unused)
{
- gchar *color;
+ gchar *color = NULL;
gchar *clear;
- gchar *obj;
- gchar *pidcolor;
+ gchar *obj = NULL;
+ gchar pidcolor[10];
gint pid;
GTimeVal now;
GstClockTime elapsed;
+ gboolean free_color = TRUE;
+ gboolean free_obj = TRUE;
if (level > gst_debug_category_get_threshold (category))
return;
/* color info */
if (gst_debug_is_colored ()) {
- color =
- gst_debug_construct_term_color (gst_debug_category_get_color
+ color = gst_debug_construct_term_color (gst_debug_category_get_color
(category));
clear = "\033[00m";
- pidcolor = g_strdup_printf ("\033[3%1dm", pid % 6 + 31);
+ g_sprintf (pidcolor, "\033[3%1dm", pid % 6 + 31);
} else {
- color = g_strdup ("");
+ color = "\0";
+ free_color = FALSE;
clear = "";
- pidcolor = g_strdup ("");
+ pidcolor[0] = '\0';
}
- obj = object ? gst_debug_print_object (object) : g_strdup ("");
+ if (object) {
+ obj = gst_debug_print_object (object);
+ } else {
+ obj = "\0";
+ free_obj = FALSE;
+ }
g_get_current_time (&now);
elapsed = GST_TIMEVAL_TO_TIME (now) - start_time;
gst_debug_category_get_name (category), clear, pidcolor, pid, clear,
color, file, line, function, obj, clear, gst_debug_message_get (message));
- g_free (color);
- g_free (pidcolor);
- g_free (obj);
+ if (free_color)
+ g_free (color);
+ if (free_obj)
+ g_free (obj);
}
/**
if (g_mutex_trylock (ctrl->lock)) {
if (!G_IS_VALUE (&prop->live_value.value)) {
- //g_value_unset (&prop->live_value.value);
g_value_init (&prop->live_value.value, prop->type);
}
g_object_get_property (G_OBJECT (object), prop->name,
GST_DEBUG ("-> is live update : ts=%" G_GUINT64_FORMAT,
prop->live_value.timestamp);
}
- //else {
- //GST_DEBUG ("-> is control change");
- //}
}
/* helper */
GST_INFO ("trying to put property '%s' under control", name);
- // check if the object has a property of that name
+ /* check if the object has a property of that name */
if ((pspec =
g_object_class_find_property (G_OBJECT_GET_CLASS (object), name))) {
GST_DEBUG (" psec->flags : 0x%08x", pspec->flags);
- // check if this param is witable
+ /* check if this param is witable */
g_return_val_if_fail ((pspec->flags & G_PARAM_WRITABLE), NULL);
- // check if property is controlable
+ /* check if property is controlable */
g_return_val_if_fail ((pspec->flags & GST_PARAM_CONTROLLABLE), NULL);
- // check if this param is not construct-only
+ /* check if this param is not construct-only */
g_return_val_if_fail (!(pspec->flags & G_PARAM_CONSTRUCT_ONLY), NULL);
/* TODO do sanity checks
if ((prop = g_new0 (GstControlledProperty, 1))) {
gchar *signal_name;
- 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);
gst_controlled_property_set_interpolation_mode (prop,
GST_INTERPOLATE_NONE);
*/
self = g_object_get_qdata (object, __gst_controller_key);
- // create GstControlledProperty for each property
+ /* create GstControlledProperty for each property */
while ((name = va_arg (var_args, gchar *))) {
- // test if this property isn't yet controlled
+ /* test if this property isn't yet controlled */
if (!self || !(prop = gst_controller_find_controlled_property (self, name))) {
- // create GstControlledProperty and add to self->propeties List
+ /* create GstControlledProperty and add to self->propeties List */
if ((prop = gst_controlled_property_new (object, name))) {
- // if we don't have a controller object yet, now is the time to create one
+ /* if we don't have a controller object yet, now is the time to create one */
if (!self) {
self = g_object_new (GST_TYPE_CONTROLLER, NULL);
self->object = object;
- // store the controller
+ /* store the controller */
g_object_set_qdata (object, __gst_controller_key, self);
} else {
GST_INFO ("returning existing controller");
GST_INFO ("setting up a new controller");
self = g_object_get_qdata (object, __gst_controller_key);
- // create GstControlledProperty for each property
+ /* create GstControlledProperty for each property */
for (node = list; node; node = g_list_next (list)) {
name = (gchar *) node->data;
- // test if this property isn't yet controlled
+ /* test if this property isn't yet controlled */
if (!self || !(prop = gst_controller_find_controlled_property (self, name))) {
- // create GstControlledProperty and add to self->propeties List
+ /* create GstControlledProperty and add to self->propeties List */
if ((prop = gst_controlled_property_new (object, name))) {
- // if we don't have a controller object yet, now is the time to create one
+ /* if we don't have a controller object yet, now is the time to create one */
if (!self) {
self = g_object_new (GST_TYPE_CONTROLLER, NULL);
self->object = object;
- // store the controller
+ /* store the controller */
g_object_set_qdata (object, __gst_controller_key, self);
} else {
GST_INFO ("returning existing controller");
g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
while ((name = va_arg (var_args, gchar *))) {
- // find the property in the properties list of the controller, remove and free it
+ /* find the property in the properties list of the controller, remove and free it */
g_mutex_lock (self->lock);
if ((prop = gst_controller_find_controlled_property (self, name))) {
self->properties = g_list_remove (self->properties, prop);
GstTimedValue *tv;
GList *node;
- // check if a timed_value for the timestamp already exists
+ /* check if a timed_value for the timestamp already exists */
if ((node = g_list_find_custom (prop->values, ×tamp,
gst_timed_value_find))) {
tv = node->data;
memcpy (&tv->value, value, sizeof (GValue));
} else {
- // create a new GstTimedValue
+ /* create a new GstTimedValue */
tv = g_new (GstTimedValue, 1);
tv->timestamp = timestamp;
memcpy (&tv->value, value, sizeof (GValue));
- // and sort it into the prop->values list
+ /* and sort it into the prop->values list */
prop->values =
g_list_insert_sorted (prop->values, tv, gst_timed_value_compare);
}
g_mutex_lock (self->lock);
if ((prop = gst_controller_find_controlled_property (self, property_name))) {
- //get current value via interpolator
+ /* get current value via interpolator */
val = prop->get (prop, timestamp);
}
g_mutex_unlock (self->lock);
GST_INFO ("sync_values");
g_mutex_lock (self->lock);
- // go over the controlled properties of the controller
+ /* go over the controlled properties of the controller */
for (node = self->properties; node; node = g_list_next (node)) {
prop = node->data;
GST_DEBUG (" property '%s' at ts=%" G_GUINT64_FORMAT, prop->name,
} else {
GstTimedValue *tv = lnode->data;
- //GST_DEBUG ("live.ts %"G_UINT64_FORMAT" <-> now %"G_UINT64_FORMAT, prop->live_value.timestamp, tv->timestamp);
if (prop->live_value.timestamp < tv->timestamp) {
g_value_unset (&prop->live_value.value);
GST_DEBUG (" live value resetted");
}
}
if (!live) {
- //get current value via interpolator
+ /* get current value via interpolator */
value = prop->get (prop, timestamp);
prop->last_value.timestamp = timestamp;
g_value_copy (value, &prop->last_value.value);
value_array->values=g_new(sizeof(???),nbsamples);
*/
}
- //get current value_array via interpolator
+ /* get current value_array via interpolator */
res = prop->get_value_array (prop, timestamp, value_array);
}
g_mutex_unlock (self->lock);
__gst_controller_key = g_quark_from_string ("gst::controller");
- // register properties
- // register signals
- // set defaults for overridable methods
+ /* register properties */
+ /* register signals */
+ /* set defaults for overridable methods */
/* TODO which of theses do we need ?
BilboEd : none :)
*/
if (type == 0) {
static const GTypeInfo info = {
sizeof (GstControllerClass),
- NULL, // base_init
- NULL, // base_finalize
- (GClassInitFunc) _gst_controller_class_init, // class_init
- NULL, // class_finalize
- NULL, // class_data
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) _gst_controller_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
sizeof (GstController),
- 0, // n_preallocs
- (GInstanceInitFunc) _gst_controller_init, // instance_init
- NULL // value_table
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) _gst_controller_init, /* instance_init */
+ NULL /* value_table */
};
type = g_type_register_static (G_TYPE_OBJECT, "GstController", &info, 0);
}
*/
typedef struct _GstTimedValue
{
- GstClockTime timestamp; // timestamp of the value change
- GValue value; // the new value
+ GstClockTime timestamp; /* timestamp of the value change */
+ GValue value; /* the new value */
/* TODO what about storing the difference to next timestamp and value here
+ make calculations slightly easier and faster
- determining the GType for the value_dif is not simple
*/
typedef struct _GstControlledProperty
{
- gchar *name; // name of the property
- GType type; // type of the handled property
- GValue default_value; // default value for the handled property
- GValue result_value; // result value location for the interpolation method
- GstTimedValue last_value; // the last value a _sink call wrote
- GstTimedValue live_value; // temporary value override for live input
- gulong notify_handler_id; // id of the notify::<name> signal handler
- GstInterpolateMode interpolation; // Interpolation mode
+ gchar *name; /* name of the property */
+ GType type; /* type of the handled property */
+ GValue default_value; /* default value for the handled property */
+ GValue result_value; /* result value location for the interpolation method */
+ GstTimedValue last_value; /* the last value a _sink call wrote */
+ GstTimedValue live_value; /* temporary value override for live input */
+ gulong notify_handler_id; /* id of the notify::<name> signal handler */
+ GstInterpolateMode interpolation; /* Interpolation mode */
/* TODO instead of *method, have pointers to get() and get_value_array() here
gst_controller_set_interpolation_mode() will pick the right ones for the
properties value type
InterpolateGet get;
InterpolateGetValueArray get_value_array;
- GList *values; // List of GstTimedValue
+ GList *values; /* List of GstTimedValue */
/* TODO keep the last search result to be able to continue
- GList *last_value; // last search result, can be used for incremental searches
+ GList *last_value; // last search result, can be used for incremental searches
*/
/*< private >*/
typedef struct _GstController GstController;
typedef struct _GstControllerClass GstControllerClass;
-//typedef struct _GstControllerPrivate GstControllerPrivate;
-
/**
* GstController:
*
{
GObject parent;
- GList *properties; // List of GstControlledProperty
- GMutex *lock; // Secure property access, elements will access from threads
- GObject *object; // the object we control
+ GList *properties; /* List of GstControlledProperty */
+ GMutex *lock; /* Secure property access, elements will access from threads */
+ GObject *object; /* the object we control */
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
gst_controlled_property_find_timed_value_node (GstControlledProperty * prop,
GstClockTime timestamp)
{
- //GList *prev_node = NULL;
+ /* GList *prev_node = NULL; */
GList *prev_node = g_list_last (prop->values);
GList *node;
GstTimedValue *tv;
return (prev_node);
}
-// steps-like (no-)interpolation, default
-// just returns the value for the most recent key-frame
+/* steps-like (no-)interpolation, default */
+/* just returns the value for the most recent key-frame */
static GValue *
interpolate_none_get (GstControlledProperty * prop, GstClockTime timestamp)
interpolate_none_get_boolean_value_array
};
-// returns the default value of the property, except for times with specific values
-// needed for one-shot events, such as notes and triggers
+/* returns the default value of the property, except for times with specific values */
+/* needed for one-shot events, such as notes and triggers */
static GValue *
interpolate_trigger_get (GstControlledProperty * prop, GstClockTime timestamp)
NULL
};
-// linear interpolation
-// smoothes inbetween values
+/* linear interpolation */
+/* smoothes inbetween values */
#define DEFINE_LINEAR_GET(type) \
static g##type \
NULL
};
-// square interpolation
+/* square interpolation */
-// cubic interpolation
+/* cubic interpolation */
-// register all interpolation methods
+/* register all interpolation methods */
GstInterpolateMethod *interpolation_methods[] = {
&interpolate_none,
&interpolate_trigger,