validate: Handle passing timeline desc in .validatetest files

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/227>
This commit is contained in:
Thibault Saunier 2021-01-15 15:26:36 -03:00
parent 410fd67045
commit 8094f8cd93
4 changed files with 21 additions and 0 deletions

View file

@ -469,6 +469,7 @@ _set_rendering_details (GESLauncher * self)
GESLauncherParsedOptions *opts = &self->priv->parsed_options;
gboolean smart_profile = FALSE;
GESPipelineFlags cmode = ges_pipeline_get_mode (self->priv->pipeline);
GESProject *proj;
if (cmode & GES_PIPELINE_MODE_RENDER
|| cmode & GES_PIPELINE_MODE_SMART_RENDER) {
@ -918,12 +919,23 @@ _run_pipeline (GESLauncher * self)
GESLauncherParsedOptions *opts = &self->priv->parsed_options;
if (!opts->load_path) {
g_clear_pointer (&opts->sanitized_timeline, &g_free);
if (ges_validate_activate (GST_PIPELINE (self->priv->pipeline),
self, opts) == FALSE) {
g_error ("Could not activate scenario %s", opts->scenario);
return FALSE;
}
if (opts->sanitized_timeline) {
GESProject *project = ges_project_new (opts->sanitized_timeline);
if (!ges_project_load (project, self->priv->timeline, NULL)) {
ges_printerr ("Could not load timeline: %s\n",
opts->sanitized_timeline);
return FALSE;
}
}
if (!_timeline_set_user_options (self, self->priv->timeline, NULL)) {
ges_printerr ("Could not properly set tracks\n");
return FALSE;

View file

@ -183,6 +183,8 @@ ges_validate_activate (GstPipeline * pipeline, GESLauncher * launcher,
ges_launcher_parse_options (launcher, &ges_options_full, NULL, NULL,
NULL);
opts->sanitized_timeline =
sanitize_timeline_description (ges_options_full, opts);
g_strfreev (ges_options_full);
g_strfreev (ges_options);
}

View file

@ -24,6 +24,7 @@
#include <gst/gst.h>
#include <ges/ges.h>
#include "utils.h"
#include "ges-launcher.h"
G_BEGIN_DECLS

View file

@ -110,6 +110,12 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts)
prev_arg = args[i];
}
if (i == 1) {
g_free (string);
return NULL;
}
if (strstr (string, "+track")) {
gchar *res = g_strconcat ("ges:", string, NULL);
g_free (string);