summaryrefslogtreecommitdiff
path: root/ges/ges-clip.c
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2013-09-28 18:09:49 +0200
committerThibault Saunier <thibault.saunier@collabora.com>2013-09-28 18:09:49 +0200
commitca562ba8a06aab63bf411c026a60aaab05fff238 (patch)
tree9bbb8d71fc80f4c463dec10bb91e617bdd50a8f5 /ges/ges-clip.c
parent002977cd85d21400194ba8041bb48c313952d995 (diff)
clip: Return the newly created TrackElement when adding an asset
This is a minor API change
Diffstat (limited to 'ges/ges-clip.c')
-rw-r--r--ges/ges-clip.c21
1 files changed, 14 insertions, 7 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;
}