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"
36 GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
37 #define GST_CAT_DEFAULT _ges_debug
39 /* The first 2 NLE priorities are used for:
40 * 0- The Mixing element
43 #define MIN_NLE_PRIO 2
44 #define LAYER_HEIGHT 1000
46 #define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
47 #define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
48 #define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
49 #define _MAXDURATION(obj) GES_TIMELINE_ELEMENT_MAX_DURATION (obj)
50 #define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
51 #define _END(obj) (_START (obj) + _DURATION (obj))
52 #define _set_start0 ges_timeline_element_set_start
53 #define _set_inpoint0 ges_timeline_element_set_inpoint
54 #define _set_duration0 ges_timeline_element_set_duration
55 #define _set_priority0 ges_timeline_element_set_priority
57 #define GES_TIMELINE_ELEMENT_FORMAT \
59 " start: %" GST_TIME_FORMAT \
60 " inpoint: %" GST_TIME_FORMAT \
61 " duration: %" GST_TIME_FORMAT
63 #define GES_TIMELINE_ELEMENT_ARGS(element) \
64 GES_TIMELINE_ELEMENT_NAME(element), element, \
65 GST_TIME_ARGS(GES_TIMELINE_ELEMENT_START(element)), \
66 GST_TIME_ARGS(GES_TIMELINE_ELEMENT_INPOINT(element)), \
67 GST_TIME_ARGS(GES_TIMELINE_ELEMENT_DURATION(element))
69 G_GNUC_INTERNAL gboolean
70 timeline_ripple_object (GESTimeline *timeline, GESTrackElement *obj,
71 GList * layers, GESEdge edge,
74 G_GNUC_INTERNAL gboolean
75 timeline_slide_object (GESTimeline *timeline, GESTrackElement *obj,
76 GList * layers, GESEdge edge, guint64 position);
78 G_GNUC_INTERNAL gboolean
79 timeline_roll_object (GESTimeline *timeline, GESTrackElement *obj,
80 GList * layers, GESEdge edge, guint64 position);
82 G_GNUC_INTERNAL gboolean
83 timeline_trim_object (GESTimeline *timeline, GESTrackElement * object,
84 GList * layers, GESEdge edge, guint64 position);
85 G_GNUC_INTERNAL gboolean
86 ges_timeline_trim_object_simple (GESTimeline * timeline, GESTimelineElement * obj,
87 GList * layers, GESEdge edge, guint64 position, gboolean snapping);
89 G_GNUC_INTERNAL gboolean
90 ges_timeline_move_object_simple (GESTimeline * timeline, GESTimelineElement * object,
91 GList * layers, GESEdge edge, guint64 position);
93 G_GNUC_INTERNAL gboolean
94 timeline_move_object (GESTimeline *timeline, GESTrackElement * object,
95 GList * layers, GESEdge edge, guint64 position);
97 G_GNUC_INTERNAL gboolean
98 timeline_context_to_layer (GESTimeline *timeline, gint offset);
101 timeline_add_group (GESTimeline *timeline,
105 timeline_remove_group (GESTimeline *timeline,
110 timeline_add_element (GESTimeline *timeline,
111 GESTimelineElement *element);
114 timeline_remove_element (GESTimeline *timeline,
115 GESTimelineElement *element);
119 timeline_fill_gaps (GESTimeline *timeline);
121 G_GNUC_INTERNAL GList *
122 timeline_get_groups (GESTimeline * timeline);
125 timeline_emit_group_removed (GESTimeline * timeline,
126 GESGroup * group, GPtrArray * array);
129 track_resort_and_fill_gaps (GESTrack *track);
133 track_disable_last_gap (GESTrack *track, gboolean disabled);
136 ges_asset_cache_init (void);
139 ges_asset_set_id (GESAsset *asset, const gchar *id);
142 ges_asset_cache_put (GESAsset * asset, GTask *task);
144 G_GNUC_INTERNAL gboolean
145 ges_asset_cache_set_loaded(GType extractable_type, const gchar * id, GError *error);
148 ges_asset_cache_lookup(GType extractable_type, const gchar * id);
151 ges_asset_try_proxy (GESAsset *asset, const gchar *new_id);
153 G_GNUC_INTERNAL gboolean
154 ges_asset_request_id_update (GESAsset *asset, gchar **proposed_id,
156 G_GNUC_INTERNAL gchar *
157 ges_effect_assect_id_get_type_and_bindesc (const char *id,
158 GESTrackType *track_type,
161 /* GESExtractable internall methods
163 * FIXME Check if that should be public later
165 G_GNUC_INTERNAL GType
166 ges_extractable_type_get_asset_type (GType type);
168 G_GNUC_INTERNAL gchar *
169 ges_extractable_type_check_id (GType type, const gchar *id, GError **error);
171 G_GNUC_INTERNAL GParameter *
172 ges_extractable_type_get_parameters_from_id (GType type, const gchar *id,
174 G_GNUC_INTERNAL GType
175 ges_extractable_get_real_extractable_type_for_id (GType type, const gchar * id);
177 G_GNUC_INTERNAL gboolean
178 ges_extractable_register_metas (GType extractable_type, GESAsset *asset);
180 /************************************************
182 * GESFormatter internal methods *
184 ************************************************/
186 ges_formatter_set_project (GESFormatter *formatter,
187 GESProject *project);
188 G_GNUC_INTERNAL GESProject *
189 ges_formatter_get_project (GESFormatter *formatter);
190 G_GNUC_INTERNAL GESAsset *
191 _find_formatter_asset_for_id (const gchar *id);
195 /************************************************
197 * GESProject internal methods *
199 ************************************************/
201 /* FIXME This should probably become public, but we need to make sure it
202 * is the right API before doing so */
203 G_GNUC_INTERNAL gboolean ges_project_set_loaded (GESProject * project,
204 GESFormatter *formatter);
205 G_GNUC_INTERNAL gchar * ges_project_try_updating_id (GESProject *self,
208 G_GNUC_INTERNAL void ges_project_add_loading_asset (GESProject *project,
209 GType extractable_type,
211 /************************************************
213 * GESBaseXmlFormatter internal methods *
215 ************************************************/
217 /* FIXME GESBaseXmlFormatter is all internal for now, the API is not stable
218 * fo now, so do not expose it */
219 G_GNUC_INTERNAL void ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
221 const char *asset_id,
224 GstClockTime inpoint,
225 GstClockTime duration,
227 GESTrackType track_types,
228 GstStructure *properties,
229 const gchar *metadatas,
231 G_GNUC_INTERNAL void ges_base_xml_formatter_add_asset (GESBaseXmlFormatter * self,
233 GType extractable_type,
234 GstStructure *properties,
235 const gchar *metadatas,
236 const gchar *proxy_id,
238 G_GNUC_INTERNAL void ges_base_xml_formatter_add_layer (GESBaseXmlFormatter *self,
239 GType extractable_type,
241 GstStructure *properties,
242 const gchar *metadatas,
244 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track (GESBaseXmlFormatter *self,
245 GESTrackType track_type,
248 GstStructure *properties,
249 const gchar *metadatas,
251 G_GNUC_INTERNAL void ges_base_xml_formatter_add_encoding_profile(GESBaseXmlFormatter * self,
255 const gchar * description,
257 const gchar * preset,
258 const gchar * preset_name,
261 GstCaps * restriction,
263 gboolean variableframerate,
264 GstStructure * properties,
267 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track_element (GESBaseXmlFormatter *self,
269 const gchar *asset_id,
270 const gchar * track_id,
271 const gchar *timeline_obj_id,
272 GstStructure *children_properties,
273 GstStructure *properties,
274 const gchar *metadatas,
277 G_GNUC_INTERNAL void ges_base_xml_formatter_add_source (GESBaseXmlFormatter *self,
278 const gchar * track_id,
279 GstStructure *children_properties);
281 G_GNUC_INTERNAL void ges_base_xml_formatter_add_group (GESBaseXmlFormatter *self,
283 const gchar *properties);
285 G_GNUC_INTERNAL void ges_base_xml_formatter_last_group_add_child(GESBaseXmlFormatter *self,
289 G_GNUC_INTERNAL void ges_base_xml_formatter_add_control_binding (GESBaseXmlFormatter * self,
290 const gchar * binding_type,
291 const gchar * source_type,
292 const gchar * property_name,
294 const gchar *track_id,
295 GSList * timed_values);
297 G_GNUC_INTERNAL gboolean set_property_foreach (GQuark field_id,
298 const GValue * value,
301 /* Function to initialise GES */
302 G_GNUC_INTERNAL void _init_standard_transition_assets (void);
303 G_GNUC_INTERNAL void _init_formatter_assets (void);
306 G_GNUC_INTERNAL gint element_start_compare (GESTimelineElement * a,
307 GESTimelineElement * b);
308 G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement * a,
309 GESTimelineElement * b);
310 G_GNUC_INTERNAL GstElementFactory *
311 ges_get_compositor_factory (void);
314 ges_base_xml_formatter_set_timeline_properties(GESBaseXmlFormatter * self,
315 GESTimeline *timeline,
316 const gchar *properties,
317 const gchar *metadatas);
319 /****************************************************
321 ****************************************************/
322 G_GNUC_INTERNAL void _ges_container_sort_children (GESContainer *container);
323 G_GNUC_INTERNAL void _ges_container_sort_children_by_end (GESContainer *container);
325 /****************************************************
327 ****************************************************/
328 G_GNUC_INTERNAL void ges_clip_set_layer (GESClip *clip, GESLayer *layer);
329 G_GNUC_INTERNAL gboolean ges_clip_is_moving_from_layer (GESClip *clip);
330 G_GNUC_INTERNAL guint32 ges_clip_get_layer_priority (GESClip *clip);
331 G_GNUC_INTERNAL void ges_clip_set_moving_from_layer (GESClip *clip, gboolean is_moving);
332 G_GNUC_INTERNAL GESTrackElement* ges_clip_create_track_element (GESClip *clip, GESTrackType type);
333 G_GNUC_INTERNAL GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType type);
336 /****************************************************
338 ****************************************************/
339 #define NLE_OBJECT_TRACK_ELEMENT_QUARK (g_quark_from_string ("nle_object_track_element_quark"))
340 G_GNUC_INTERNAL gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track);
341 G_GNUC_INTERNAL guint32 _ges_track_element_get_layer_priority (GESTrackElement * element);
342 G_GNUC_INTERNAL void ges_track_element_copy_properties (GESTimelineElement * element,
343 GESTimelineElement * elementcopy);
345 G_GNUC_INTERNAL void ges_track_element_copy_bindings (GESTrackElement *element,
346 GESTrackElement *new_element,
349 G_GNUC_INTERNAL GstElement *ges_source_create_topbin (const gchar * bin_name, GstElement * sub_element, ...);
350 G_GNUC_INTERNAL void ges_track_set_caps (GESTrack *track,
351 const GstCaps *caps);
352 G_GNUC_INTERNAL GstElement * ges_track_get_composition (GESTrack *track);
355 /*********************************************
356 * GESTrackElement subclasses contructores *
357 ********************************************/
358 G_GNUC_INTERNAL GESAudioTestSource * ges_audio_test_source_new (void);
359 G_GNUC_INTERNAL GESAudioUriSource * ges_audio_uri_source_new (gchar *uri);
360 G_GNUC_INTERNAL GESVideoUriSource * ges_video_uri_source_new (gchar *uri);
361 G_GNUC_INTERNAL GESImageSource * ges_image_source_new (gchar *uri);
362 G_GNUC_INTERNAL GESTitleSource * ges_title_source_new (void);
363 G_GNUC_INTERNAL GESVideoTestSource * ges_video_test_source_new (void);
365 /****************************************************
366 * GESTimelineElement *
367 ****************************************************/
368 G_GNUC_INTERNAL gdouble ges_timeline_element_get_media_duration_factor(GESTimelineElement *self);
370 /******************************
371 * GESMultiFile internal API *
372 ******************************/
373 typedef struct GESMultiFileURI
380 G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri);
382 /************************
383 * Our property masks *
384 ************************/
385 #define GES_PARAM_NO_SERIALIZATION (1 << (G_PARAM_USER_SHIFT + 1))
387 /********************
389 ********************/
391 G_GNUC_INTERNAL gboolean ges_nle_composition_add_object (GstElement *comp, GstElement *object);
392 G_GNUC_INTERNAL gboolean ges_nle_composition_remove_object (GstElement *comp, GstElement *object);
393 G_GNUC_INTERNAL gboolean ges_nle_object_commit (GstElement * nlesource, gboolean recurse);
397 #endif /* __GES_INTERNAL_H__ */