mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
launch: Set user restriction caps even when loading projects
This commit is contained in:
parent
ea2b5bded8
commit
f9d7fa36e0
1 changed files with 19 additions and 1 deletions
|
@ -103,7 +103,7 @@ _set_track_restriction_caps (GESTrack * track, const gchar * caps_str)
|
|||
caps = gst_caps_from_string (caps_str);
|
||||
|
||||
if (!caps) {
|
||||
g_printerr ("Could not create caps for %s from: %s",
|
||||
g_error ("Could not create caps for %s from: %s",
|
||||
G_OBJECT_TYPE_NAME (track), caps_str);
|
||||
|
||||
return FALSE;
|
||||
|
@ -115,6 +115,22 @@ _set_track_restriction_caps (GESTrack * track, const gchar * caps_str)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_set_restriction_caps (GESTimeline * timeline, ParsedOptions * opts)
|
||||
{
|
||||
GList *tmp, *tracks = ges_timeline_get_tracks (timeline);
|
||||
|
||||
for (tmp = tracks; tmp; tmp = tmp->next) {
|
||||
if (GES_TRACK (tmp->data)->type == GES_TRACK_TYPE_VIDEO)
|
||||
_set_track_restriction_caps (tmp->data, opts->video_track_caps);
|
||||
else if (GES_TRACK (tmp->data)->type == GES_TRACK_TYPE_AUDIO)
|
||||
_set_track_restriction_caps (tmp->data, opts->audio_track_caps);
|
||||
}
|
||||
|
||||
g_list_free_full (tracks, gst_object_unref);
|
||||
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_timeline_set_user_options (GESLauncher * self, GESTimeline * timeline,
|
||||
const gchar * load_path)
|
||||
|
@ -167,6 +183,8 @@ retry:
|
|||
if (!(ges_timeline_add_track (timeline, tracka)))
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
_set_restriction_caps (timeline, opts);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue