mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
ges: Accept path as URI in the create clip structured interface
This commit is contained in:
parent
7efa8c86a9
commit
20d94bea13
1 changed files with 16 additions and 1 deletions
|
@ -245,6 +245,14 @@ done:
|
|||
} \
|
||||
} G_STMT_END
|
||||
|
||||
static gchar *
|
||||
ensure_uri (gchar * location)
|
||||
{
|
||||
if (gst_uri_is_valid (location))
|
||||
return g_strdup (location);
|
||||
else
|
||||
return gst_filename_to_uri (location, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
||||
|
@ -255,7 +263,7 @@ _ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
|||
GESClip *clip;
|
||||
gint layer_priority;
|
||||
const gchar *name;
|
||||
const gchar *asset_id;
|
||||
gchar *asset_id = NULL;
|
||||
const gchar *type_string;
|
||||
GType type;
|
||||
gboolean res = FALSE;
|
||||
|
@ -290,6 +298,12 @@ _ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
|||
goto beach;
|
||||
}
|
||||
|
||||
if (type == GES_TYPE_URI_CLIP) {
|
||||
asset_id = ensure_uri (asset_id);
|
||||
} else {
|
||||
asset_id = g_strdup (asset_id);
|
||||
}
|
||||
|
||||
asset = _ges_get_asset_from_timeline (timeline, type, asset_id, error);
|
||||
if (!asset) {
|
||||
res = FALSE;
|
||||
|
@ -339,6 +353,7 @@ _ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
|||
gst_object_unref (layer);
|
||||
|
||||
beach:
|
||||
g_free (asset_id);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue