Initialize Tizen 2.3
[framework/multimedia/gstreamer0.10.git] / mobile / libs / gst / controller / gstcontroller.h
1 /* GStreamer
2  *
3  * Copyright (C) <2005> Stefan Kost <ensonic at users dot sf dot net>
4  *
5  * gst-controller.h: dynamic parameter control subsystem
6  *
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.
11  *
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.
16  *
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.
21  */
22
23 #ifndef __GST_CONTROLLER_H__
24 #define __GST_CONTROLLER_H__
25
26 #include <string.h>
27
28 #include <glib.h>
29 #include <glib-object.h>
30 #include <glib/gprintf.h>
31 #include <gst/gst.h>
32
33 #include <gst/controller/gstcontrolsource.h>
34 #include <gst/controller/gstinterpolationcontrolsource.h>
35
36 G_BEGIN_DECLS
37
38 /* type macros */
39
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))
46
47 typedef struct _GstController GstController;
48 typedef struct _GstControllerClass GstControllerClass;
49 typedef struct _GstControllerPrivate GstControllerPrivate;
50
51 /**
52  * GstController:
53  *
54  * The instance structure of GstController
55  */
56
57 struct _GstController
58 {
59   GObject parent;
60
61   GList *properties;  /* List of GstControlledProperty */
62   GMutex *lock;       /* Secure property access, elements will access from threads */
63   GObject *object;    /* the object we control */
64
65   /*< private >*/
66   GstControllerPrivate *priv;
67   gpointer       _gst_reserved[GST_PADDING - 1];
68 };
69
70 struct _GstControllerClass
71 {
72   GObjectClass parent_class;
73
74   /*< private >*/
75   gpointer       _gst_reserved[GST_PADDING];
76 };
77
78 GType gst_controller_get_type (void);
79
80 /* GstController functions */
81
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;
85
86 gboolean gst_controller_remove_properties_valist (GstController * self,
87     va_list var_args);
88 gboolean gst_controller_remove_properties_list (GstController * self,
89                                                 GList *list);
90 gboolean gst_controller_remove_properties (GstController * self, ...) G_GNUC_NULL_TERMINATED;
91
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);
96
97 GstClockTime gst_controller_suggest_next_sync (GstController *self);
98 gboolean gst_controller_sync_values (GstController * self,
99     GstClockTime timestamp);
100
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);
107
108 /* GObject convenience functions */
109
110 GstController *gst_object_control_properties (GObject * object, ...) G_GNUC_NULL_TERMINATED;
111 gboolean gst_object_uncontrol_properties (GObject * object, ...) G_GNUC_NULL_TERMINATED;
112
113 GstController *gst_object_get_controller (GObject * object);
114 gboolean gst_object_set_controller (GObject * object, GstController * controller);
115
116 GstClockTime gst_object_suggest_next_sync (GObject * object);
117 gboolean gst_object_sync_values (GObject * object, GstClockTime timestamp);
118
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);
121
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);
126
127 GstClockTime gst_object_get_control_rate (GObject * object);
128 void gst_object_set_control_rate (GObject * object, GstClockTime control_rate);
129
130 /* lib init/done */
131
132 gboolean gst_controller_init (int * argc, char ***argv);
133
134
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);
141
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);
145
146 const GList *gst_controller_get_all (GstController * self,
147     const gchar * property_name);
148
149 gboolean gst_controller_set_interpolation_mode (GstController * self,
150     const gchar * property_name, GstInterpolateMode mode);
151 #endif /* GST_DISABLE_DEPRECATED */
152
153 G_END_DECLS
154
155 #endif /* __GST_CONTROLLER_H__ */