mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
tools: Simplify the setting of action scenario vs config scenario
This make it easier for user to understand the difference between the two concepts and avoids confusion. Change-Id: Ib42913722c93a1e7e3c8b156173c458230946592 Conflicts: validate/tools/gst-validate-transcoding.c validate/tools/gst-validate.c
This commit is contained in:
parent
9dfee4dffa
commit
1c3340ecbb
3 changed files with 37 additions and 10 deletions
|
@ -922,10 +922,10 @@ invalid_name:
|
|||
}
|
||||
one_actions_scenario_max:
|
||||
{
|
||||
GST_ERROR ("You can not set several actions scenario (you can "
|
||||
"have set various confi scenario though, meaning you have to set"
|
||||
" 'scenario, is-config=true' in the scenario file, and all actions"
|
||||
" should be executable at parsing time)");
|
||||
GST_ERROR ("You can set at most only one action scenario. "
|
||||
"You can have several config scenarios though (a config scenario's "
|
||||
"file must have is-config=true, and all its actions must be executable "
|
||||
"at parsing time).");
|
||||
ret = FALSE;
|
||||
goto done;
|
||||
|
||||
|
|
|
@ -708,7 +708,7 @@ main (int argc, gchar ** argv)
|
|||
#endif
|
||||
|
||||
GError *err = NULL;
|
||||
const gchar *scenario = NULL;
|
||||
const gchar *scenario = NULL, *configs = NULL;
|
||||
gboolean want_help = FALSE;
|
||||
gboolean list_scenarios = FALSE;
|
||||
|
||||
|
@ -725,6 +725,11 @@ main (int argc, gchar ** argv)
|
|||
{"set-scenario", '\0', 0, G_OPTION_ARG_STRING, &scenario,
|
||||
"Let you set a scenario, it will override the GST_VALIDATE_SCENARIO "
|
||||
"environment variable", NULL},
|
||||
{"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs,
|
||||
"Let you set a config scenario, the scenario needs to be set as 'config"
|
||||
"' you can specify a list of scenario separated by ':'"
|
||||
" it will override the GST_VALIDATE_SCENARIO environment variable,",
|
||||
NULL},
|
||||
{"eos-on-shutdown", 'e', 0, G_OPTION_ARG_NONE, &eos_on_shutdown,
|
||||
"If an EOS event should be sent to the pipeline if an interrupt is "
|
||||
"received, instead of forcing the pipeline to stop. Sending an EOS "
|
||||
|
@ -765,8 +770,17 @@ main (int argc, gchar ** argv)
|
|||
|
||||
g_option_context_free (ctx);
|
||||
|
||||
if (scenario)
|
||||
g_setenv ("GST_VALIDATE_SCENARIO", scenario, TRUE);
|
||||
if (scenario || configs) {
|
||||
gchar *scenarios;
|
||||
|
||||
if (scenario)
|
||||
scenarios = g_strjoin (":", scenario, configs, NULL);
|
||||
else
|
||||
scenarios = g_strdup (configs);
|
||||
|
||||
g_setenv ("GST_VALIDATE_SCENARIO", scenarios, TRUE);
|
||||
g_free (scenarios);
|
||||
}
|
||||
|
||||
if (list_scenarios)
|
||||
gst_validate_list_scenarios ();
|
||||
|
|
|
@ -99,7 +99,7 @@ int
|
|||
main (int argc, gchar ** argv)
|
||||
{
|
||||
GError *err = NULL;
|
||||
const gchar *scenario = NULL;
|
||||
const gchar *scenario = NULL, *configs = NULL;
|
||||
gboolean list_scenarios = FALSE;
|
||||
#ifdef G_OS_UNIX
|
||||
guint signal_watch_id;
|
||||
|
@ -112,6 +112,11 @@ main (int argc, gchar ** argv)
|
|||
"environment variable", NULL},
|
||||
{"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios,
|
||||
"List the avalaible scenarios that can be run", NULL},
|
||||
{"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs,
|
||||
"Let you set a config scenario, the scenario needs to be set as 'config"
|
||||
"' you can specify a list of scenario separated by ':'"
|
||||
" it will override the GST_VALIDATE_SCENARIO environment variable,",
|
||||
NULL},
|
||||
{NULL}
|
||||
};
|
||||
GOptionContext *ctx;
|
||||
|
@ -140,8 +145,16 @@ main (int argc, gchar ** argv)
|
|||
exit (1);
|
||||
}
|
||||
|
||||
if (scenario) {
|
||||
g_setenv ("GST_VALIDATE_SCENARIO", scenario, TRUE);
|
||||
if (scenario || configs) {
|
||||
gchar *scenarios;
|
||||
|
||||
if (scenario)
|
||||
scenarios = g_strjoin (":", scenario, configs, NULL);
|
||||
else
|
||||
scenarios = g_strdup (configs);
|
||||
|
||||
g_setenv ("GST_VALIDATE_SCENARIO", scenarios, TRUE);
|
||||
g_free (scenarios);
|
||||
}
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
|
Loading…
Reference in a new issue