3 * Copyright (C) <2005> Stefan Kost <ensonic at users dot sf dot net>
4 * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
6 * gstcontroller.c: dynamic parameter control subsystem
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
25 * SECTION:gstcontroller
26 * @short_description: dynamic parameter control subsystem
28 * The controller subsystem offers a lightweight way to adjust gobject
29 * properties over stream-time. It works by using time-stamped value pairs that
30 * are queued for element-properties. At run-time the elements continously pull
31 * values changes for the current stream-time.
33 * What needs to be changed in a #GstElement?
34 * Very little - it is just two steps to make a plugin controllable!
37 * mark gobject-properties paramspecs that make sense to be controlled,
38 * by GST_PARAM_CONTROLLABLE.
41 * when processing data (get, chain, loop function) at the beginning call
42 * gst_object_sync_values(element,timestamp).
43 * This will made the controller to update all gobject properties that are under
44 * control with the current values based on timestamp.
48 * What needs to be done in applications?
49 * Again its not a lot to change.
52 * first put some properties under control, by calling
53 * controller = gst_object_control_properties (object, "prop1", "prop2",...);
56 * Get a #GstControlSource for the property and set it up.
57 * csource = gst_interpolation_control_source_new ();
58 * gst_interpolation_control_source_set_interpolation_mode(csource, mode);
59 * gst_interpolation_control_source_set (csource,0 * GST_SECOND, value1);
60 * gst_interpolation_control_source_set (csource,1 * GST_SECOND, value2);
63 * Set the #GstControlSource in the controller.
64 * gst_controller_set_control_source (controller, "prop1", csource);
76 #include "gstcontroller.h"
77 #include "gstcontrollerprivate.h"
78 #include "gstcontrolsource.h"
79 #include "gstinterpolationcontrolsource.h"
81 #define GST_CAT_DEFAULT controller_debug
82 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
84 static GObjectClass *parent_class = NULL;
85 GQuark priv_gst_controller_key;
93 struct _GstControllerPrivate
95 GstClockTime control_rate;
96 GstClockTime last_sync;
102 * gst_controlled_property_new:
103 * @object: for which object the controlled property should be set up
104 * @name: the name of the property to be controlled
106 * Private method which initializes the fields of a new controlled property
109 * Returns: a freshly allocated structure or %NULL
111 static GstControlledProperty *
112 gst_controlled_property_new (GObject * object, const gchar * name)
114 GstControlledProperty *prop = NULL;
117 GST_INFO ("trying to put property '%s' under control", name);
119 /* check if the object has a property of that name */
121 g_object_class_find_property (G_OBJECT_GET_CLASS (object), name))) {
122 GST_DEBUG (" psec->flags : 0x%08x", pspec->flags);
124 /* check if this param is witable && controlable && !construct-only */
125 g_return_val_if_fail ((pspec->flags & (G_PARAM_WRITABLE |
126 GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT_ONLY)) ==
127 (G_PARAM_WRITABLE | GST_PARAM_CONTROLLABLE), NULL);
129 if ((prop = g_slice_new (GstControlledProperty))) {
131 prop->name = pspec->name;
132 prop->csource = NULL;
133 prop->disabled = FALSE;
134 memset (&prop->last_value, 0, sizeof (GValue));
135 g_value_init (&prop->last_value, G_PARAM_SPEC_VALUE_TYPE (prop->pspec));
138 GST_WARNING ("class '%s' has no property '%s'", G_OBJECT_TYPE_NAME (object),
145 * gst_controlled_property_free:
146 * @prop: the object to free
148 * Private method which frees all data allocated by a #GstControlledProperty
152 gst_controlled_property_free (GstControlledProperty * prop)
155 g_object_unref (prop->csource);
156 g_value_unset (&prop->last_value);
157 g_slice_free (GstControlledProperty, prop);
161 * gst_controller_find_controlled_property:
162 * @self: the controller object to search for a property in
163 * @name: the gobject property name to look for
165 * Searches the list of properties under control.
167 * Returns: a #GstControlledProperty object of %NULL if the property is not
170 static GstControlledProperty *
171 gst_controller_find_controlled_property (GstController * self,
174 GstControlledProperty *prop;
177 for (node = self->properties; node; node = g_list_next (node)) {
179 /* FIXME: eventually use GQuark to speed it up */
180 if (!strcmp (prop->name, name)) {
184 GST_DEBUG ("controller does not (yet) manage property '%s'", name);
190 * gst_controller_add_property:
191 * @self: the controller object or %NULL if none yet exists
192 * @object: object to bind the property
193 * @name: name of projecty in @object
194 * @ref_existing: pointer to flag that tracks if we need to ref an existing
197 * Creates a new #GstControlledProperty if there is none for property @name yet.
198 * In case this is the first controlled propery, it creates the controller as
201 * Returns: a newly created controller object or reffed existing one with the
202 * given property bound.
204 static GstController *
205 gst_controller_add_property (GstController * self, GObject * object,
206 const gchar * name, gboolean * ref_existing)
208 /* test if this property isn't yet controlled */
209 if (!self || !gst_controller_find_controlled_property (self, name)) {
210 GstControlledProperty *prop;
212 /* create GstControlledProperty and add to self->propeties List */
213 if ((prop = gst_controlled_property_new (object, name))) {
214 /* if we don't have a controller object yet, now is the time to create one */
216 self = g_object_newv (GST_TYPE_CONTROLLER, 0, NULL);
217 self->object = g_object_ref (object);
218 /* store the controller */
219 g_object_set_qdata (object, priv_gst_controller_key, self);
220 *ref_existing = FALSE;
222 /* only want one single _ref(), even for multiple properties */
225 *ref_existing = FALSE;
226 GST_INFO ("returning existing controller");
229 self->properties = g_list_prepend (self->properties, prop);
232 GST_WARNING ("trying to control property %s again", name);
235 *ref_existing = FALSE;
244 * gst_controller_new_valist:
245 * @object: the object of which some properties should be controlled
246 * @var_args: %NULL terminated list of property names that should be controlled
248 * Creates a new GstController for the given object's properties
250 * Returns: the new controller.
253 gst_controller_new_valist (GObject * object, va_list var_args)
256 gboolean ref_existing = TRUE;
259 g_return_val_if_fail (G_IS_OBJECT (object), NULL);
261 GST_INFO ("setting up a new controller");
263 self = g_object_get_qdata (object, priv_gst_controller_key);
264 /* create GstControlledProperty for each property */
265 while ((name = va_arg (var_args, gchar *))) {
266 self = gst_controller_add_property (self, object, name, &ref_existing);
271 GST_INFO ("controller->ref_count=%d", G_OBJECT (self)->ref_count);
276 * gst_controller_new_list:
277 * @object: the object of which some properties should be controlled
278 * @list: (transfer none) (element-type utf8): list of property names
279 * that should be controlled
281 * Creates a new GstController for the given object's properties
283 * Rename to: gst_controller_new
285 * Returns: the new controller.
288 gst_controller_new_list (GObject * object, GList * list)
291 gboolean ref_existing = TRUE;
295 g_return_val_if_fail (G_IS_OBJECT (object), NULL);
297 GST_INFO ("setting up a new controller");
299 self = g_object_get_qdata (object, priv_gst_controller_key);
300 /* create GstControlledProperty for each property */
301 for (node = list; node; node = g_list_next (node)) {
302 name = (gchar *) node->data;
303 self = gst_controller_add_property (self, object, name, &ref_existing);
307 GST_INFO ("controller->ref_count=%d", G_OBJECT (self)->ref_count);
312 * gst_controller_new:
313 * @object: the object of which some properties should be controlled
314 * @...: %NULL terminated list of property names that should be controlled
316 * Creates a new GstController for the given object's properties
318 * Returns: the new controller.
321 gst_controller_new (GObject * object, ...)
326 g_return_val_if_fail (G_IS_OBJECT (object), NULL);
328 va_start (var_args, object);
329 self = gst_controller_new_valist (object, var_args);
336 * gst_controller_remove_properties_valist:
337 * @self: the controller object from which some properties should be removed
338 * @var_args: %NULL terminated list of property names that should be removed
340 * Removes the given object properties from the controller
342 * Returns: %FALSE if one of the given property isn't handled by the controller, %TRUE otherwise
345 gst_controller_remove_properties_valist (GstController * self, va_list var_args)
348 GstControlledProperty *prop;
351 g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
353 while ((name = va_arg (var_args, gchar *))) {
354 /* find the property in the properties list of the controller, remove and free it */
355 g_mutex_lock (self->lock);
356 if ((prop = gst_controller_find_controlled_property (self, name))) {
357 self->properties = g_list_remove (self->properties, prop);
358 //g_signal_handler_disconnect (self->object, prop->notify_handler_id);
359 gst_controlled_property_free (prop);
363 g_mutex_unlock (self->lock);
370 * gst_controller_remove_properties_list:
371 * @self: the controller object from which some properties should be removed
372 * @list: (transfer none) (element-type utf8): #GList of property names that
375 * Removes the given object properties from the controller
377 * Rename to: gst_controller_remove_properties
379 * Returns: %FALSE if one of the given property isn't handled by the controller, %TRUE otherwise
382 gst_controller_remove_properties_list (GstController * self, GList * list)
385 GstControlledProperty *prop;
389 g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
391 for (tmp = list; tmp; tmp = g_list_next (tmp)) {
392 name = (gchar *) tmp->data;
394 /* find the property in the properties list of the controller, remove and free it */
395 g_mutex_lock (self->lock);
396 if ((prop = gst_controller_find_controlled_property (self, name))) {
397 self->properties = g_list_remove (self->properties, prop);
398 //g_signal_handler_disconnect (self->object, prop->notify_handler_id);
399 gst_controlled_property_free (prop);
403 g_mutex_unlock (self->lock);
410 * gst_controller_remove_properties:
411 * @self: the controller object from which some properties should be removed
412 * @...: %NULL terminated list of property names that should be removed
414 * Removes the given object properties from the controller
416 * Returns: %FALSE if one of the given property isn't handled by the controller, %TRUE otherwise
419 gst_controller_remove_properties (GstController * self, ...)
424 g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
426 va_start (var_args, self);
427 res = gst_controller_remove_properties_valist (self, var_args);
434 * gst_controller_set_property_disabled:
435 * @self: the #GstController which should be disabled
436 * @property_name: property to disable
437 * @disabled: boolean that specifies whether to disable the controller
440 * This function is used to disable the #GstController on a property for
441 * some time, i.e. gst_controller_sync_values() will do nothing for the
446 gst_controller_set_property_disabled (GstController * self,
447 const gchar * property_name, gboolean disabled)
449 GstControlledProperty *prop;
451 g_return_if_fail (GST_IS_CONTROLLER (self));
452 g_return_if_fail (property_name);
454 g_mutex_lock (self->lock);
455 if ((prop = gst_controller_find_controlled_property (self, property_name))) {
456 prop->disabled = disabled;
458 g_mutex_unlock (self->lock);
463 * gst_controller_set_disabled:
464 * @self: the #GstController which should be disabled
465 * @disabled: boolean that specifies whether to disable the controller
468 * This function is used to disable all properties of the #GstController
469 * for some time, i.e. gst_controller_sync_values() will do nothing.
473 gst_controller_set_disabled (GstController * self, gboolean disabled)
476 GstControlledProperty *prop;
478 g_return_if_fail (GST_IS_CONTROLLER (self));
480 g_mutex_lock (self->lock);
481 for (node = self->properties; node; node = node->next) {
483 prop->disabled = disabled;
485 g_mutex_unlock (self->lock);
489 * gst_controller_set_control_source:
490 * @self: the controller object
491 * @property_name: name of the property for which the #GstControlSource should be set
492 * @csource: the #GstControlSource that should be used for the property
494 * Sets the #GstControlSource for @property_name. If there already was a #GstControlSource
495 * for this property it will be unreferenced.
497 * Returns: %FALSE if the given property isn't handled by the controller or the new #GstControlSource
498 * couldn't be bound to the property, %TRUE if everything worked as expected.
501 gst_controller_set_control_source (GstController * self,
502 const gchar * property_name, GstControlSource * csource)
504 GstControlledProperty *prop;
505 gboolean ret = FALSE;
507 g_mutex_lock (self->lock);
508 if ((prop = gst_controller_find_controlled_property (self, property_name))) {
509 GstControlSource *old = prop->csource;
511 if (csource && (ret = gst_control_source_bind (csource, prop->pspec))) {
512 g_object_ref (csource);
513 prop->csource = csource;
514 } else if (!csource) {
516 prop->csource = NULL;
520 g_object_unref (old);
522 g_mutex_unlock (self->lock);
528 * gst_controller_get_control_source:
529 * @self: the controller object
530 * @property_name: name of the property for which the #GstControlSource should be get
532 * Gets the corresponding #GstControlSource for the property. This should be unreferenced
535 * Returns: (transfer full): the #GstControlSource for @property_name or NULL if
536 * the property is not controlled by this controller or no #GstControlSource was
540 gst_controller_get_control_source (GstController * self,
541 const gchar * property_name)
543 GstControlledProperty *prop;
544 GstControlSource *ret = NULL;
546 g_return_val_if_fail (GST_IS_CONTROLLER (self), NULL);
547 g_return_val_if_fail (property_name, NULL);
549 g_mutex_lock (self->lock);
550 if ((prop = gst_controller_find_controlled_property (self, property_name))) {
553 g_mutex_unlock (self->lock);
562 * gst_controller_get:
563 * @self: the controller object which handles the properties
564 * @property_name: the name of the property to get
565 * @timestamp: the time the control-change should be read from
567 * Gets the value for the given controller-handled property at the requested
570 * Returns: the GValue of the property at the given time, or %NULL if the
571 * property isn't handled by the controller
574 gst_controller_get (GstController * self, const gchar * property_name,
575 GstClockTime timestamp)
577 GstControlledProperty *prop;
580 g_return_val_if_fail (GST_IS_CONTROLLER (self), NULL);
581 g_return_val_if_fail (property_name, NULL);
582 g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
584 g_mutex_lock (self->lock);
585 if ((prop = gst_controller_find_controlled_property (self, property_name))) {
586 val = g_new0 (GValue, 1);
587 g_value_init (val, G_PARAM_SPEC_VALUE_TYPE (prop->pspec));
591 /* get current value via control source */
592 res = gst_control_source_get_value (prop->csource, timestamp, val);
598 g_object_get_property (self->object, prop->name, val);
601 g_mutex_unlock (self->lock);
607 * gst_controller_suggest_next_sync:
608 * @self: the controller that handles the values
610 * Returns a suggestion for timestamps where buffers should be split
611 * to get best controller results.
613 * Returns: Returns the suggested timestamp or %GST_CLOCK_TIME_NONE
614 * if no control-rate was set.
617 gst_controller_suggest_next_sync (GstController * self)
621 g_return_val_if_fail (GST_IS_CONTROLLER (self), GST_CLOCK_TIME_NONE);
622 g_return_val_if_fail (self->priv->control_rate != GST_CLOCK_TIME_NONE,
623 GST_CLOCK_TIME_NONE);
625 g_mutex_lock (self->lock);
627 /* TODO: Implement more logic, depending on interpolation mode
629 * FIXME: we need playback direction
631 ret = self->priv->last_sync + self->priv->control_rate;
633 g_mutex_unlock (self->lock);
639 * gst_controller_sync_values:
640 * @self: the controller that handles the values
641 * @timestamp: the time that should be processed
643 * Sets the properties of the element, according to the controller that (maybe)
644 * handles them and for the given timestamp.
646 * If this function fails, it is most likely the application developers fault.
647 * Most probably the control sources are not setup correctly.
649 * Returns: %TRUE if the controller values could be applied to the object
650 * properties, %FALSE otherwise
653 gst_controller_sync_values (GstController * self, GstClockTime timestamp)
655 GstControlledProperty *prop;
657 gboolean ret = TRUE, val_ret;
658 GValue value = { 0, };
660 g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
661 g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
663 GST_LOG ("sync_values");
665 g_mutex_lock (self->lock);
666 g_object_freeze_notify (self->object);
667 /* go over the controlled properties of the controller */
668 for (node = self->properties; node; node = g_list_next (node)) {
671 if (!prop->csource || prop->disabled)
674 GST_LOG ("property '%s' at ts=%" G_GUINT64_FORMAT, prop->name, timestamp);
676 /* we can make this faster
677 * http://bugzilla.gnome.org/show_bug.cgi?id=536939
679 g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop->pspec));
680 val_ret = gst_control_source_get_value (prop->csource, timestamp, &value);
681 if (G_LIKELY (val_ret)) {
682 /* always set the value for first time, but then only if it changed
683 * this should limit g_object_notify invocations.
684 * FIXME: can we detect negative playback rates?
686 if ((timestamp < self->priv->last_sync) ||
687 gst_value_compare (&value, &prop->last_value) != GST_VALUE_EQUAL) {
688 g_object_set_property (self->object, prop->name, &value);
689 g_value_copy (&value, &prop->last_value);
692 GST_DEBUG ("no control value for param %s", prop->name);
694 g_value_unset (&value);
697 self->priv->last_sync = timestamp;
698 g_object_thaw_notify (self->object);
700 g_mutex_unlock (self->lock);
706 * gst_controller_get_value_arrays:
707 * @self: the controller that handles the values
708 * @timestamp: the time that should be processed
709 * @value_arrays: list to return the control-values in
711 * Function to be able to get an array of values for one or more given element
714 * All fields of the %GstValueArray in the list must be filled correctly.
715 * Especially the GstValueArray->values arrays must be big enough to keep
716 * the requested amount of values.
718 * The types of the values in the array are the same as the property's type.
720 * <note><para>This doesn't modify the controlled GObject properties!</para></note>
722 * Returns: %TRUE if the given array(s) could be filled, %FALSE otherwise
725 gst_controller_get_value_arrays (GstController * self,
726 GstClockTime timestamp, GSList * value_arrays)
731 g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
732 g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
733 g_return_val_if_fail (value_arrays, FALSE);
735 for (node = value_arrays; (res && node); node = g_slist_next (node)) {
736 res = gst_controller_get_value_array (self, timestamp, node->data);
743 * gst_controller_get_value_array:
744 * @self: the controller that handles the values
745 * @timestamp: the time that should be processed
746 * @value_array: array to put control-values in
748 * Function to be able to get an array of values for one element property.
750 * All fields of @value_array must be filled correctly. Especially the
751 * @value_array->values array must be big enough to keep the requested amount
752 * of values (as indicated by the nbsamples field).
754 * The type of the values in the array is the same as the property's type.
756 * <note><para>This doesn't modify the controlled GObject property!</para></note>
758 * Returns: %TRUE if the given array could be filled, %FALSE otherwise
761 gst_controller_get_value_array (GstController * self, GstClockTime timestamp,
762 GstValueArray * value_array)
764 gboolean res = FALSE;
765 GstControlledProperty *prop;
767 g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
768 g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
769 g_return_val_if_fail (value_array, FALSE);
770 g_return_val_if_fail (value_array->property_name, FALSE);
771 g_return_val_if_fail (value_array->values, FALSE);
773 g_mutex_lock (self->lock);
776 gst_controller_find_controlled_property (self,
777 value_array->property_name))) {
778 /* get current value_array via control source */
784 gst_control_source_get_value_array (prop->csource, timestamp,
789 g_mutex_unlock (self->lock);
793 /* gobject handling */
796 _gst_controller_get_property (GObject * object, guint property_id,
797 GValue * value, GParamSpec * pspec)
799 GstController *self = GST_CONTROLLER (object);
801 switch (property_id) {
802 case PROP_CONTROL_RATE:{
803 /* FIXME: don't change if element is playing, controller works for GObject
806 GstState c_state, p_state;
807 GstStateChangeReturn ret;
809 ret = gst_element_get_state (self->object, &c_state, &p_state, 0);
810 if ((ret == GST_STATE_CHANGE_SUCCESS &&
811 (c_state == GST_STATE_NULL || c_state == GST_STATE_READY)) ||
812 (ret == GST_STATE_CHANGE_ASYNC &&
813 (p_state == GST_STATE_NULL || p_state == GST_STATE_READY))) {
815 g_value_set_uint64 (value, self->priv->control_rate);
819 GST_WARNING ("Changing the control rate is only allowed if the elemnt"
820 " is in NULL or READY");
826 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
832 /* sets the given properties for this object */
834 _gst_controller_set_property (GObject * object, guint property_id,
835 const GValue * value, GParamSpec * pspec)
837 GstController *self = GST_CONTROLLER (object);
839 switch (property_id) {
840 case PROP_CONTROL_RATE:{
841 self->priv->control_rate = g_value_get_uint64 (value);
845 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
852 _gst_controller_dispose (GObject * object)
854 GstController *self = GST_CONTROLLER (object);
856 if (self->object != NULL) {
857 g_mutex_lock (self->lock);
858 /* free list of properties */
859 if (self->properties) {
862 for (node = self->properties; node; node = g_list_next (node)) {
863 GstControlledProperty *prop = node->data;
865 gst_controlled_property_free (prop);
867 g_list_free (self->properties);
868 self->properties = NULL;
871 /* remove controller from object's qdata list */
872 g_object_set_qdata (self->object, priv_gst_controller_key, NULL);
873 g_object_unref (self->object);
875 g_mutex_unlock (self->lock);
878 if (G_OBJECT_CLASS (parent_class)->dispose)
879 (G_OBJECT_CLASS (parent_class)->dispose) (object);
883 _gst_controller_finalize (GObject * object)
885 GstController *self = GST_CONTROLLER (object);
887 g_mutex_free (self->lock);
889 if (G_OBJECT_CLASS (parent_class)->finalize)
890 (G_OBJECT_CLASS (parent_class)->finalize) (object);
894 _gst_controller_init (GTypeInstance * instance, gpointer g_class)
896 GstController *self = GST_CONTROLLER (instance);
898 self->lock = g_mutex_new ();
900 G_TYPE_INSTANCE_GET_PRIVATE (self, GST_TYPE_CONTROLLER,
901 GstControllerPrivate);
902 self->priv->last_sync = GST_CLOCK_TIME_NONE;
903 self->priv->control_rate = 100 * GST_MSECOND;
907 _gst_controller_class_init (GstControllerClass * klass)
909 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
911 parent_class = g_type_class_peek_parent (klass);
912 g_type_class_add_private (klass, sizeof (GstControllerPrivate));
914 gobject_class->set_property = _gst_controller_set_property;
915 gobject_class->get_property = _gst_controller_get_property;
916 gobject_class->dispose = _gst_controller_dispose;
917 gobject_class->finalize = _gst_controller_finalize;
919 priv_gst_controller_key = g_quark_from_static_string ("gst::controller");
921 /* register properties */
922 g_object_class_install_property (gobject_class, PROP_CONTROL_RATE,
923 g_param_spec_uint64 ("control-rate",
925 "Controlled properties will be updated at least every control-rate nanoseconds",
926 1, G_MAXUINT, 100 * GST_MSECOND,
927 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
929 /* register signals */
930 /* set defaults for overridable methods */
934 gst_controller_get_type (void)
936 static volatile gsize type = 0;
938 if (g_once_init_enter (&type)) {
940 static const GTypeInfo info = {
941 sizeof (GstControllerClass),
942 NULL, /* base_init */
943 NULL, /* base_finalize */
944 (GClassInitFunc) _gst_controller_class_init, /* class_init */
945 NULL, /* class_finalize */
946 NULL, /* class_data */
947 sizeof (GstController),
949 (GInstanceInitFunc) _gst_controller_init, /* instance_init */
950 NULL /* value_table */
952 _type = g_type_register_static (G_TYPE_OBJECT, "GstController", &info, 0);
953 g_once_init_leave (&type, _type);