mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
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:
parent
aa08ddb8d6
commit
be765f564c
1 changed files with 17 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue