mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +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);
|
caps = gst_caps_from_string (caps_str);
|
||||||
|
|
||||||
if (!caps) {
|
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);
|
G_OBJECT_TYPE_NAME (track), caps_str);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -115,6 +115,22 @@ _set_track_restriction_caps (GESTrack * track, const gchar * caps_str)
|
||||||
return TRUE;
|
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
|
static gboolean
|
||||||
_timeline_set_user_options (GESLauncher * self, GESTimeline * timeline,
|
_timeline_set_user_options (GESLauncher * self, GESTimeline * timeline,
|
||||||
const gchar * load_path)
|
const gchar * load_path)
|
||||||
|
@ -167,6 +183,8 @@ retry:
|
||||||
if (!(ges_timeline_add_track (timeline, tracka)))
|
if (!(ges_timeline_add_track (timeline, tracka)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_set_restriction_caps (timeline, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue