ges-launch: Make use of assets for uri clips

It avoids races in TrackElement creations.

We should make use of assets everywhere in ges-launch but start using
them for uriclips first for now.
This commit is contained in:
Thibault Saunier 2013-06-12 10:48:03 -04:00
parent aa08ddb8d6
commit be765f564c

View file

@ -203,15 +203,31 @@ create_timeline (int nbargs, gchar ** argv, gchar * audio, gchar * video)
else {
gchar *uri;
GESAsset *asset;
guint64 inpoint;
GError *error = NULL;
if (!(uri = ensure_uri (source))) {
GST_ERROR ("couldn't create uri for '%s'", source);
goto build_failure;
}
inpoint = str_to_time (argv[i * 3 + 1]);
clip = GES_CLIP (ges_uri_clip_new (uri));
asset = GES_ASSET (ges_uri_clip_asset_request_sync (uri, &error));
if (error) {
g_printerr ("Can not create asset for %s", uri);
return NULL;
}
clip = GES_CLIP (ges_asset_extract (asset, &error));
if (error) {
g_printerr ("Can not extract asset for %s", uri);
return NULL;
}
g_object_set (clip,
"in-point", (guint64) inpoint, "duration", (guint64) duration, NULL);