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.
24 #include <glib-object.h>
26 #include <ges/ges-timeline-element.h>
27 #include <ges/ges-container.h>
28 #include <ges/ges-types.h>
29 #include <ges/ges-track.h>
33 #define GES_TYPE_CLIP ges_clip_get_type()
34 #define GES_CLIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_CLIP, GESClip))
35 #define GES_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_CLIP, GESClipClass))
36 #define GES_IS_CLIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_CLIP))
37 #define GES_IS_CLIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_CLIP))
38 #define GES_CLIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_CLIP, GESClipClass))
40 typedef struct _GESClipPrivate GESClipPrivate;
43 * GESFillTrackElementFunc:
44 * @clip: the #GESClip controlling the track elements
45 * @track_element: the #GESTrackElement
46 * @nleobj: the GNonLin object that needs to be filled.
48 * A function that will be called when the GNonLin object of a corresponding
49 * track element needs to be filled.
51 * The implementer of this function shall add the proper #GstElement to @nleobj
52 * using gst_bin_add().
54 * Returns: TRUE if the implementer succesfully filled the @nleobj, else #FALSE.
56 typedef gboolean (*GESFillTrackElementFunc) (GESClip *clip, GESTrackElement *track_element,
60 * GESCreateTrackElementFunc:
62 * @type: a #GESTrackType
64 * Creates the 'primary' track element for this @clip.
66 * Subclasses should implement this method if they only provide a
67 * single #GESTrackElement per track.
69 * If the subclass needs to create more than one #GESTrackElement for a
70 * given track, then it should implement the 'create_track_elements'
73 * The implementer of this function shall return the proper #GESTrackElement
74 * that should be controlled by @clip for the given @track.
76 * The returned #GESTrackElement will be automatically added to the list
77 * of objects controlled by the #GESClip.
79 * Returns: the #GESTrackElement to be used, or %NULL if it can't provide one
80 * for the given @track.
82 typedef GESTrackElement *(*GESCreateTrackElementFunc) (GESClip * clip, GESTrackType type);
85 * GESCreateTrackElementsFunc:
87 * @type: a #GESTrackType
89 * Create all track elements this clip handles for this type of track.
91 * Subclasses should implement this method if they potentially need to
92 * return more than one #GESTrackElement(s) for a given #GESTrack.
94 * Returns: %TRUE on success %FALSE on failure.
97 typedef GList * (*GESCreateTrackElementsFunc) (GESClip * clip, GESTrackType type);
102 * The #GESClip base class.
109 GESClipPrivate *priv;
111 /* Padding for API extension */
112 gpointer _ges_reserved[GES_PADDING_LARGE];
117 * @create_track_element: method to create a single #GESTrackElement for a given #GESTrack.
118 * @create_track_elements: method to create multiple #GESTrackElements for a
121 * Subclasses can override the @create_track_element.
126 GESContainerClass parent_class;
129 GESCreateTrackElementFunc create_track_element;
130 GESCreateTrackElementsFunc create_track_elements;
133 /* Padding for API extension */
134 gpointer _ges_reserved[GES_PADDING_LARGE];
137 /****************************************************
139 ****************************************************/
141 GType ges_clip_get_type (void);
143 /****************************************************
144 * TrackElement handling *
145 ****************************************************/
147 GESTrackType ges_clip_get_supported_formats (GESClip *clip);
149 void ges_clip_set_supported_formats (GESClip *clip, GESTrackType supportedformats);
151 GESTrackElement* ges_clip_add_asset (GESClip *clip, GESAsset *asset);
153 GESTrackElement* ges_clip_find_track_element (GESClip *clip, GESTrack *track,
156 GList * ges_clip_find_track_elements (GESClip * clip, GESTrack * track,
157 GESTrackType track_type, GType type);
159 /****************************************************
161 ****************************************************/
163 GESLayer* ges_clip_get_layer (GESClip *clip);
165 gboolean ges_clip_move_to_layer (GESClip *clip, GESLayer *layer);
167 guint32 ges_clip_get_layer_priority (GESClip * clip);
169 /****************************************************
171 ****************************************************/
173 GList* ges_clip_get_top_effects (GESClip *clip);
175 gint ges_clip_get_top_effect_position (GESClip *clip, GESBaseEffect *effect);
177 gint ges_clip_get_top_effect_index (GESClip *clip, GESBaseEffect *effect);
179 gboolean ges_clip_set_top_effect_priority (GESClip *clip, GESBaseEffect *effect,
182 gboolean ges_clip_set_top_effect_index (GESClip *clip, GESBaseEffect *effect,
185 /****************************************************
187 ****************************************************/
189 GESClip* ges_clip_split (GESClip *clip, guint64 position);
192 #endif /* _GES_CLIP */