3 * Copyright (C) <2005> Stefan Kost <ensonic at users dot sf dot net>
5 * gst-controller.h: dynamic parameter control subsystem
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_CONTROLLER_H__
24 #define __GST_CONTROLLER_H__
29 #include <glib-object.h>
30 #include <glib/gprintf.h>
33 #include <gst/controller/gstcontrolsource.h>
34 #include <gst/controller/gstinterpolationcontrolsource.h>
40 #define GST_TYPE_CONTROLLER (gst_controller_get_type ())
41 #define GST_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CONTROLLER, GstController))
42 #define GST_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CONTROLLER, GstControllerClass))
43 #define GST_IS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CONTROLLER))
44 #define GST_IS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CONTROLLERE))
45 #define GST_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTROLLER, GstControllerClass))
47 typedef struct _GstController GstController;
48 typedef struct _GstControllerClass GstControllerClass;
49 typedef struct _GstControllerPrivate GstControllerPrivate;
54 * The instance structure of GstController
61 GList *properties; /* List of GstControlledProperty */
62 GMutex *lock; /* Secure property access, elements will access from threads */
63 GObject *object; /* the object we control */
66 GstControllerPrivate *priv;
67 gpointer _gst_reserved[GST_PADDING - 1];
70 struct _GstControllerClass
72 GObjectClass parent_class;
75 gpointer _gst_reserved[GST_PADDING];
78 GType gst_controller_get_type (void);
80 /* GstController functions */
82 GstController *gst_controller_new_valist (GObject * object, va_list var_args);
83 GstController *gst_controller_new_list (GObject * object, GList *list);
84 GstController *gst_controller_new (GObject * object, ...) G_GNUC_NULL_TERMINATED;
86 gboolean gst_controller_remove_properties_valist (GstController * self,
88 gboolean gst_controller_remove_properties_list (GstController * self,
90 gboolean gst_controller_remove_properties (GstController * self, ...) G_GNUC_NULL_TERMINATED;
92 void gst_controller_set_disabled (GstController *self, gboolean disabled);
93 void gst_controller_set_property_disabled (GstController *self, const gchar * property_name, gboolean disabled);
94 gboolean gst_controller_set_control_source (GstController *self, const gchar * property_name, GstControlSource *csource);
95 GstControlSource * gst_controller_get_control_source (GstController *self, const gchar * property_name);
97 GstClockTime gst_controller_suggest_next_sync (GstController *self);
98 gboolean gst_controller_sync_values (GstController * self,
99 GstClockTime timestamp);
101 GValue *gst_controller_get (GstController * self, const gchar * property_name,
102 GstClockTime timestamp);
103 gboolean gst_controller_get_value_arrays (GstController * self,
104 GstClockTime timestamp, GSList * value_arrays);
105 gboolean gst_controller_get_value_array (GstController * self,
106 GstClockTime timestamp, GstValueArray * value_array);
108 /* GObject convenience functions */
110 GstController *gst_object_control_properties (GObject * object, ...) G_GNUC_NULL_TERMINATED;
111 gboolean gst_object_uncontrol_properties (GObject * object, ...) G_GNUC_NULL_TERMINATED;
113 GstController *gst_object_get_controller (GObject * object);
114 gboolean gst_object_set_controller (GObject * object, GstController * controller);
116 GstClockTime gst_object_suggest_next_sync (GObject * object);
117 gboolean gst_object_sync_values (GObject * object, GstClockTime timestamp);
119 gboolean gst_object_set_control_source (GObject *object, const gchar * property_name, GstControlSource *csource);
120 GstControlSource * gst_object_get_control_source (GObject *object, const gchar * property_name);
122 gboolean gst_object_get_value_arrays (GObject * object,
123 GstClockTime timestamp, GSList * value_arrays);
124 gboolean gst_object_get_value_array (GObject * object,
125 GstClockTime timestamp, GstValueArray * value_array);
127 GstClockTime gst_object_get_control_rate (GObject * object);
128 void gst_object_set_control_rate (GObject * object, GstClockTime control_rate);
132 gboolean gst_controller_init (int * argc, char ***argv);
135 /* FIXME: deprecated functions */
136 #ifndef GST_DISABLE_DEPRECATED
137 gboolean gst_controller_set (GstController * self, const gchar * property_name,
138 GstClockTime timestamp, GValue * value);
139 gboolean gst_controller_set_from_list (GstController * self,
140 const gchar * property_name, GSList * timedvalues);
142 gboolean gst_controller_unset (GstController * self, const gchar * property_name,
143 GstClockTime timestamp);
144 gboolean gst_controller_unset_all (GstController * self, const gchar * property_name);
146 const GList *gst_controller_get_all (GstController * self,
147 const gchar * property_name);
149 gboolean gst_controller_set_interpolation_mode (GstController * self,
150 const gchar * property_name, GstInterpolateMode mode);
151 #endif /* GST_DISABLE_DEPRECATED */
155 #endif /* __GST_CONTROLLER_H__ */