summaryrefslogtreecommitdiff
path: root/ges
diff options
context:
space:
mode:
Diffstat (limited to 'ges')
-rw-r--r--ges/ges-clip.c21
-rw-r--r--ges/ges-clip.h2
2 files changed, 15 insertions, 8 deletions
diff --git a/ges/ges-clip.c b/ges/ges-clip.c
index 09a07b15..0c25dea8 100644
--- a/ges/ges-clip.c
+++ b/ges/ges-clip.c
@@ -1417,16 +1417,23 @@ _trim (GESTimelineElement * element, GstClockTime start)
*
* Takes a reference on @track_element.
*
- * Returns: %TRUE on success, %FALSE on failure.
+ * Returns: (transfer none)(allow-none): Created #GESTrackElement or NULL
+ * if an error happened
*/
-gboolean
+GESTrackElement *
ges_clip_add_asset (GESClip * clip, GESAsset * asset)
{
- g_return_val_if_fail (GES_IS_CLIP (clip), FALSE);
- g_return_val_if_fail (GES_IS_ASSET (asset), FALSE);
+ GESTrackElement *element;
+
+ g_return_val_if_fail (GES_IS_CLIP (clip), NULL);
+ g_return_val_if_fail (GES_IS_ASSET (asset), NULL);
g_return_val_if_fail (g_type_is_a (ges_asset_get_extractable_type
- (asset), GES_TYPE_TRACK_ELEMENT), FALSE);
+ (asset), GES_TYPE_TRACK_ELEMENT), NULL);
+
+ element = GES_TRACK_ELEMENT (ges_asset_extract (asset, NULL));
+
+ if (!ges_container_add (GES_CONTAINER (clip), GES_TIMELINE_ELEMENT (element)))
+ return NULL;
- return ges_container_add (GES_CONTAINER (clip),
- GES_TIMELINE_ELEMENT (ges_asset_extract (asset, NULL)));
+ return element;
}
diff --git a/ges/ges-clip.h b/ges/ges-clip.h
index 26f35f5c..5bafa910 100644
--- a/ges/ges-clip.h
+++ b/ges/ges-clip.h
@@ -144,7 +144,7 @@ GType ges_clip_get_type (void);
****************************************************/
GESTrackType ges_clip_get_supported_formats (GESClip *clip);
void ges_clip_set_supported_formats (GESClip *clip, GESTrackType supportedformats);
-gboolean ges_clip_add_asset (GESClip *clip, GESAsset *asset);
+GESTrackElement* ges_clip_add_asset (GESClip *clip, GESAsset *asset);
GESTrackElement* ges_clip_find_track_element (GESClip *clip, GESTrack *track,
GType type);