2009-08-06 17:51:29 +00:00
|
|
|
/* GStreamer Editing Services
|
2009-11-30 14:14:25 +00:00
|
|
|
* Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
|
|
|
|
* 2009 Nokia Corporation
|
2009-08-06 17:51:29 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-04 00:25:20 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2009-08-06 17:51:29 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GES_INTERNAL_H__
|
|
|
|
#define __GES_INTERNAL_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2012-09-01 02:36:37 +00:00
|
|
|
#include <gio/gio.h>
|
|
|
|
|
2012-04-24 00:52:45 +00:00
|
|
|
#include "ges-timeline.h"
|
2013-01-26 15:31:33 +00:00
|
|
|
#include "ges-track-element.h"
|
2013-01-15 13:52:17 +00:00
|
|
|
#include "ges-timeline-element.h"
|
2009-08-06 17:51:29 +00:00
|
|
|
|
2012-09-01 02:36:37 +00:00
|
|
|
#include "ges-asset.h"
|
2012-11-19 16:24:03 +00:00
|
|
|
#include "ges-base-xml-formatter.h"
|
2012-09-01 02:36:37 +00:00
|
|
|
|
2011-01-11 16:19:54 +00:00
|
|
|
GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
|
|
|
|
#define GST_CAT_DEFAULT _ges_debug
|
2009-08-06 17:51:29 +00:00
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
/* The first 2 NLE priorities are used for:
|
2013-03-29 18:23:00 +00:00
|
|
|
* 0- The Mixing element
|
|
|
|
* 1- The Gaps
|
|
|
|
*/
|
2014-08-15 13:48:14 +00:00
|
|
|
#define MIN_NLE_PRIO 2
|
2013-01-04 16:11:51 +00:00
|
|
|
#define LAYER_HEIGHT 1000
|
|
|
|
|
2013-01-15 13:52:17 +00:00
|
|
|
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
|
|
|
|
#define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
|
|
|
|
#define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
|
|
|
|
#define _MAXDURATION(obj) GES_TIMELINE_ELEMENT_MAX_DURATION (obj)
|
|
|
|
#define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
|
2013-06-25 22:37:17 +00:00
|
|
|
#define _END(obj) (_START (obj) + _DURATION (obj))
|
2013-01-15 13:52:17 +00:00
|
|
|
#define _set_start0 ges_timeline_element_set_start
|
|
|
|
#define _set_inpoint0 ges_timeline_element_set_inpoint
|
|
|
|
#define _set_duration0 ges_timeline_element_set_duration
|
|
|
|
#define _set_priority0 ges_timeline_element_set_priority
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-01-26 15:31:33 +00:00
|
|
|
timeline_ripple_object (GESTimeline *timeline, GESTrackElement *obj,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge,
|
|
|
|
guint64 position);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-01-26 15:31:33 +00:00
|
|
|
timeline_slide_object (GESTimeline *timeline, GESTrackElement *obj,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge, guint64 position);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-01-26 15:31:33 +00:00
|
|
|
timeline_roll_object (GESTimeline *timeline, GESTrackElement *obj,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge, guint64 position);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-01-26 15:31:33 +00:00
|
|
|
timeline_trim_object (GESTimeline *timeline, GESTrackElement * object,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge, guint64 position);
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-03-01 01:27:50 +00:00
|
|
|
ges_timeline_trim_object_simple (GESTimeline * timeline, GESTimelineElement * obj,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge, guint64 position, gboolean snapping);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-03-01 01:27:50 +00:00
|
|
|
ges_timeline_move_object_simple (GESTimeline * timeline, GESTimelineElement * object,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge, guint64 position);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2013-01-26 15:31:33 +00:00
|
|
|
timeline_move_object (GESTimeline *timeline, GESTrackElement * object,
|
2012-04-24 00:52:45 +00:00
|
|
|
GList * layers, GESEdge edge, guint64 position);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
2012-04-24 00:52:45 +00:00
|
|
|
timeline_context_to_layer (GESTimeline *timeline, gint offset);
|
|
|
|
|
2013-06-26 21:08:57 +00:00
|
|
|
G_GNUC_INTERNAL void
|
|
|
|
timeline_add_group (GESTimeline *timeline,
|
|
|
|
GESGroup *group);
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
void
|
|
|
|
timeline_remove_group (GESTimeline *timeline,
|
|
|
|
GESGroup *group);
|
|
|
|
|
2014-02-18 14:14:40 +00:00
|
|
|
G_GNUC_INTERNAL
|
|
|
|
gboolean
|
|
|
|
timeline_add_element (GESTimeline *timeline,
|
|
|
|
GESTimelineElement *element);
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
gboolean
|
|
|
|
timeline_remove_element (GESTimeline *timeline,
|
|
|
|
GESTimelineElement *element);
|
|
|
|
|
2014-09-19 15:12:18 +00:00
|
|
|
G_GNUC_INTERNAL
|
|
|
|
void
|
|
|
|
timeline_fill_gaps (GESTimeline *timeline);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
void
|
|
|
|
track_resort_and_fill_gaps (GESTrack *track);
|
|
|
|
|
2012-09-01 02:36:37 +00:00
|
|
|
G_GNUC_INTERNAL void
|
|
|
|
ges_asset_cache_init (void);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL void
|
|
|
|
ges_asset_set_id (GESAsset *asset, const gchar *id);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL void
|
|
|
|
ges_asset_cache_put (GESAsset * asset, GSimpleAsyncResult *res);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL gboolean
|
|
|
|
ges_asset_cache_set_loaded(GType extractable_type, const gchar * id, GError *error);
|
|
|
|
|
|
|
|
GESAsset*
|
|
|
|
ges_asset_cache_lookup(GType extractable_type, const gchar * id);
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
ges_asset_set_proxy (GESAsset *asset, const gchar *new_id);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL gboolean
|
|
|
|
ges_asset_request_id_update (GESAsset *asset, gchar **proposed_id,
|
|
|
|
GError *error);
|
2012-09-10 00:12:06 +00:00
|
|
|
|
|
|
|
/* GESExtractable internall methods
|
|
|
|
*
|
|
|
|
* FIXME Check if that should be public later
|
|
|
|
*/
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL GType
|
2012-09-10 00:12:06 +00:00
|
|
|
ges_extractable_type_get_asset_type (GType type);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL gchar *
|
|
|
|
ges_extractable_type_check_id (GType type, const gchar *id, GError **error);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL GParameter *
|
2012-09-10 00:12:06 +00:00
|
|
|
ges_extractable_type_get_parameters_from_id (GType type, const gchar *id,
|
|
|
|
guint *n_params);
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL GType
|
2012-09-10 00:12:06 +00:00
|
|
|
ges_extractable_get_real_extractable_type_for_id (GType type, const gchar * id);
|
|
|
|
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL gboolean
|
|
|
|
ges_extractable_register_metas (GType extractable_type, GESAsset *asset);
|
2012-09-02 12:14:27 +00:00
|
|
|
|
2012-11-19 16:24:03 +00:00
|
|
|
/************************************************
|
|
|
|
* *
|
|
|
|
* GESFormatter internal methods *
|
|
|
|
* *
|
|
|
|
************************************************/
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL void
|
2012-12-17 22:26:23 +00:00
|
|
|
ges_formatter_set_project (GESFormatter *formatter,
|
|
|
|
GESProject *project);
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL GESProject *
|
2012-12-17 22:26:23 +00:00
|
|
|
ges_formatter_get_project (GESFormatter *formatter);
|
2012-11-27 16:52:59 +00:00
|
|
|
G_GNUC_INTERNAL GESAsset *
|
|
|
|
_find_formatter_asset_for_uri (const gchar *uri);
|
2012-12-17 22:26:23 +00:00
|
|
|
|
2012-11-19 16:24:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************
|
|
|
|
* *
|
|
|
|
* GESProject internal methods *
|
|
|
|
* *
|
|
|
|
************************************************/
|
|
|
|
|
|
|
|
/* FIXME This should probably become public, but we need to make sure it
|
2012-11-27 16:52:59 +00:00
|
|
|
* is the right API before doing so */
|
|
|
|
G_GNUC_INTERNAL gboolean ges_project_set_loaded (GESProject * project,
|
|
|
|
GESFormatter *formatter);
|
|
|
|
G_GNUC_INTERNAL gchar * ges_project_try_updating_id (GESProject *self,
|
|
|
|
GESAsset *asset,
|
|
|
|
GError *error);
|
2013-01-11 14:49:02 +00:00
|
|
|
G_GNUC_INTERNAL void ges_project_add_loading_asset (GESProject *project,
|
|
|
|
GType extractable_type,
|
|
|
|
const gchar *id);
|
2012-12-17 22:26:23 +00:00
|
|
|
|
2012-11-19 16:24:03 +00:00
|
|
|
/************************************************
|
|
|
|
* *
|
|
|
|
* GESBaseXmlFormatter internal methods *
|
|
|
|
* *
|
|
|
|
************************************************/
|
|
|
|
|
|
|
|
/* FIXME GESBaseXmlFormatter is all internal for now, the API is not stable
|
|
|
|
* fo now, so do not expose it */
|
2013-01-20 15:42:29 +00:00
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
|
2012-11-19 16:24:03 +00:00
|
|
|
const gchar *id,
|
|
|
|
const char *asset_id,
|
|
|
|
GType type,
|
|
|
|
GstClockTime start,
|
|
|
|
GstClockTime inpoint,
|
|
|
|
GstClockTime duration,
|
|
|
|
guint layer_prio,
|
|
|
|
GESTrackType track_types,
|
|
|
|
GstStructure *properties,
|
|
|
|
const gchar *metadatas,
|
|
|
|
GError **error);
|
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_asset (GESBaseXmlFormatter * self,
|
|
|
|
const gchar * id,
|
|
|
|
GType extractable_type,
|
|
|
|
GstStructure *properties,
|
|
|
|
const gchar *metadatas,
|
|
|
|
GError **error);
|
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_layer (GESBaseXmlFormatter *self,
|
|
|
|
GType extractable_type,
|
|
|
|
guint priority,
|
|
|
|
GstStructure *properties,
|
|
|
|
const gchar *metadatas,
|
|
|
|
GError **error);
|
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_track (GESBaseXmlFormatter *self,
|
|
|
|
GESTrackType track_type,
|
|
|
|
GstCaps *caps,
|
|
|
|
const gchar *id,
|
|
|
|
GstStructure *properties,
|
|
|
|
const gchar *metadatas,
|
|
|
|
GError **error);
|
|
|
|
void ges_base_xml_formatter_add_encoding_profile (GESBaseXmlFormatter * self,
|
|
|
|
const gchar *type,
|
|
|
|
const gchar *parent,
|
|
|
|
const gchar * name,
|
|
|
|
const gchar * description,
|
|
|
|
GstCaps * format,
|
|
|
|
const gchar * preset,
|
|
|
|
const gchar * preset_name,
|
|
|
|
guint id,
|
|
|
|
guint presence,
|
|
|
|
GstCaps * restriction,
|
|
|
|
guint pass,
|
|
|
|
gboolean variableframerate,
|
|
|
|
GstStructure * properties,
|
|
|
|
GError ** error);
|
2013-07-08 22:31:30 +00:00
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_track_element (GESBaseXmlFormatter *self,
|
2012-11-19 16:24:03 +00:00
|
|
|
GType effect_type,
|
|
|
|
const gchar *asset_id,
|
|
|
|
const gchar * track_id,
|
|
|
|
const gchar *timeline_obj_id,
|
|
|
|
GstStructure *children_properties,
|
|
|
|
GstStructure *properties,
|
|
|
|
const gchar *metadatas,
|
|
|
|
GError **error);
|
2013-03-30 17:54:50 +00:00
|
|
|
|
2013-09-13 23:35:55 +00:00
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_source (GESBaseXmlFormatter *self,
|
|
|
|
const gchar * track_id,
|
|
|
|
GstStructure *children_properties);
|
|
|
|
|
2013-07-09 14:57:51 +00:00
|
|
|
G_GNUC_INTERNAL void ges_base_xml_formatter_add_control_binding (GESBaseXmlFormatter * self,
|
2013-07-08 22:31:30 +00:00
|
|
|
const gchar * binding_type,
|
|
|
|
const gchar * source_type,
|
|
|
|
const gchar * property_name,
|
|
|
|
gint mode,
|
|
|
|
const gchar *track_id,
|
|
|
|
GSList * timed_values);
|
2013-03-30 17:54:50 +00:00
|
|
|
|
2012-11-19 16:24:03 +00:00
|
|
|
G_GNUC_INTERNAL void set_property_foreach (GQuark field_id,
|
|
|
|
const GValue * value,
|
|
|
|
GObject * object);;
|
|
|
|
|
|
|
|
/* Function to initialise GES */
|
|
|
|
G_GNUC_INTERNAL void _init_standard_transition_assets (void);
|
|
|
|
G_GNUC_INTERNAL void _init_formatter_assets (void);
|
|
|
|
|
2013-01-10 14:15:32 +00:00
|
|
|
/* Utilities */
|
2013-01-15 13:52:17 +00:00
|
|
|
G_GNUC_INTERNAL gint element_start_compare (GESTimelineElement * a,
|
2013-03-23 04:33:39 +00:00
|
|
|
GESTimelineElement * b);
|
|
|
|
G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement * a,
|
|
|
|
GESTimelineElement * b);
|
2014-06-16 09:38:29 +00:00
|
|
|
G_GNUC_INTERNAL GstElementFactory *
|
|
|
|
ges_get_compositor_factory (void);
|
2013-03-23 04:33:39 +00:00
|
|
|
|
2013-08-07 17:37:49 +00:00
|
|
|
void
|
|
|
|
ges_base_xml_formatter_set_timeline_properties(GESBaseXmlFormatter * self,
|
|
|
|
GESTimeline *timeline,
|
|
|
|
const gchar *properties,
|
|
|
|
const gchar *metadatas);
|
|
|
|
|
2013-03-01 01:27:50 +00:00
|
|
|
/****************************************************
|
|
|
|
* GESContainer *
|
|
|
|
****************************************************/
|
2013-03-23 04:33:39 +00:00
|
|
|
G_GNUC_INTERNAL void _ges_container_sort_children (GESContainer *container);
|
|
|
|
G_GNUC_INTERNAL void _ges_container_sort_children_by_end (GESContainer *container);
|
2013-03-01 01:27:50 +00:00
|
|
|
|
2013-03-15 14:58:59 +00:00
|
|
|
/****************************************************
|
|
|
|
* GESClip *
|
|
|
|
****************************************************/
|
2013-04-23 23:04:04 +00:00
|
|
|
void ges_clip_set_layer (GESClip *clip, GESLayer *layer);
|
2013-03-15 15:01:58 +00:00
|
|
|
gboolean ges_clip_is_moving_from_layer (GESClip *clip);
|
2013-07-02 00:35:39 +00:00
|
|
|
guint32 ges_clip_get_layer_priority (GESClip *clip);
|
2013-03-15 15:01:58 +00:00
|
|
|
void ges_clip_set_moving_from_layer (GESClip *clip, gboolean is_moving);
|
2013-03-22 01:03:09 +00:00
|
|
|
GESTrackElement* ges_clip_create_track_element (GESClip *clip, GESTrackType type);
|
|
|
|
GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType type);
|
2013-01-10 14:15:32 +00:00
|
|
|
|
2013-03-22 01:12:47 +00:00
|
|
|
|
|
|
|
/****************************************************
|
|
|
|
* GESTrackElement *
|
|
|
|
****************************************************/
|
2014-08-15 13:48:14 +00:00
|
|
|
#define NLE_OBJECT_TRACK_ELEMENT_QUARK (g_quark_from_string ("nle_object_track_element_quark"))
|
2013-03-29 18:23:00 +00:00
|
|
|
G_GNUC_INTERNAL gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track);
|
|
|
|
G_GNUC_INTERNAL guint32 _ges_track_element_get_layer_priority (GESTrackElement * element);
|
2013-07-24 18:26:18 +00:00
|
|
|
G_GNUC_INTERNAL void ges_track_element_copy_properties (GESTimelineElement * element,
|
|
|
|
GESTimelineElement * elementcopy);
|
2013-03-22 01:12:47 +00:00
|
|
|
|
2013-08-13 16:05:55 +00:00
|
|
|
G_GNUC_INTERNAL void ges_track_element_split_bindings (GESTrackElement *element,
|
|
|
|
GESTrackElement *new_element,
|
|
|
|
guint64 position);
|
2013-07-02 09:12:00 +00:00
|
|
|
|
|
|
|
G_GNUC_INTERNAL GstElement *ges_source_create_topbin (const gchar * bin_name, GstElement * sub_element, ...);
|
|
|
|
|
2013-08-17 12:57:15 +00:00
|
|
|
G_GNUC_INTERNAL void ges_track_set_caps (GESTrack *track, const GstCaps *caps);
|
|
|
|
|
2013-12-24 14:34:51 +00:00
|
|
|
|
|
|
|
/*********************************************
|
|
|
|
* GESTrackElement subclasses contructores *
|
|
|
|
********************************************/
|
|
|
|
G_GNUC_INTERNAL GESAudioTestSource * ges_audio_test_source_new (void);
|
|
|
|
G_GNUC_INTERNAL GESAudioUriSource * ges_audio_uri_source_new (gchar *uri);
|
|
|
|
G_GNUC_INTERNAL GESVideoUriSource * ges_video_uri_source_new (gchar *uri);
|
|
|
|
G_GNUC_INTERNAL GESImageSource * ges_image_source_new (gchar *uri);
|
|
|
|
G_GNUC_INTERNAL GESTitleSource * ges_title_source_new (void);
|
|
|
|
G_GNUC_INTERNAL GESVideoTestSource * ges_video_test_source_new (void);
|
|
|
|
|
2013-11-12 11:13:31 +00:00
|
|
|
/******************************
|
|
|
|
* GESMultiFile internal API *
|
|
|
|
******************************/
|
|
|
|
typedef struct GESMultiFileURI
|
|
|
|
{
|
|
|
|
gchar *location;
|
|
|
|
gint start;
|
|
|
|
gint end;
|
|
|
|
} GESMultiFileURI;
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri);
|
|
|
|
|
2014-09-27 07:59:12 +00:00
|
|
|
/************************
|
|
|
|
* Our property masks *
|
|
|
|
************************/
|
|
|
|
#define GES_PARAM_NO_SERIALIZATION (1 << (G_PARAM_USER_SHIFT + 1))
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
/********************
|
|
|
|
* Gnonlin helpers *
|
|
|
|
********************/
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL gboolean nle_composition_add_object (GstElement *comp, GstElement *object);
|
|
|
|
G_GNUC_INTERNAL gboolean nle_composition_remove_object (GstElement *comp, GstElement *object);
|
|
|
|
|
2012-11-19 16:24:03 +00:00
|
|
|
#endif /* __GES_INTERNAL_H__ */
|