From 130140d059146aea9f234be66d27130025a3a734 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 10 Mar 2020 16:10:12 -0300 Subject: [PATCH] launch: Add a way to disable validate at runtime Also avoid to add useless bin in our sinks --- tools/ges-launcher.c | 7 ++++++- tools/ges-launcher.h | 1 + tools/ges-validate.c | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/ges-launcher.c b/tools/ges-launcher.c index 6564952666..88845dbc14 100644 --- a/tools/ges-launcher.c +++ b/tools/ges-launcher.c @@ -283,7 +283,8 @@ _set_sink (GESLauncher * self, const gchar * sink_desc, { if (sink_desc != NULL) { GError *err = NULL; - GstElement *sink = gst_parse_bin_from_description (sink_desc, TRUE, &err); + GstElement *sink = gst_parse_bin_from_description_full (sink_desc, TRUE, + NULL, GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS, &err); if (sink == NULL) { GST_ERROR ("could not create the requested videosink %s (err: %s), " "exiting", err ? err->message : "", sink_desc); @@ -782,6 +783,10 @@ ges_launcher_parse_options (GESLauncher * self, "scenarios, " "and --inspect-action-type.", ""} , + {"disable-validate", 'n', 0, G_OPTION_ARG_NONE, &opts->disable_validate, + "Do not run inside GstValidate.", + ""} + , #endif { "embed-nesteds", diff --git a/tools/ges-launcher.h b/tools/ges-launcher.h index 84da4b4b8c..d9372b976b 100644 --- a/tools/ges-launcher.h +++ b/tools/ges-launcher.h @@ -50,6 +50,7 @@ typedef struct gchar *video_track_caps; gchar *audio_track_caps; gboolean embed_nesteds; + gboolean disable_validate; } GESLauncherParsedOptions; struct _GESLauncher { diff --git a/tools/ges-validate.c b/tools/ges-validate.c index 2c9509ec48..2e185e8765 100644 --- a/tools/ges-validate.c +++ b/tools/ges-validate.c @@ -107,6 +107,14 @@ ges_validate_activate (GstPipeline * pipeline, GESLauncher * launcher, GstValidateRunner *runner = NULL; GstValidateMonitor *monitor = NULL; + if (opts->disable_validate) { + if (opts->scenario) + g_error ("Trying to run scenario: %s but validate is deactivated", + opts->scenario); + opts->needs_set_state = TRUE; + return TRUE; + } + ges_validate_register_action_types (); ges_validate_register_issues ();