equal
deleted
inserted
replaced
39 #include "gstcontroller.h" |
39 #include "gstcontroller.h" |
40 |
40 |
41 #define GST_CAT_DEFAULT controller_debug |
41 #define GST_CAT_DEFAULT controller_debug |
42 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); |
42 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); |
43 |
43 |
44 extern GQuark priv_gst_controller_key; |
|
45 |
|
46 /** |
44 /** |
47 * gst_object_control_properties: |
45 * gst_object_control_properties: |
48 * @object: the object of which some properties should be controlled |
46 * @object: the object of which some properties should be controlled |
49 * @...: %NULL terminated list of property names that should be controlled |
47 * @...: %NULL terminated list of property names that should be controlled |
50 * |
48 * |
147 #endif |
145 #endif |
148 |
146 |
149 gboolean |
147 gboolean |
150 gst_object_set_controller (GObject * object, GstController * controller) |
148 gst_object_set_controller (GObject * object, GstController * controller) |
151 { |
149 { |
152 GstController *ctrl; |
|
153 |
|
154 g_return_val_if_fail (G_IS_OBJECT (object), FALSE); |
150 g_return_val_if_fail (G_IS_OBJECT (object), FALSE); |
155 g_return_val_if_fail (controller, FALSE); |
151 g_return_val_if_fail (controller, FALSE); |
156 |
152 |
157 if (!(ctrl = g_object_get_qdata (object, priv_gst_controller_key))) { |
153 if (!g_object_get_qdata (object, priv_gst_controller_key)) { |
158 g_object_set_qdata (object, priv_gst_controller_key, controller); |
154 g_object_set_qdata (object, priv_gst_controller_key, controller); |
159 return (TRUE); |
155 return (TRUE); |
160 } |
156 } |
161 return (FALSE); |
157 return (FALSE); |
162 } |
158 } |
205 gst_object_sync_values (GObject * object, GstClockTime timestamp) |
201 gst_object_sync_values (GObject * object, GstClockTime timestamp) |
206 { |
202 { |
207 GstController *ctrl = NULL; |
203 GstController *ctrl = NULL; |
208 |
204 |
209 g_return_val_if_fail (G_IS_OBJECT (object), FALSE); |
205 g_return_val_if_fail (G_IS_OBJECT (object), FALSE); |
210 g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); |
|
211 |
206 |
212 if ((ctrl = g_object_get_qdata (object, priv_gst_controller_key))) { |
207 if ((ctrl = g_object_get_qdata (object, priv_gst_controller_key))) { |
213 return gst_controller_sync_values (ctrl, timestamp); |
208 return gst_controller_sync_values (ctrl, timestamp); |
214 } |
209 } |
215 return (FALSE); |
210 /* this is no failure, its called by elements regardless if there is a |
|
211 * controller assigned or not |
|
212 */ |
|
213 return (TRUE); |
216 } |
214 } |
217 |
215 |
218 /** |
216 /** |
219 * gst_object_set_control_source: |
217 * gst_object_set_control_source: |
220 * @object: the controller object |
218 * @object: the controller object |