+2005-11-27 Stefan Kost <ensonic@users.sf.net>
+
+ * gst/gstelement.c: (gst_element_dispose):
+ don't loop forever
+
+ * gst/gstiterator.c:
+ * gst/gststructure.c:
+ doc fixes
+
+ * libs/gst/controller/gstcontroller.c:
+ (gst_controlled_property_set_interpolation_mode):
+ * libs/gst/controller/gstcontroller.h:
+ * libs/gst/controller/gstinterpolation.c:
+ (interpolate_none_get_enum_value_array):
+ support controlling enums
+
2005-11-27 Tim-Philipp Müller <tim at centricular dot net>
* gst/gstvalue.c:
}
g_return_if_fail (GST_STATE_PENDING (element) == GST_STATE_VOID_PENDING);
+ GST_DEBUG ("removing %d pads", g_list_length (element->pads));
/* first we break all our links with the outside */
- while (element->pads) {
+ while (element->pads && element->pads->data) {
+ /* don't call _remove_pad with NULL */
gst_element_remove_pad (element, GST_PAD_CAST (element->pads->data));
}
if (G_UNLIKELY (element->pads != 0)) {
* ...rollback changes to items...
* gst_iterator_resync (it);
* break;
+ * case GST_ITERATOR_ERROR:
+ * ...wrong parameter were given...
+ * done = TRUE;
+ * break;
* case GST_ITERATOR_DONE:
* done = TRUE;
* break;
*
* Converts @structure to a human-readable string representation.
*
- * Returns: a pointer to string allocated by g_malloc(). g_free after
+ * Returns: a pointer to string allocated by g_malloc(). g_free() after
* usage.
*/
gchar *
self->interpolation = mode;
if (mode != GST_INTERPOLATE_USER) {
+ /* @todo: if it is not a fundamental type, recursively check parent
+ * 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:
self->get = interpolation_methods[mode]->get_int;
self->get_value_array =
interpolation_methods[mode]->get_boolean_value_array;
break;
- break;
+ case G_TYPE_ENUM:
+ self->get = interpolation_methods[mode]->get_uint;
+ self->get_value_array =
+ interpolation_methods[mode]->get_enum_value_array;
default:
- self->get = NULL;
- self->get_value_array = NULL;
+ 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_value_array = NULL;
+ }
}
if (!self->get) { /* || !self->get_value_array) */
- GST_WARNING ("incomplete implementation for type '%d'", self->type);
+ GST_WARNING ("incomplete implementation for type '%d':'%s'", self->type,
+ g_type_name (self->type));
res = FALSE;
}
} else {
g_value_set_boolean (&prop->default_value, tpspec->default_value);
}
break;
+ case G_TYPE_ENUM:{
+ GParamSpecEnum *tpspec = G_PARAM_SPEC_ENUM (pspec);
+
+ g_value_set_enum (&prop->default_value, tpspec->default_value);
+ }
+ break;
default:
GST_WARNING ("incomplete implementation for paramspec type '%s'",
G_PARAM_SPEC_TYPE_NAME (pspec));
InterpolateGetValueArray get_double_value_array;
InterpolateGet get_boolean;
InterpolateGetValueArray get_boolean_value_array;
+ InterpolateGet get_enum;
+ InterpolateGetValueArray get_enum_value_array;
} GstInterpolateMethod;
/**
DEFINE_NONE_GET (double)
DEFINE_NONE_GET (boolean)
- static GstInterpolateMethod interpolate_none = {
- interpolate_none_get,
- interpolate_none_get_int_value_array,
- interpolate_none_get,
- interpolate_none_get_uint_value_array,
- interpolate_none_get,
- interpolate_none_get_long_value_array,
- interpolate_none_get,
- interpolate_none_get_ulong_value_array,
- interpolate_none_get,
- interpolate_none_get_float_value_array,
- interpolate_none_get,
- interpolate_none_get_double_value_array,
- interpolate_none_get,
- interpolate_none_get_boolean_value_array
- };
+ static gboolean
+ interpolate_none_get_enum_value_array (GstControlledProperty * prop,
+ GstClockTime timestamp, GstValueArray * value_array)
+{
+ gint i;
+ GstClockTime ts = timestamp;
+ gint *values = (gint *) value_array->values;
+
+ for (i = 0; i < value_array->nbsamples; i++) {
+ *values = g_value_get_enum (interpolate_none_get (prop, ts));
+ ts += value_array->sample_interval;
+ values++;
+ }
+ return (TRUE);
+}
+
+
+static GstInterpolateMethod interpolate_none = {
+ interpolate_none_get,
+ interpolate_none_get_int_value_array,
+ interpolate_none_get,
+ interpolate_none_get_uint_value_array,
+ interpolate_none_get,
+ interpolate_none_get_long_value_array,
+ interpolate_none_get,
+ interpolate_none_get_ulong_value_array,
+ interpolate_none_get,
+ interpolate_none_get_float_value_array,
+ interpolate_none_get,
+ interpolate_none_get_double_value_array,
+ interpolate_none_get,
+ interpolate_none_get_boolean_value_array,
+ interpolate_none_get,
+ interpolate_none_get_enum_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 */
interpolate_trigger_get,
NULL,
interpolate_trigger_get,
+ NULL,
+ interpolate_trigger_get,
NULL
};
interpolate_linear_get_double,
interpolate_linear_get_double_value_array,
NULL,
+ NULL,
+ NULL,
NULL
};