xml-formatter: Add support for metadata on sources
[platform/upstream/gst-editing-services.git] / ges / ges-internal.h
index efef5c1..66b2ba8 100644 (file)
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __GES_INTERNAL_H__
-#define __GES_INTERNAL_H__
+#pragma once
+
 #include <gst/gst.h>
 #include <gst/pbutils/encoding-profile.h>
 #include <gio/gio.h>
 
+G_BEGIN_DECLS
+
+#ifndef GST_CAT_DEFAULT
+#define GST_CAT_DEFAULT (_ges_debug ())
+#endif
+
 #include "ges-timeline.h"
 #include "ges-track-element.h"
 #include "ges-timeline-element.h"
 #include "ges-base-xml-formatter.h"
 #include "ges-timeline-tree.h"
 
-G_BEGIN_DECLS
-
-#ifndef GST_CAT_DEFAULT
-#define GST_CAT_DEFAULT (_ges_debug ())
-#endif
-
 G_GNUC_INTERNAL
 GstDebugCategory * _ges_debug (void);
 
@@ -61,6 +61,10 @@ GstDebugCategory * _ges_debug (void);
 #define _set_duration0 ges_timeline_element_set_duration
 #define _set_priority0 ges_timeline_element_set_priority
 
+#define GES_CLOCK_TIME_IS_LESS(first, second) \
+  (GST_CLOCK_TIME_IS_VALID (first) && (!GST_CLOCK_TIME_IS_VALID (second) \
+  || (first) < (second)))
+
 #define DEFAULT_FRAMERATE_N 30
 #define DEFAULT_FRAMERATE_D 1
 #define DEFAULT_WIDTH 1280
@@ -83,37 +87,56 @@ GstDebugCategory * _ges_debug (void);
 #define GES_FORMAT GES_TIMELINE_ELEMENT_FORMAT
 #define GES_ARGS GES_TIMELINE_ELEMENT_ARGS
 
-G_GNUC_INTERNAL gboolean
-timeline_ripple_object         (GESTimeline *timeline, GESTimelineElement *obj,
-                                gint new_layer_priority,
-                                GList * layers, GESEdge edge,
-                                guint64 position);
+#define GES_IS_TIME_EFFECT(element) \
+  (GES_IS_BASE_EFFECT (element) \
+  && ges_base_effect_is_time_effect (GES_BASE_EFFECT (element)))
 
-G_GNUC_INTERNAL gboolean
-timeline_slide_object          (GESTimeline *timeline, GESTrackElement *obj,
-                                    GList * layers, GESEdge edge, guint64 position);
+#define GES_TIMELINE_ELEMENT_SET_BEING_EDITED(element) \
+  ELEMENT_SET_FLAG ( \
+      ges_timeline_element_peak_toplevel (GES_TIMELINE_ELEMENT (element)), \
+      GES_TIMELINE_ELEMENT_SET_SIMPLE)
 
-G_GNUC_INTERNAL gboolean
-timeline_roll_object           (GESTimeline *timeline, GESTimelineElement *obj,
-                                GList * layers, GESEdge edge, guint64 position);
+#define GES_TIMELINE_ELEMENT_UNSET_BEING_EDITED(element) \
+  ELEMENT_UNSET_FLAG ( \
+      ges_timeline_element_peak_toplevel (GES_TIMELINE_ELEMENT (element)), \
+      GES_TIMELINE_ELEMENT_SET_SIMPLE)
+
+#define GES_TIMELINE_ELEMENT_BEING_EDITED(element) \
+  ELEMENT_FLAG_IS_SET ( \
+      ges_timeline_element_peak_toplevel (GES_TIMELINE_ELEMENT (element)), \
+      GES_TIMELINE_ELEMENT_SET_SIMPLE)
+
+/************************
+ * Our property masks   *
+ ************************/
+#define GES_PARAM_NO_SERIALIZATION (1 << (G_PARAM_USER_SHIFT + 1))
+
+#define SUPRESS_UNUSED_WARNING(a) (void)a
+
+G_GNUC_INTERNAL void
+ges_timeline_freeze_auto_transitions (GESTimeline * timeline, gboolean freeze);
+
+G_GNUC_INTERNAL GESAutoTransition *
+ges_timeline_get_auto_transition_at_edge (GESTimeline * timeline, GESTrackElement * source,
+  GESEdge edge);
+
+G_GNUC_INTERNAL gboolean ges_timeline_is_disposed (GESTimeline* timeline);
 
 G_GNUC_INTERNAL gboolean
-timeline_trim_object           (GESTimeline *timeline, GESTimelineElement * object,
-                                guint32 new_layer_priority, GList * layers, GESEdge edge,
-                                guint64 position);
-G_GNUC_INTERNAL gboolean
-ges_timeline_trim_object_simple (GESTimeline * timeline, GESTimelineElement * obj,
-                                 guint32 new_layer_priority, GList * layers, GESEdge edge,
-                                 guint64 position, gboolean snapping);
+ges_timeline_edit (GESTimeline * timeline, GESTimelineElement * element,
+    gint64 new_layer_priority, GESEditMode mode, GESEdge edge,
+    guint64 position, GError ** error);
 
 G_GNUC_INTERNAL gboolean
-ges_timeline_move_object_simple (GESTimeline * timeline, GESTimelineElement * object,
-                                 GList * layers, GESEdge edge, guint64 position);
+ges_timeline_layer_priority_in_gap (GESTimeline * timeline, guint layer_priority);
 
+G_GNUC_INTERNAL void
+ges_timeline_set_track_selection_error  (GESTimeline * timeline,
+                                         gboolean was_error,
+                                         GError * error);
 G_GNUC_INTERNAL gboolean
-timeline_move_object           (GESTimeline *timeline, GESTimelineElement * object,
-                                guint32 new_layer_priority, GList * layers, GESEdge edge,
-                                guint64 position);
+ges_timeline_take_track_selection_error (GESTimeline * timeline,
+                                         GError ** error);
 
 G_GNUC_INTERNAL void
 timeline_add_group             (GESTimeline *timeline,
@@ -143,15 +166,33 @@ timeline_get_tree           (GESTimeline *timeline);
 
 G_GNUC_INTERNAL
 void
-timeline_update_transition (GESTimeline *timeline);
-
-G_GNUC_INTERNAL
-void
 timeline_fill_gaps            (GESTimeline *timeline);
 
 G_GNUC_INTERNAL void
 timeline_create_transitions (GESTimeline * timeline, GESTrackElement * track_element);
 
+G_GNUC_INTERNAL void timeline_get_framerate(GESTimeline *self, gint *fps_n,
+                                            gint *fps_d);
+G_GNUC_INTERNAL void
+ges_timeline_set_moving_track_elements (GESTimeline * timeline, gboolean moving);
+
+G_GNUC_INTERNAL gboolean
+ges_timeline_add_clip (GESTimeline * timeline, GESClip * clip, GError ** error);
+
+G_GNUC_INTERNAL void
+ges_timeline_remove_clip (GESTimeline * timeline, GESClip * clip);
+
+G_GNUC_INTERNAL void
+ges_timeline_set_smart_rendering (GESTimeline * timeline, gboolean rendering_smartly);
+
+G_GNUC_INTERNAL gboolean
+ges_timeline_get_smart_rendering (GESTimeline *timeline);
+
+G_GNUC_INTERNAL void
+ges_auto_transition_set_source (GESAutoTransition * self, GESTrackElement * source, GESEdge edge);
+
+
+
 G_GNUC_INTERNAL
 void
 track_resort_and_fill_gaps    (GESTrack *track);
@@ -190,9 +231,9 @@ G_GNUC_INTERNAL gboolean
 ges_asset_request_id_update (GESAsset *asset, gchar **proposed_id,
     GError *error);
 G_GNUC_INTERNAL gchar *
-ges_effect_assect_id_get_type_and_bindesc (const char    *id,
-                                           GESTrackType  *track_type,
-                                           GError       **error);
+ges_effect_asset_id_get_type_and_bindesc (const char    *id,
+                                          GESTrackType  *track_type,
+                                          GError       **error);
 
 G_GNUC_INTERNAL void _ges_uri_asset_cleanup (void);
 
@@ -286,6 +327,7 @@ G_GNUC_INTERNAL void ges_base_xml_formatter_add_layer           (GESBaseXmlForma
                                                                  guint priority,
                                                                  GstStructure *properties,
                                                                  const gchar *metadatas,
+                                                                 gchar **deactivated_tracks,
                                                                  GError **error);
 G_GNUC_INTERNAL void ges_base_xml_formatter_add_track           (GESBaseXmlFormatter *self,
                                                                  GESTrackType track_type,
@@ -323,7 +365,9 @@ G_GNUC_INTERNAL void ges_base_xml_formatter_add_track_element   (GESBaseXmlForma
 
 G_GNUC_INTERNAL void ges_base_xml_formatter_add_source          (GESBaseXmlFormatter *self,
                                                                  const gchar * track_id,
-                                                                 GstStructure *children_properties);
+                                                                 GstStructure *children_properties,
+                                                                 GstStructure *properties,
+                                                                 const gchar *metadatas);
 
 G_GNUC_INTERNAL void ges_base_xml_formatter_add_group           (GESBaseXmlFormatter *self,
                                                                  const gchar *name,
@@ -346,7 +390,10 @@ G_GNUC_INTERNAL void ges_base_xml_formatter_set_timeline_properties(GESBaseXmlFo
                                                                     GESTimeline *timeline,
                                                                     const gchar *properties,
                                                                     const gchar *metadatas);
-G_GNUC_INTERNAL void ges_xml_formatter_deinit                       (void);
+
+G_GNUC_INTERNAL void ges_base_xml_formatter_end_current_clip       (GESBaseXmlFormatter *self);
+
+G_GNUC_INTERNAL void ges_xml_formatter_deinit                      (void);
 
 G_GNUC_INTERNAL gboolean set_property_foreach                   (GQuark field_id,
                                                                  const GValue * value,
@@ -371,20 +418,19 @@ ges_get_compositor_factory                                (void);
 G_GNUC_INTERNAL void
 ges_idle_add (GSourceFunc func, gpointer udata, GDestroyNotify notify);
 
+G_GNUC_INTERNAL gboolean
+ges_util_structure_get_clocktime (GstStructure *structure, const gchar *name,
+                                  GstClockTime *val, GESFrameNumber *frames);
+
+G_GNUC_INTERNAL gboolean /* From ges-xml-formatter.c */
+ges_util_can_serialize_spec (GParamSpec * spec);
 
 /****************************************************
  *              GESContainer                        *
  ****************************************************/
 G_GNUC_INTERNAL void _ges_container_sort_children         (GESContainer *container);
-G_GNUC_INTERNAL void _ges_container_sort_children_by_end  (GESContainer *container);
 G_GNUC_INTERNAL void _ges_container_set_height            (GESContainer * container,
                                                            guint32 height);
-G_GNUC_INTERNAL gint  _ges_container_get_priority_offset  (GESContainer * container,
-                                                           GESTimelineElement *elem);
-G_GNUC_INTERNAL void _ges_container_set_priority_offset   (GESContainer * container,
-                                                           GESTimelineElement *elem,
-                                                           gint32 priority_offset);
-
 
 /****************************************************
  *                  GESClip                         *
@@ -394,7 +440,20 @@ G_GNUC_INTERNAL gboolean          ges_clip_is_moving_from_layer   (GESClip *clip
 G_GNUC_INTERNAL void              ges_clip_set_moving_from_layer  (GESClip *clip, gboolean is_moving);
 G_GNUC_INTERNAL GESTrackElement*  ges_clip_create_track_element   (GESClip *clip, GESTrackType type);
 G_GNUC_INTERNAL GList*            ges_clip_create_track_elements  (GESClip *clip, GESTrackType type);
-G_GNUC_INTERNAL gboolean          ges_clip_can_set_inpoint_of_child (GESClip * clip, GESTimelineElement * child, GstClockTime inpoint);
+G_GNUC_INTERNAL gboolean          ges_clip_can_set_inpoint_of_child (GESClip * clip, GESTrackElement * child, GstClockTime inpoint, GError ** error);
+G_GNUC_INTERNAL gboolean          ges_clip_can_set_max_duration_of_all_core (GESClip * clip, GstClockTime max_duration, GError ** error);
+G_GNUC_INTERNAL gboolean          ges_clip_can_set_max_duration_of_child (GESClip * clip, GESTrackElement * child, GstClockTime max_duration, GError ** error);
+G_GNUC_INTERNAL gboolean          ges_clip_can_set_active_of_child (GESClip * clip, GESTrackElement * child, gboolean active, GError ** error);
+G_GNUC_INTERNAL gboolean          ges_clip_can_set_priority_of_child (GESClip * clip, GESTrackElement * child, guint32 priority, GError ** error);
+G_GNUC_INTERNAL gboolean          ges_clip_can_set_track_of_child (GESClip * clip, GESTrackElement * child, GESTrack * tack, GError ** error);
+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);
+G_GNUC_INTERNAL GstClockTime      ges_clip_duration_limit_with_new_children_inpoints (GESClip * clip, GHashTable * child_inpoints);
+G_GNUC_INTERNAL GstClockTime      ges_clip_get_core_internal_time_from_timeline_time (GESClip * clip, GstClockTime timeline_time, gboolean * no_core, GError ** error);
+G_GNUC_INTERNAL void              ges_clip_empty_from_track       (GESClip * clip, GESTrack * track);
+G_GNUC_INTERNAL void              ges_clip_set_add_error          (GESClip * clip, GError * error);
+G_GNUC_INTERNAL void              ges_clip_take_add_error         (GESClip * clip, GError ** error);
+G_GNUC_INTERNAL void              ges_clip_set_remove_error       (GESClip * clip, GError * error);
+G_GNUC_INTERNAL void              ges_clip_take_remove_error      (GESClip * clip, GError ** error);
 
 /****************************************************
  *              GESLayer                            *
@@ -406,22 +465,37 @@ G_GNUC_INTERNAL void layer_set_priority               (GESLayer * layer, guint p
  *              GESTrackElement                     *
  ****************************************************/
 #define         NLE_OBJECT_TRACK_ELEMENT_QUARK                  (g_quark_from_string ("nle_object_track_element_quark"))
-G_GNUC_INTERNAL gboolean  ges_track_element_set_track           (GESTrackElement * object, GESTrack * track);
+G_GNUC_INTERNAL gboolean  ges_track_element_set_track           (GESTrackElement * object, GESTrack * track, GError ** error);
 G_GNUC_INTERNAL void ges_track_element_copy_properties          (GESTimelineElement * element,
                                                                  GESTimelineElement * elementcopy);
+G_GNUC_INTERNAL void ges_track_element_set_layer_active         (GESTrackElement *element, gboolean active);
 
 G_GNUC_INTERNAL void ges_track_element_copy_bindings (GESTrackElement *element,
                                                       GESTrackElement *new_element,
                                                       guint64 position);
+G_GNUC_INTERNAL void ges_track_element_freeze_control_sources   (GESTrackElement * object,
+                                                                 gboolean freeze);
+G_GNUC_INTERNAL void ges_track_element_update_outpoint          (GESTrackElement * self);
 
-G_GNUC_INTERNAL void ges_track_element_add_owner           (GESTrackElement * self,
-                                                                 GESClip * owner);
-/* NOTE: Returned elements in list are only valid for **pointer comparison** */
-G_GNUC_INTERNAL GList * ges_track_element_get_owners      (GESTrackElement *self);
+G_GNUC_INTERNAL void
+ges_track_element_set_creator_asset                    (GESTrackElement * self,
+                                                       GESAsset *creator_asset);
+G_GNUC_INTERNAL GESAsset *
+ges_track_element_get_creator_asset                    (GESTrackElement * self);
 
-G_GNUC_INTERNAL GstElement* ges_source_create_topbin(const gchar* bin_name, GstElement* sub_element, GPtrArray* elements);
-G_GNUC_INTERNAL void ges_track_set_caps(GESTrack* track,
-    const GstCaps* caps);
+G_GNUC_INTERNAL void
+ges_track_element_set_has_internal_source_is_forbidden (GESTrackElement * element);
+
+G_GNUC_INTERNAL GstElement* ges_source_create_topbin  (GESSource *source,
+                                                       const gchar* bin_name,
+                                                       GstElement* sub_element,
+                                                       GPtrArray* elements);
+G_GNUC_INTERNAL void ges_source_set_rendering_smartly (GESSource *source,
+                                                       gboolean rendering_smartly);
+G_GNUC_INTERNAL gboolean
+ges_source_get_rendering_smartly                      (GESSource *source);
+
+G_GNUC_INTERNAL void ges_track_set_smart_rendering     (GESTrack* track, gboolean rendering_smartly);
 G_GNUC_INTERNAL GstElement * ges_track_get_composition (GESTrack *track);
 
 
@@ -436,16 +510,37 @@ G_GNUC_INTERNAL GESTitleSource     * ges_title_source_new      (void);
 G_GNUC_INTERNAL GESVideoTestSource * ges_video_test_source_new (void);
 
 /****************************************************
+ *                GES*Effect                     *
+ ****************************************************/
+G_GNUC_INTERNAL gchar *
+ges_base_effect_get_time_property_name        (GESBaseEffect * effect,
+                                               GObject * child,
+                                               GParamSpec * pspec);
+G_GNUC_INTERNAL GHashTable *
+ges_base_effect_get_time_property_values      (GESBaseEffect * effect);
+G_GNUC_INTERNAL GstClockTime
+ges_base_effect_translate_source_to_sink_time (GESBaseEffect * effect,
+                                               GstClockTime time,
+                                               GHashTable * time_property_values);
+G_GNUC_INTERNAL GstClockTime
+ges_base_effect_translate_sink_to_source_time (GESBaseEffect * effect,
+                                               GstClockTime time,
+                                               GHashTable * time_property_values);
+G_GNUC_INTERNAL GstElement *
+ges_effect_from_description                   (const gchar *bin_desc,
+                                               GESTrackType type,
+                                               GError **error);
+
+/****************************************************
  *              GESTimelineElement                  *
  ****************************************************/
 typedef enum
 {
   GES_CLIP_IS_MOVING = (1 << 0),
   GES_TIMELINE_ELEMENT_SET_SIMPLE = (1 << 1),
-  GES_TRACK_ELEMENT_IS_CORE = (1 << 2),
 } GESTimelineElementFlags;
 
-G_GNUC_INTERNAL gdouble ges_timeline_element_get_media_duration_factor(GESTimelineElement *self);
+G_GNUC_INTERNAL GESTimelineElement * ges_timeline_element_peak_toplevel (GESTimelineElement * self);
 G_GNUC_INTERNAL GESTimelineElement * ges_timeline_element_get_copied_from (GESTimelineElement *self);
 G_GNUC_INTERNAL GESTimelineElementFlags ges_timeline_element_flags (GESTimelineElement *self);
 G_GNUC_INTERNAL void                ges_timeline_element_set_flags (GESTimelineElement *self, GESTimelineElementFlags flags);
@@ -482,16 +577,20 @@ G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri);
 G_GNUC_INTERNAL gboolean
 ges_video_uri_source_get_natural_size(GESVideoSource* source, gint* width, gint* height);
 
-/************************
- * Our property masks   *
- ************************/
-#define GES_PARAM_NO_SERIALIZATION (1 << (G_PARAM_USER_SHIFT + 1))
+/**********************************
+ *  GESTestClipAsset internal API *
+ **********************************/
+G_GNUC_INTERNAL gboolean ges_test_clip_asset_get_natural_size (GESAsset *self,
+                                                               gint *width,
+                                                               gint *height);
+G_GNUC_INTERNAL gchar *ges_test_source_asset_check_id         (GType type, const gchar *id,
+                                                               GError **error);
 
 /*******************************
- * GESMarkerList serialization *
+ *        GESMarkerList        *
  *******************************/
 
-
+G_GNUC_INTERNAL GESMarker * ges_marker_list_get_closest (GESMarkerList *list, GstClockTime position);
 G_GNUC_INTERNAL gchar * ges_marker_list_serialize (const GValue * v);
 G_GNUC_INTERNAL gboolean ges_marker_list_deserialize (GValue *dest, const gchar *s);
 
@@ -504,5 +603,3 @@ G_GNUC_INTERNAL gboolean ges_nle_composition_remove_object (GstElement *comp, Gs
 G_GNUC_INTERNAL gboolean ges_nle_object_commit (GstElement * nlesource, gboolean recurse);
 
 G_END_DECLS
-
-#endif /* __GES_INTERNAL_H__ */