3 * Copyright (C) 2005 Stefan Kost <ensonic at users dot sf dot net>
4 * 2011 Stefan Sauer <ensonic at users dot sf dot net>
6 * gstcontroller.h: 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.
24 #ifndef __GST_CONTROLLER_H__
25 #define __GST_CONTROLLER_H__
27 #include <gst/gstconfig.h>
32 #include <glib-object.h>
33 #include <glib/gprintf.h>
35 #include <gst/gstobject.h>
36 #include <gst/gstcontrolsource.h>
42 #define GST_TYPE_CONTROLLER (gst_controller_get_type ())
43 #define GST_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CONTROLLER, GstController))
44 #define GST_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CONTROLLER, GstControllerClass))
45 #define GST_IS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CONTROLLER))
46 #define GST_IS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CONTROLLERE))
47 #define GST_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTROLLER, GstControllerClass))
49 typedef struct _GstController GstController;
50 typedef struct _GstControllerClass GstControllerClass;
51 typedef struct _GstControllerPrivate GstControllerPrivate;
56 * The instance structure of GstController
63 GList *properties; /* List of GstControlledProperty */
64 GMutex *lock; /* Secure property access, elements will access from threads */
65 GstObject *object; /* the object we control */
68 GstControllerPrivate *priv;
69 gpointer _gst_reserved[GST_PADDING - 1];
72 struct _GstControllerClass
74 GObjectClass parent_class;
77 gpointer _gst_reserved[GST_PADDING];
80 GType gst_controller_get_type (void);
82 /* GstController functions */
84 GstController *gst_controller_new_valist (GstObject * object, va_list var_args);
85 GstController *gst_controller_new_list (GstObject * object, GList *list);
86 GstController *gst_controller_new (GstObject * object, ...) G_GNUC_NULL_TERMINATED;
88 gboolean gst_controller_add_properties_valist (GstController * self, va_list var_args);
89 gboolean gst_controller_add_properties_list (GstController * self, GList *list);
90 gboolean gst_controller_add_properties (GstController * self, ...) G_GNUC_NULL_TERMINATED;
92 gboolean gst_controller_remove_properties_valist (GstController * self, va_list var_args);
93 gboolean gst_controller_remove_properties_list (GstController * self, GList *list);
94 gboolean gst_controller_remove_properties (GstController * self, ...) G_GNUC_NULL_TERMINATED;
96 gboolean gst_controller_is_active (GstController * self);
97 void gst_controller_set_disabled (GstController *self, gboolean disabled);
98 void gst_controller_set_property_disabled (GstController *self, const gchar * property_name, gboolean disabled);
99 gboolean gst_controller_set_control_source (GstController *self, const gchar * property_name, GstControlSource *csource);
100 GstControlSource * gst_controller_get_control_source (GstController *self, const gchar * property_name);
102 GstClockTime gst_controller_suggest_next_sync (GstController *self);
103 gboolean gst_controller_sync_values (GstController * self,
104 GstClockTime timestamp);
106 GValue *gst_controller_get (GstController * self, const gchar * property_name,
107 GstClockTime timestamp);
108 gboolean gst_controller_get_value_arrays (GstController * self,
109 GstClockTime timestamp, GSList * value_arrays);
110 gboolean gst_controller_get_value_array (GstController * self,
111 GstClockTime timestamp, GstValueArray * value_array);
116 #endif /* __GST_CONTROLLER_H__ */