1 | /* GStreamer |
2 | * |
3 | * Copyright (C) 2011 Stefan Sauer <[email protected]> |
4 | * |
5 | * gstcontrolbinding.h: Attachment for control sources |
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., 51 Franklin St, Fifth Floor, |
20 | * Boston, MA 02110-1301, USA. |
21 | */ |
22 | |
23 | #ifndef __GST_CONTROL_BINDING_H__ |
24 | #define __GST_CONTROL_BINDING_H__ |
25 | |
26 | #include <gst/gstconfig.h> |
27 | |
28 | #include <glib-object.h> |
29 | |
30 | G_BEGIN_DECLS |
31 | |
32 | #define GST_TYPE_CONTROL_BINDING \ |
33 | (gst_control_binding_get_type()) |
34 | #define GST_CONTROL_BINDING(obj) \ |
35 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CONTROL_BINDING,GstControlBinding)) |
36 | #define GST_CONTROL_BINDING_CLASS(klass) \ |
37 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CONTROL_BINDING,GstControlBindingClass)) |
38 | #define GST_IS_CONTROL_BINDING(obj) \ |
39 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CONTROL_BINDING)) |
40 | #define GST_IS_CONTROL_BINDING_CLASS(klass) \ |
41 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CONTROL_BINDING)) |
42 | #define GST_CONTROL_BINDING_GET_CLASS(obj) \ |
43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstControlBindingClass)) |
44 | |
45 | typedef struct _GstControlBinding GstControlBinding; |
46 | typedef struct _GstControlBindingClass GstControlBindingClass; |
47 | typedef struct _GstControlBindingPrivate GstControlBindingPrivate; |
48 | |
49 | #include <gst/gstcontrolsource.h> |
50 | |
51 | /* FIXME(2.0): remove, this is unused */ |
52 | typedef void (* GstControlBindingConvert) (GstControlBinding *binding, gdouble src_value, GValue *dest_value); |
53 | |
54 | /** |
55 | * GstControlBinding: |
56 | * @name: name of the property of this binding |
57 | * @pspec: #GParamSpec for this property |
58 | * |
59 | * The instance structure of #GstControlBinding. |
60 | */ |
61 | struct _GstControlBinding { |
62 | GstObject parent; |
63 | |
64 | /*< public >*/ |
65 | gchar *name; |
66 | GParamSpec *pspec; |
67 | |
68 | /*< private >*/ |
69 | #ifndef GST_DISABLE_DEPRECATED |
70 | GstObject *object; /* GstObject owning the property |
71 | * (== parent when bound) */ |
72 | #else |
73 | gpointer __object; |
74 | #endif |
75 | gboolean disabled; |
76 | |
77 | union { |
78 | struct { |
79 | GstControlBindingPrivate *priv; |
80 | } abi; |
81 | gpointer _gst_reserved[GST_PADDING]; |
82 | } ABI; |
83 | }; |
84 | |
85 | /** |
86 | * GstControlBindingClass: |
87 | * @parent_class: Parent class |
88 | * @sync_values: implementation for updating the target values |
89 | * @get_value: implementation to fetch a single control-value |
90 | * @get_value_array: implementation to fetch a series of control-values |
91 | * @get_g_value_array: implementation to fetch a series of control-values |
92 | * as g_values |
93 | * |
94 | * The class structure of #GstControlBinding. |
95 | */ |
96 | |
97 | struct _GstControlBindingClass |
98 | { |
99 | GstObjectClass parent_class; |
100 | |
101 | /*< public >*/ |
102 | gboolean (* sync_values) (GstControlBinding *binding, GstObject *object, GstClockTime timestamp, GstClockTime last_sync); |
103 | GValue * (* get_value) (GstControlBinding *binding, GstClockTime timestamp); |
104 | gboolean (* get_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, gpointer values); |
105 | gboolean (* get_g_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, GValue *values); |
106 | |
107 | /*< private >*/ |
108 | gpointer _gst_reserved[GST_PADDING]; |
109 | }; |
110 | |
111 | #define GST_CONTROL_BINDING_PSPEC(cb) (((GstControlBinding *) cb)->pspec) |
112 | |
113 | GST_API |
114 | GType gst_control_binding_get_type (void); |
115 | |
116 | /* Functions */ |
117 | |
118 | GST_API |
119 | gboolean gst_control_binding_sync_values (GstControlBinding * binding, GstObject *object, |
120 | GstClockTime timestamp, GstClockTime last_sync); |
121 | GST_API |
122 | GValue * gst_control_binding_get_value (GstControlBinding *binding, |
123 | GstClockTime timestamp); |
124 | GST_API |
125 | gboolean gst_control_binding_get_value_array (GstControlBinding *binding, GstClockTime timestamp, |
126 | GstClockTime interval, guint n_values, gpointer values); |
127 | GST_API |
128 | gboolean gst_control_binding_get_g_value_array (GstControlBinding *binding, GstClockTime timestamp, |
129 | GstClockTime interval, guint n_values, GValue *values); |
130 | GST_API |
131 | void gst_control_binding_set_disabled (GstControlBinding * binding, gboolean disabled); |
132 | |
133 | GST_API |
134 | gboolean gst_control_binding_is_disabled (GstControlBinding * binding); |
135 | |
136 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC |
137 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstControlBinding, gst_object_unref) |
138 | #endif |
139 | |
140 | G_END_DECLS |
141 | |
142 | #endif /* __GST_CONTROL_BINDING_H__ */ |
143 | |