dad6c9cd42fb64ca7afbccaf42c2ed688a064387
[platform/upstream/gst-editing-services.git] / ges / ges-internal.h
1 /* GStreamer Editing Services
2  * Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
3  *               2009 Nokia Corporation
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 #pragma once
22
23 #include <gst/gst.h>
24 #include <gst/pbutils/encoding-profile.h>
25 #include <gio/gio.h>
26
27 G_BEGIN_DECLS
28
29 #ifndef GST_CAT_DEFAULT
30 #define GST_CAT_DEFAULT (_ges_debug ())
31 #endif
32
33 #include "ges-timeline.h"
34 #include "ges-track-element.h"
35 #include "ges-timeline-element.h"
36
37 #include "ges-asset.h"
38 #include "ges-base-xml-formatter.h"
39 #include "ges-timeline-tree.h"
40
41 G_GNUC_INTERNAL
42 GstDebugCategory * _ges_debug (void);
43
44 /*  The first 2 NLE priorities are used for:
45  *    0- The Mixing element
46  *    1- The Gaps
47  */
48 #define MIN_NLE_PRIO 2
49 #define LAYER_HEIGHT 1000
50
51 #define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
52 #define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
53 #define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
54 #define _MAXDURATION(obj) GES_TIMELINE_ELEMENT_MAX_DURATION (obj)
55 #define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
56 #ifndef _END
57 #define _END(obj) (_START (obj) + _DURATION (obj))
58 #endif
59 #define _set_start0 ges_timeline_element_set_start
60 #define _set_inpoint0 ges_timeline_element_set_inpoint
61 #define _set_duration0 ges_timeline_element_set_duration
62 #define _set_priority0 ges_timeline_element_set_priority
63
64 #define GES_CLOCK_TIME_IS_LESS(first, second) \
65   (GST_CLOCK_TIME_IS_VALID (first) && (!GST_CLOCK_TIME_IS_VALID (second) \
66   || (first) < (second)))
67
68 #define DEFAULT_FRAMERATE_N 30
69 #define DEFAULT_FRAMERATE_D 1
70 #define DEFAULT_WIDTH 1280
71 #define DEFAULT_HEIGHT 720
72
73 #define GES_TIMELINE_ELEMENT_FORMAT \
74     "s<%p>" \
75     " [ %" GST_TIME_FORMAT \
76     " (%" GST_TIME_FORMAT \
77     ") - %" GST_TIME_FORMAT "(%" GST_TIME_FORMAT") layer: %" G_GINT32_FORMAT "] "
78
79 #define GES_TIMELINE_ELEMENT_ARGS(element) \
80     GES_TIMELINE_ELEMENT_NAME(element), element, \
81     GST_TIME_ARGS(GES_TIMELINE_ELEMENT_START(element)), \
82     GST_TIME_ARGS(GES_TIMELINE_ELEMENT_INPOINT(element)), \
83     GST_TIME_ARGS(GES_TIMELINE_ELEMENT_DURATION(element)), \
84     GST_TIME_ARGS(GES_TIMELINE_ELEMENT_MAX_DURATION(element)), \
85     GES_TIMELINE_ELEMENT_LAYER_PRIORITY(element)
86
87 #define GES_FORMAT GES_TIMELINE_ELEMENT_FORMAT
88 #define GES_ARGS GES_TIMELINE_ELEMENT_ARGS
89
90 #define GES_IS_TIME_EFFECT(element) \
91   (GES_IS_BASE_EFFECT (element) \
92   && ges_base_effect_is_time_effect (GES_BASE_EFFECT (element)))
93
94 #define GES_TIMELINE_ELEMENT_SET_BEING_EDITED(element) \
95   ELEMENT_SET_FLAG ( \
96       ges_timeline_element_peak_toplevel (GES_TIMELINE_ELEMENT (element)), \
97       GES_TIMELINE_ELEMENT_SET_SIMPLE)
98
99 #define GES_TIMELINE_ELEMENT_UNSET_BEING_EDITED(element) \
100   ELEMENT_UNSET_FLAG ( \
101       ges_timeline_element_peak_toplevel (GES_TIMELINE_ELEMENT (element)), \
102       GES_TIMELINE_ELEMENT_SET_SIMPLE)
103
104 #define GES_TIMELINE_ELEMENT_BEING_EDITED(element) \
105   ELEMENT_FLAG_IS_SET ( \
106       ges_timeline_element_peak_toplevel (GES_TIMELINE_ELEMENT (element)), \
107       GES_TIMELINE_ELEMENT_SET_SIMPLE)
108
109 /************************
110  * Our property masks   *
111  ************************/
112 #define GES_PARAM_NO_SERIALIZATION (1 << (G_PARAM_USER_SHIFT + 1))
113
114 #define SUPRESS_UNUSED_WARNING(a) (void)a
115
116 G_GNUC_INTERNAL void
117 ges_timeline_freeze_auto_transitions (GESTimeline * timeline, gboolean freeze);
118
119 G_GNUC_INTERNAL GESAutoTransition *
120 ges_timeline_get_auto_transition_at_edge (GESTimeline * timeline, GESTrackElement * source,
121   GESEdge edge);
122
123 G_GNUC_INTERNAL gboolean ges_timeline_is_disposed (GESTimeline* timeline);
124
125 G_GNUC_INTERNAL gboolean
126 ges_timeline_edit (GESTimeline * timeline, GESTimelineElement * element,
127     gint64 new_layer_priority, GESEditMode mode, GESEdge edge,
128     guint64 position, GError ** error);
129
130 G_GNUC_INTERNAL gboolean
131 ges_timeline_layer_priority_in_gap (GESTimeline * timeline, guint layer_priority);
132
133 G_GNUC_INTERNAL void
134 ges_timeline_set_track_selection_error  (GESTimeline * timeline,
135                                          gboolean was_error,
136                                          GError * error);
137 G_GNUC_INTERNAL gboolean
138 ges_timeline_take_track_selection_error (GESTimeline * timeline,
139                                          GError ** error);
140
141 G_GNUC_INTERNAL void
142 timeline_add_group             (GESTimeline *timeline,
143                                 GESGroup *group);
144 G_GNUC_INTERNAL void
145 timeline_remove_group          (GESTimeline *timeline,
146                                 GESGroup *group);
147 G_GNUC_INTERNAL void
148 timeline_emit_group_added      (GESTimeline *timeline,
149                                 GESGroup *group);
150 G_GNUC_INTERNAL void
151 timeline_emit_group_removed    (GESTimeline * timeline,
152                                 GESGroup * group, GPtrArray * array);
153
154 G_GNUC_INTERNAL
155 gboolean
156 timeline_add_element           (GESTimeline *timeline,
157                                 GESTimelineElement *element);
158 G_GNUC_INTERNAL
159 gboolean
160 timeline_remove_element       (GESTimeline *timeline,
161                                GESTimelineElement *element);
162
163 G_GNUC_INTERNAL
164 GNode *
165 timeline_get_tree           (GESTimeline *timeline);
166
167 G_GNUC_INTERNAL
168 void
169 timeline_fill_gaps            (GESTimeline *timeline);
170
171 G_GNUC_INTERNAL void
172 timeline_create_transitions (GESTimeline * timeline, GESTrackElement * track_element);
173
174 G_GNUC_INTERNAL void timeline_get_framerate(GESTimeline *self, gint *fps_n,
175                                             gint *fps_d);
176 G_GNUC_INTERNAL void
177 ges_timeline_set_moving_track_elements (GESTimeline * timeline, gboolean moving);
178
179 G_GNUC_INTERNAL gboolean
180 ges_timeline_add_clip (GESTimeline * timeline, GESClip * clip, GError ** error);
181
182 G_GNUC_INTERNAL void
183 ges_timeline_remove_clip (GESTimeline * timeline, GESClip * clip);
184
185 G_GNUC_INTERNAL void
186 ges_timeline_set_smart_rendering (GESTimeline * timeline, gboolean rendering_smartly);
187
188 G_GNUC_INTERNAL gboolean
189 ges_timeline_get_smart_rendering (GESTimeline *timeline);
190
191 G_GNUC_INTERNAL void
192 ges_auto_transition_set_source (GESAutoTransition * self, GESTrackElement * source, GESEdge edge);
193
194
195
196 G_GNUC_INTERNAL
197 void
198 track_resort_and_fill_gaps    (GESTrack *track);
199
200 G_GNUC_INTERNAL
201 void
202 track_disable_last_gap        (GESTrack *track, gboolean disabled);
203
204 G_GNUC_INTERNAL void
205 ges_asset_cache_init (void);
206
207 G_GNUC_INTERNAL void
208 ges_asset_cache_deinit (void);
209
210 G_GNUC_INTERNAL void
211 ges_asset_set_id (GESAsset *asset, const gchar *id);
212
213 G_GNUC_INTERNAL void
214 ges_asset_cache_put (GESAsset * asset, GTask *task);
215
216 G_GNUC_INTERNAL gboolean
217 ges_asset_cache_set_loaded(GType extractable_type, const gchar * id, GError *error);
218
219 /* FIXME: marked as GES_API just so they can be used in tests! */
220
221 GES_API GESAsset*
222 ges_asset_cache_lookup(GType extractable_type, const gchar * id);
223
224 GES_API gboolean
225 ges_asset_try_proxy (GESAsset *asset, const gchar *new_id);
226
227 G_GNUC_INTERNAL gboolean
228 ges_asset_finish_proxy (GESAsset * proxy);
229
230 G_GNUC_INTERNAL gboolean
231 ges_asset_request_id_update (GESAsset *asset, gchar **proposed_id,
232     GError *error);
233 G_GNUC_INTERNAL gchar *
234 ges_effect_asset_id_get_type_and_bindesc (const char    *id,
235                                           GESTrackType  *track_type,
236                                           GError       **error);
237
238 G_GNUC_INTERNAL void _ges_uri_asset_cleanup (void);
239
240 G_GNUC_INTERNAL gboolean _ges_uri_asset_ensure_setup (gpointer uriasset_class);
241
242 /* GESExtractable internall methods
243  *
244  * FIXME Check if that should be public later
245  */
246 G_GNUC_INTERNAL GType
247 ges_extractable_type_get_asset_type              (GType type);
248
249 G_GNUC_INTERNAL gchar *
250 ges_extractable_type_check_id                    (GType type, const gchar *id, GError **error);
251
252 G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
253 G_GNUC_INTERNAL GParameter *
254 ges_extractable_type_get_parameters_from_id      (GType type, const gchar *id,
255                                                   guint *n_params);
256 G_GNUC_END_IGNORE_DEPRECATIONS;
257
258 G_GNUC_INTERNAL GType
259 ges_extractable_get_real_extractable_type_for_id (GType type, const gchar * id);
260
261 G_GNUC_INTERNAL gboolean
262 ges_extractable_register_metas                   (GType extractable_type, GESAsset *asset);
263
264 /************************************************
265  *                                              *
266  *        GESFormatter internal methods         *
267  *                                              *
268  ************************************************/
269 G_GNUC_INTERNAL void
270 ges_formatter_set_project                        (GESFormatter *formatter,
271                                                   GESProject *project);
272 G_GNUC_INTERNAL GESProject *
273 ges_formatter_get_project                        (GESFormatter *formatter);
274 G_GNUC_INTERNAL  GESAsset *
275 _find_formatter_asset_for_id                     (const gchar *id);
276
277
278
279 /************************************************
280  *                                              *
281  *        GESProject internal methods           *
282  *                                              *
283  ************************************************/
284
285 /* FIXME This should probably become public, but we need to make sure it
286  * is the right API before doing so */
287 G_GNUC_INTERNAL  gboolean ges_project_set_loaded                  (GESProject * project,
288                                                                    GESFormatter *formatter,
289                                                                    GError *error);
290 G_GNUC_INTERNAL  gchar * ges_project_try_updating_id              (GESProject *self,
291                                                                    GESAsset *asset,
292                                                                    GError *error);
293 G_GNUC_INTERNAL  void ges_project_add_loading_asset               (GESProject *project,
294                                                                    GType extractable_type,
295                                                                    const gchar *id);
296 G_GNUC_INTERNAL  gchar* ges_uri_asset_try_update_id               (GError *error, GESAsset *wrong_asset);
297 /************************************************
298  *                                              *
299  *   GESBaseXmlFormatter internal methods       *
300  *                                              *
301  ************************************************/
302
303 /* FIXME GESBaseXmlFormatter is all internal for now, the API is not stable
304  * fo now, so do not expose it */
305 G_GNUC_INTERNAL void ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
306                                                                  const gchar *id,
307                                                                  const char *asset_id,
308                                                                  GType type,
309                                                                  GstClockTime start,
310                                                                  GstClockTime inpoint,
311                                                                  GstClockTime duration,
312                                                                  guint layer_prio,
313                                                                  GESTrackType track_types,
314                                                                  GstStructure *properties,
315                                                                  GstStructure * children_properties,
316                                                                  const gchar *metadatas,
317                                                                  GError **error);
318 G_GNUC_INTERNAL void ges_base_xml_formatter_add_asset        (GESBaseXmlFormatter * self,
319                                                                  const gchar * id,
320                                                                  GType extractable_type,
321                                                                  GstStructure *properties,
322                                                                  const gchar *metadatas,
323                                                                  const gchar *proxy_id,
324                                                                  GError **error);
325 G_GNUC_INTERNAL void ges_base_xml_formatter_add_layer           (GESBaseXmlFormatter *self,
326                                                                  GType extractable_type,
327                                                                  guint priority,
328                                                                  GstStructure *properties,
329                                                                  const gchar *metadatas,
330                                                                  gchar **deactivated_tracks,
331                                                                  GError **error);
332 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track           (GESBaseXmlFormatter *self,
333                                                                  GESTrackType track_type,
334                                                                  GstCaps *caps,
335                                                                  const gchar *id,
336                                                                  GstStructure *properties,
337                                                                  const gchar *metadatas,
338                                                                  GError **error);
339 G_GNUC_INTERNAL void ges_base_xml_formatter_add_encoding_profile(GESBaseXmlFormatter * self,
340                                                                  const gchar *type,
341                                                                  const gchar *parent,
342                                                                  const gchar * name,
343                                                                  const gchar * description,
344                                                                  GstCaps * format,
345                                                                  const gchar * preset,
346                                                                  GstStructure * preset_properties,
347                                                                  const gchar * preset_name,
348                                                                  guint id,
349                                                                  guint presence,
350                                                                  GstCaps * restriction,
351                                                                  guint pass,
352                                                                  gboolean variableframerate,
353                                                                  GstStructure * properties,
354                                                                  gboolean enabled,
355                                                                  GError ** error);
356 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track_element   (GESBaseXmlFormatter *self,
357                                                                  GType effect_type,
358                                                                  const gchar *asset_id,
359                                                                  const gchar * track_id,
360                                                                  const gchar *timeline_obj_id,
361                                                                  GstStructure *children_properties,
362                                                                  GstStructure *properties,
363                                                                  const gchar *metadatas,
364                                                                  GError **error);
365
366 G_GNUC_INTERNAL void ges_base_xml_formatter_add_source          (GESBaseXmlFormatter *self,
367                                                                  const gchar * track_id,
368                                                                  GstStructure *children_properties,
369                                                                  GstStructure *properties);
370
371 G_GNUC_INTERNAL void ges_base_xml_formatter_add_group           (GESBaseXmlFormatter *self,
372                                                                  const gchar *name,
373                                                                  const gchar *properties,
374                                                                  const gchar *metadatas);
375
376 G_GNUC_INTERNAL void ges_base_xml_formatter_last_group_add_child(GESBaseXmlFormatter *self,
377                                                                  const gchar * id,
378                                                                  const gchar * name);
379
380 G_GNUC_INTERNAL void ges_base_xml_formatter_add_control_binding (GESBaseXmlFormatter * self,
381                                                                   const gchar * binding_type,
382                                                                   const gchar * source_type,
383                                                                   const gchar * property_name,
384                                                                   gint mode,
385                                                                   const gchar *track_id,
386                                                                   GSList * timed_values);
387
388 G_GNUC_INTERNAL void ges_base_xml_formatter_set_timeline_properties(GESBaseXmlFormatter * self,
389                                                                     GESTimeline *timeline,
390                                                                     const gchar *properties,
391                                                                     const gchar *metadatas);
392
393 G_GNUC_INTERNAL void ges_base_xml_formatter_end_current_clip       (GESBaseXmlFormatter *self);
394
395 G_GNUC_INTERNAL void ges_xml_formatter_deinit                      (void);
396
397 G_GNUC_INTERNAL gboolean set_property_foreach                   (GQuark field_id,
398                                                                  const GValue * value,
399                                                                  GObject * object);
400
401 G_GNUC_INTERNAL GstElement * get_element_for_encoding_profile   (GstEncodingProfile *prof,
402                                                                  GstElementFactoryListType type);
403
404 /* Function to initialise GES */
405 G_GNUC_INTERNAL void _init_standard_transition_assets        (void);
406 G_GNUC_INTERNAL void _init_formatter_assets                  (void);
407 G_GNUC_INTERNAL void _deinit_formatter_assets                (void);
408
409 /* Utilities */
410 G_GNUC_INTERNAL gint element_start_compare                (GESTimelineElement * a,
411                                                            GESTimelineElement * b);
412 G_GNUC_INTERNAL gint element_end_compare                  (GESTimelineElement * a,
413                                                            GESTimelineElement * b);
414 G_GNUC_INTERNAL GstElementFactory *
415 ges_get_compositor_factory                                (void);
416
417 G_GNUC_INTERNAL void
418 ges_idle_add (GSourceFunc func, gpointer udata, GDestroyNotify notify);
419
420 G_GNUC_INTERNAL gboolean
421 ges_util_structure_get_clocktime (GstStructure *structure, const gchar *name,
422                                   GstClockTime *val, GESFrameNumber *frames);
423
424 G_GNUC_INTERNAL gboolean /* From ges-xml-formatter.c */
425 ges_util_can_serialize_spec (GParamSpec * spec);
426
427 /****************************************************
428  *              GESContainer                        *
429  ****************************************************/
430 G_GNUC_INTERNAL void _ges_container_sort_children         (GESContainer *container);
431 G_GNUC_INTERNAL void _ges_container_set_height            (GESContainer * container,
432                                                            guint32 height);
433
434 /****************************************************
435  *                  GESClip                         *
436  ****************************************************/
437 G_GNUC_INTERNAL void              ges_clip_set_layer              (GESClip *clip, GESLayer  *layer);
438 G_GNUC_INTERNAL gboolean          ges_clip_is_moving_from_layer   (GESClip *clip);
439 G_GNUC_INTERNAL void              ges_clip_set_moving_from_layer  (GESClip *clip, gboolean is_moving);
440 G_GNUC_INTERNAL GESTrackElement*  ges_clip_create_track_element   (GESClip *clip, GESTrackType type);
441 G_GNUC_INTERNAL GList*            ges_clip_create_track_elements  (GESClip *clip, GESTrackType type);
442 G_GNUC_INTERNAL gboolean          ges_clip_can_set_inpoint_of_child (GESClip * clip, GESTrackElement * child, GstClockTime inpoint, GError ** error);
443 G_GNUC_INTERNAL gboolean          ges_clip_can_set_max_duration_of_all_core (GESClip * clip, GstClockTime max_duration, GError ** error);
444 G_GNUC_INTERNAL gboolean          ges_clip_can_set_max_duration_of_child (GESClip * clip, GESTrackElement * child, GstClockTime max_duration, GError ** error);
445 G_GNUC_INTERNAL gboolean          ges_clip_can_set_active_of_child (GESClip * clip, GESTrackElement * child, gboolean active, GError ** error);
446 G_GNUC_INTERNAL gboolean          ges_clip_can_set_priority_of_child (GESClip * clip, GESTrackElement * child, guint32 priority, GError ** error);
447 G_GNUC_INTERNAL gboolean          ges_clip_can_set_track_of_child (GESClip * clip, GESTrackElement * child, GESTrack * tack, GError ** error);
448 G_GNUC_INTERNAL gboolean          ges_clip_can_set_time_property_of_child (GESClip * clip, GESTrackElement * child, GObject * prop_object, GParamSpec * pspec, const GValue * value, GError ** error);
449 G_GNUC_INTERNAL GstClockTime      ges_clip_duration_limit_with_new_children_inpoints (GESClip * clip, GHashTable * child_inpoints);
450 G_GNUC_INTERNAL GstClockTime      ges_clip_get_core_internal_time_from_timeline_time (GESClip * clip, GstClockTime timeline_time, gboolean * no_core, GError ** error);
451 G_GNUC_INTERNAL void              ges_clip_empty_from_track       (GESClip * clip, GESTrack * track);
452 G_GNUC_INTERNAL void              ges_clip_set_add_error          (GESClip * clip, GError * error);
453 G_GNUC_INTERNAL void              ges_clip_take_add_error         (GESClip * clip, GError ** error);
454 G_GNUC_INTERNAL void              ges_clip_set_remove_error       (GESClip * clip, GError * error);
455 G_GNUC_INTERNAL void              ges_clip_take_remove_error      (GESClip * clip, GError ** error);
456
457 /****************************************************
458  *              GESLayer                            *
459  ****************************************************/
460 G_GNUC_INTERNAL gboolean ges_layer_resync_priorities (GESLayer * layer);
461 G_GNUC_INTERNAL void layer_set_priority               (GESLayer * layer, guint priority, gboolean emit);
462
463 /****************************************************
464  *              GESTrackElement                     *
465  ****************************************************/
466 #define         NLE_OBJECT_TRACK_ELEMENT_QUARK                  (g_quark_from_string ("nle_object_track_element_quark"))
467 G_GNUC_INTERNAL gboolean  ges_track_element_set_track           (GESTrackElement * object, GESTrack * track, GError ** error);
468 G_GNUC_INTERNAL void ges_track_element_copy_properties          (GESTimelineElement * element,
469                                                                  GESTimelineElement * elementcopy);
470 G_GNUC_INTERNAL void ges_track_element_set_layer_active         (GESTrackElement *element, gboolean active);
471
472 G_GNUC_INTERNAL void ges_track_element_copy_bindings (GESTrackElement *element,
473                                                       GESTrackElement *new_element,
474                                                       guint64 position);
475 G_GNUC_INTERNAL void ges_track_element_freeze_control_sources   (GESTrackElement * object,
476                                                                  gboolean freeze);
477 G_GNUC_INTERNAL void ges_track_element_update_outpoint          (GESTrackElement * self);
478
479 G_GNUC_INTERNAL void
480 ges_track_element_set_creator_asset                    (GESTrackElement * self,
481                                                        GESAsset *creator_asset);
482 G_GNUC_INTERNAL GESAsset *
483 ges_track_element_get_creator_asset                    (GESTrackElement * self);
484
485 G_GNUC_INTERNAL void
486 ges_track_element_set_has_internal_source_is_forbidden (GESTrackElement * element);
487
488 G_GNUC_INTERNAL GstElement* ges_source_create_topbin  (GESSource *source,
489                                                        const gchar* bin_name,
490                                                        GstElement* sub_element,
491                                                        GPtrArray* elements);
492 G_GNUC_INTERNAL void ges_source_set_rendering_smartly (GESSource *source,
493                                                        gboolean rendering_smartly);
494 G_GNUC_INTERNAL gboolean
495 ges_source_get_rendering_smartly                      (GESSource *source);
496
497 G_GNUC_INTERNAL void ges_track_set_smart_rendering     (GESTrack* track, gboolean rendering_smartly);
498 G_GNUC_INTERNAL GstElement * ges_track_get_composition (GESTrack *track);
499
500
501 /*********************************************
502  *  GESTrackElement subclasses contructores  *
503  ********************************************/
504 G_GNUC_INTERNAL GESAudioTestSource * ges_audio_test_source_new (void);
505 G_GNUC_INTERNAL GESAudioUriSource  * ges_audio_uri_source_new  (gchar *uri);
506 G_GNUC_INTERNAL GESVideoUriSource  * ges_video_uri_source_new  (gchar *uri);
507 G_GNUC_INTERNAL GESImageSource     * ges_image_source_new      (gchar *uri);
508 G_GNUC_INTERNAL GESTitleSource     * ges_title_source_new      (void);
509 G_GNUC_INTERNAL GESVideoTestSource * ges_video_test_source_new (void);
510
511 /****************************************************
512  *                GES*Effect                     *
513  ****************************************************/
514 G_GNUC_INTERNAL gchar *
515 ges_base_effect_get_time_property_name        (GESBaseEffect * effect,
516                                                GObject * child,
517                                                GParamSpec * pspec);
518 G_GNUC_INTERNAL GHashTable *
519 ges_base_effect_get_time_property_values      (GESBaseEffect * effect);
520 G_GNUC_INTERNAL GstClockTime
521 ges_base_effect_translate_source_to_sink_time (GESBaseEffect * effect,
522                                                GstClockTime time,
523                                                GHashTable * time_property_values);
524 G_GNUC_INTERNAL GstClockTime
525 ges_base_effect_translate_sink_to_source_time (GESBaseEffect * effect,
526                                                GstClockTime time,
527                                                GHashTable * time_property_values);
528 G_GNUC_INTERNAL GstElement *
529 ges_effect_from_description                   (const gchar *bin_desc,
530                                                GESTrackType type,
531                                                GError **error);
532
533 /****************************************************
534  *              GESTimelineElement                  *
535  ****************************************************/
536 typedef enum
537 {
538   GES_CLIP_IS_MOVING = (1 << 0),
539   GES_TIMELINE_ELEMENT_SET_SIMPLE = (1 << 1),
540 } GESTimelineElementFlags;
541
542 G_GNUC_INTERNAL GESTimelineElement * ges_timeline_element_peak_toplevel (GESTimelineElement * self);
543 G_GNUC_INTERNAL GESTimelineElement * ges_timeline_element_get_copied_from (GESTimelineElement *self);
544 G_GNUC_INTERNAL GESTimelineElementFlags ges_timeline_element_flags (GESTimelineElement *self);
545 G_GNUC_INTERNAL void                ges_timeline_element_set_flags (GESTimelineElement *self, GESTimelineElementFlags flags);
546 G_GNUC_INTERNAL gboolean            ges_timeline_element_add_child_property_full (GESTimelineElement *self,
547                                                                                   GESTimelineElement *owner,
548                                                                                   GParamSpec *pspec,
549                                                                                   GObject *child);
550
551 G_GNUC_INTERNAL GObject *           ges_timeline_element_get_child_from_child_property (GESTimelineElement * self,
552                                                                                         GParamSpec * pspec);
553 G_GNUC_INTERNAL GParamSpec **       ges_timeline_element_get_children_properties (GESTimelineElement * self,
554                                                                                   guint * n_properties);
555
556 #define ELEMENT_FLAGS(obj)             (ges_timeline_element_flags (GES_TIMELINE_ELEMENT(obj)))
557 #define ELEMENT_SET_FLAG(obj,flag)     (ges_timeline_element_set_flags(GES_TIMELINE_ELEMENT(obj), (ELEMENT_FLAGS(obj) | (flag))))
558 #define ELEMENT_UNSET_FLAG(obj,flag)   (ges_timeline_element_set_flags(GES_TIMELINE_ELEMENT(obj), (ELEMENT_FLAGS(obj) & ~(flag))))
559 #define ELEMENT_FLAG_IS_SET(obj,flag)  ((ELEMENT_FLAGS (obj) & (flag)) == (flag))
560
561 /******************************
562  *  GESMultiFile internal API *
563  ******************************/
564 typedef struct GESMultiFileURI
565 {
566   gchar *location;
567   gint start;
568   gint end;
569 } GESMultiFileURI;
570
571 G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri);
572
573 /******************************
574  *  GESUriSource internal API *
575  ******************************/
576 G_GNUC_INTERNAL gboolean
577 ges_video_uri_source_get_natural_size(GESVideoSource* source, gint* width, gint* height);
578
579 /**********************************
580  *  GESTestClipAsset internal API *
581  **********************************/
582 G_GNUC_INTERNAL gboolean ges_test_clip_asset_get_natural_size (GESAsset *self,
583                                                                gint *width,
584                                                                gint *height);
585 G_GNUC_INTERNAL gchar *ges_test_source_asset_check_id         (GType type, const gchar *id,
586                                                                GError **error);
587
588 /*******************************
589  *        GESMarkerList        *
590  *******************************/
591
592 G_GNUC_INTERNAL GESMarker * ges_marker_list_get_closest (GESMarkerList *list, GstClockTime position);
593 G_GNUC_INTERNAL gchar * ges_marker_list_serialize (const GValue * v);
594 G_GNUC_INTERNAL gboolean ges_marker_list_deserialize (GValue *dest, const gchar *s);
595
596 /********************
597  *  Gnonlin helpers *
598  ********************/
599
600 G_GNUC_INTERNAL gboolean ges_nle_composition_add_object (GstElement *comp, GstElement *object);
601 G_GNUC_INTERNAL gboolean ges_nle_composition_remove_object (GstElement *comp, GstElement *object);
602 G_GNUC_INTERNAL gboolean ges_nle_object_commit (GstElement * nlesource, gboolean recurse);
603
604 G_END_DECLS