mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
tools:ges-launch: Save the project at the end of execution
So that changes from scenarios are taken into account
This commit is contained in:
parent
6a371b308b
commit
f4faa487ba
1 changed files with 21 additions and 8 deletions
|
@ -429,6 +429,22 @@ build_failure:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_save_timeline (GESTimeline * timeline, const gchar * load_path)
|
||||||
|
{
|
||||||
|
if (save_path && !load_path) {
|
||||||
|
gchar *uri;
|
||||||
|
if (!(uri = ensure_uri (save_path))) {
|
||||||
|
g_error ("couldn't create uri for '%s", save_path);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ges_timeline_save_to_uri (timeline, uri, NULL, TRUE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static GESPipeline *
|
static GESPipeline *
|
||||||
create_pipeline (GESTimeline ** ret_timeline, gchar * load_path,
|
create_pipeline (GESTimeline ** ret_timeline, gchar * load_path,
|
||||||
int argc, char **argv, const gchar * scenario)
|
int argc, char **argv, const gchar * scenario)
|
||||||
|
@ -456,14 +472,8 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path,
|
||||||
|
|
||||||
/* save project if path is given. we do this now in case GES crashes or
|
/* save project if path is given. we do this now in case GES crashes or
|
||||||
* hangs during playback. */
|
* hangs during playback. */
|
||||||
if (save_path && !load_path) {
|
if (!_save_timeline (timeline, load_path))
|
||||||
gchar *uri;
|
|
||||||
if (!(uri = ensure_uri (save_path))) {
|
|
||||||
g_error ("couldn't create uri for '%s", save_path);
|
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
|
||||||
ges_timeline_save_to_uri (timeline, uri, NULL, TRUE, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* In order to view our timeline, let's grab a convenience pipeline to put
|
/* In order to view our timeline, let's grab a convenience pipeline to put
|
||||||
* our timeline in. */
|
* our timeline in. */
|
||||||
|
@ -985,6 +995,9 @@ main (int argc, gchar ** argv)
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||||
|
|
||||||
|
/* Re save the timeline in case the scenario changed it! */
|
||||||
|
_save_timeline (timeline, load_path);
|
||||||
|
|
||||||
validate_res = ges_validate_clean (GST_PIPELINE (pipeline));
|
validate_res = ges_validate_clean (GST_PIPELINE (pipeline));
|
||||||
if (seenerrors == FALSE)
|
if (seenerrors == FALSE)
|
||||||
seenerrors = validate_res;
|
seenerrors = validate_res;
|
||||||
|
|
Loading…
Reference in a new issue