1 /* GStreamer Editing Services
2 * Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
3 * 2009 Nokia Corporation
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef __GES_INTERNAL_H__
22 #define __GES_INTERNAL_H__
27 #include "ges-timeline.h"
28 #include "ges-track-element.h"
29 #include "ges-timeline-element.h"
31 #include "ges-asset.h"
32 #include "ges-base-xml-formatter.h"
34 GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
35 #define GST_CAT_DEFAULT _ges_debug
37 /* The first 2 GNL priorities are used for:
38 * 0- The Mixing element
41 #define MIN_GNL_PRIO 2
42 #define LAYER_HEIGHT 1000
44 #define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
45 #define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
46 #define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
47 #define _MAXDURATION(obj) GES_TIMELINE_ELEMENT_MAX_DURATION (obj)
48 #define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
49 #define _END(obj) (_START (obj) + _DURATION (obj))
50 #define _set_start0 ges_timeline_element_set_start
51 #define _set_inpoint0 ges_timeline_element_set_inpoint
52 #define _set_duration0 ges_timeline_element_set_duration
53 #define _set_priority0 ges_timeline_element_set_priority
55 G_GNUC_INTERNAL gboolean
56 timeline_ripple_object (GESTimeline *timeline, GESTrackElement *obj,
57 GList * layers, GESEdge edge,
60 G_GNUC_INTERNAL gboolean
61 timeline_slide_object (GESTimeline *timeline, GESTrackElement *obj,
62 GList * layers, GESEdge edge, guint64 position);
64 G_GNUC_INTERNAL gboolean
65 timeline_roll_object (GESTimeline *timeline, GESTrackElement *obj,
66 GList * layers, GESEdge edge, guint64 position);
68 G_GNUC_INTERNAL gboolean
69 timeline_trim_object (GESTimeline *timeline, GESTrackElement * object,
70 GList * layers, GESEdge edge, guint64 position);
71 G_GNUC_INTERNAL gboolean
72 ges_timeline_trim_object_simple (GESTimeline * timeline, GESTimelineElement * obj,
73 GList * layers, GESEdge edge, guint64 position, gboolean snapping);
75 G_GNUC_INTERNAL gboolean
76 ges_timeline_move_object_simple (GESTimeline * timeline, GESTimelineElement * object,
77 GList * layers, GESEdge edge, guint64 position);
79 G_GNUC_INTERNAL gboolean
80 timeline_move_object (GESTimeline *timeline, GESTrackElement * object,
81 GList * layers, GESEdge edge, guint64 position);
83 G_GNUC_INTERNAL gboolean
84 timeline_context_to_layer (GESTimeline *timeline, gint offset);
87 timeline_add_group (GESTimeline *timeline,
91 timeline_remove_group (GESTimeline *timeline,
95 ges_asset_cache_init (void);
98 ges_asset_set_id (GESAsset *asset, const gchar *id);
101 ges_asset_cache_put (GESAsset * asset, GSimpleAsyncResult *res);
103 G_GNUC_INTERNAL gboolean
104 ges_asset_cache_set_loaded(GType extractable_type, const gchar * id, GError *error);
106 G_GNUC_INTERNAL GHashTable *
107 ges_track_element_get_bindings_hashtable(GESTrackElement *element);
110 ges_asset_cache_lookup(GType extractable_type, const gchar * id);
113 ges_asset_set_proxy (GESAsset *asset, const gchar *new_id);
115 G_GNUC_INTERNAL gboolean
116 ges_asset_request_id_update (GESAsset *asset, gchar **proposed_id,
119 /* GESExtractable internall methods
121 * FIXME Check if that should be public later
123 G_GNUC_INTERNAL GType
124 ges_extractable_type_get_asset_type (GType type);
126 G_GNUC_INTERNAL gchar *
127 ges_extractable_type_check_id (GType type, const gchar *id, GError **error);
129 G_GNUC_INTERNAL GParameter *
130 ges_extractable_type_get_parameters_from_id (GType type, const gchar *id,
132 G_GNUC_INTERNAL GType
133 ges_extractable_get_real_extractable_type_for_id (GType type, const gchar * id);
135 G_GNUC_INTERNAL gboolean
136 ges_extractable_register_metas (GType extractable_type, GESAsset *asset);
138 /************************************************
140 * GESFormatter internal methods *
142 ************************************************/
144 ges_formatter_set_project (GESFormatter *formatter,
145 GESProject *project);
146 G_GNUC_INTERNAL GESProject *
147 ges_formatter_get_project (GESFormatter *formatter);
148 G_GNUC_INTERNAL GESAsset *
149 _find_formatter_asset_for_uri (const gchar *uri);
153 /************************************************
155 * GESProject internal methods *
157 ************************************************/
159 /* FIXME This should probably become public, but we need to make sure it
160 * is the right API before doing so */
161 G_GNUC_INTERNAL gboolean ges_project_set_loaded (GESProject * project,
162 GESFormatter *formatter);
163 G_GNUC_INTERNAL gchar * ges_project_try_updating_id (GESProject *self,
166 G_GNUC_INTERNAL void ges_project_add_loading_asset (GESProject *project,
167 GType extractable_type,
170 /************************************************
172 * GESBaseXmlFormatter internal methods *
174 ************************************************/
176 /* FIXME GESBaseXmlFormatter is all internal for now, the API is not stable
177 * fo now, so do not expose it */
178 G_GNUC_INTERNAL void ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
180 const char *asset_id,
183 GstClockTime inpoint,
184 GstClockTime duration,
186 GESTrackType track_types,
187 GstStructure *properties,
188 const gchar *metadatas,
190 G_GNUC_INTERNAL void ges_base_xml_formatter_add_asset (GESBaseXmlFormatter * self,
192 GType extractable_type,
193 GstStructure *properties,
194 const gchar *metadatas,
196 G_GNUC_INTERNAL void ges_base_xml_formatter_add_layer (GESBaseXmlFormatter *self,
197 GType extractable_type,
199 GstStructure *properties,
200 const gchar *metadatas,
202 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track (GESBaseXmlFormatter *self,
203 GESTrackType track_type,
206 GstStructure *properties,
207 const gchar *metadatas,
209 void ges_base_xml_formatter_add_encoding_profile (GESBaseXmlFormatter * self,
213 const gchar * description,
215 const gchar * preset,
216 const gchar * preset_name,
219 GstCaps * restriction,
221 gboolean variableframerate,
222 GstStructure * properties,
224 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track_element (GESBaseXmlFormatter *self,
226 const gchar *asset_id,
227 const gchar * track_id,
228 const gchar *timeline_obj_id,
229 GstStructure *children_properties,
230 GstStructure *properties,
231 const gchar *metadatas,
234 G_GNUC_INTERNAL void ges_base_xml_formatter_add_control_binding (GESBaseXmlFormatter * self,
235 const gchar * binding_type,
236 const gchar * source_type,
237 const gchar * property_name,
239 const gchar *track_id,
240 GSList * timed_values);
242 G_GNUC_INTERNAL void set_property_foreach (GQuark field_id,
243 const GValue * value,
246 /* Function to initialise GES */
247 G_GNUC_INTERNAL void _init_standard_transition_assets (void);
248 G_GNUC_INTERNAL void _init_formatter_assets (void);
251 G_GNUC_INTERNAL gint element_start_compare (GESTimelineElement * a,
252 GESTimelineElement * b);
253 G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement * a,
254 GESTimelineElement * b);
257 ges_base_xml_formatter_set_timeline_properties(GESBaseXmlFormatter * self,
258 GESTimeline *timeline,
259 const gchar *properties,
260 const gchar *metadatas);
262 /****************************************************
264 ****************************************************/
265 G_GNUC_INTERNAL void _ges_container_sort_children (GESContainer *container);
266 G_GNUC_INTERNAL void _ges_container_sort_children_by_end (GESContainer *container);
268 /****************************************************
270 ****************************************************/
271 void ges_clip_set_layer (GESClip *clip, GESLayer *layer);
272 gboolean ges_clip_is_moving_from_layer (GESClip *clip);
273 guint32 ges_clip_get_layer_priority (GESClip *clip);
274 void ges_clip_set_moving_from_layer (GESClip *clip, gboolean is_moving);
275 GESTrackElement* ges_clip_create_track_element (GESClip *clip, GESTrackType type);
276 GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType type);
279 /****************************************************
281 ****************************************************/
282 #define GNL_OBJECT_TRACK_ELEMENT_QUARK (g_quark_from_string ("gnl_object_track_element_quark"))
283 G_GNUC_INTERNAL gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track);
284 G_GNUC_INTERNAL guint32 _ges_track_element_get_layer_priority (GESTrackElement * element);
285 G_GNUC_INTERNAL void ges_track_element_copy_properties (GESTimelineElement * element,
286 GESTimelineElement * elementcopy);
288 G_GNUC_INTERNAL void ges_track_element_split_bindings (GESTrackElement *element,
289 GESTrackElement *new_element,
291 #endif /* __GES_INTERNAL_H__ */