}
}
- if (opts->scenario && !load_path) {
+ if ((opts->scenario || opts->testfile) && !load_path) {
if (!has_video && opts->track_types & GES_TRACK_TYPE_VIDEO) {
trackv = GES_TRACK (ges_video_track_new ());
if (self->priv->parsed_options.load_path && project_uri
&& ges_validate_activate (GST_PIPELINE (self->priv->pipeline),
self, opts) == FALSE) {
- g_error ("Could not activate scenario %s", opts->scenario);
+ if (opts->scenario)
+ g_error ("Could not activate scenario %s", opts->scenario);
+ else
+ g_error ("Could not activate testfile %s", opts->testfile);
self->priv->seenerrors = TRUE;
g_application_quit (G_APPLICATION (self));
}
static gboolean
_create_timeline (GESLauncher * self, const gchar * serialized_timeline,
- const gchar * proj_uri, const gchar * scenario)
+ const gchar * proj_uri, gboolean validate)
{
GESProject *project;
if (proj_uri != NULL) {
project = ges_project_new (proj_uri);
- } else if (scenario == NULL) {
+ } else if (!validate) {
GST_INFO ("serialized timeline is %s", serialized_timeline);
project = ges_project_new (serialized_timeline);
} else {
self->priv->pipeline = ges_pipeline_new ();
- if (!_create_timeline (self, serialized_timeline, uri, opts->scenario)) {
+ if (!_create_timeline (self, serialized_timeline, uri, opts->scenario
+ || opts->testfile)) {
GST_ERROR ("Could not create the timeline");
goto failure;
}
}
,
#ifdef HAVE_GST_VALIDATE
+ {"set-test-file", 0, 0, G_OPTION_ARG_STRING, &opts->testfile,
+ "ges-launch-1.0 exposes gst-validate functionalities, such as test files and scenarios."
+ " Scenarios describe actions to execute, such as seeks or setting of "
+ "properties. "
+ "GES implements editing-specific actions such as adding or removing "
+ "clips. "
+ "See gst-validate-1.0 --help for more info about validate and "
+ "scenarios, " "and --inspect-action-type.",
+ "</test/file/path>"}
+ ,
{"set-scenario", 0, 0, G_OPTION_ARG_STRING, &opts->scenario,
"ges-launch-1.0 exposes gst-validate functionalities, such as scenarios."
" Scenarios describe actions to execute, such as seeks or setting of "
goto done;
}
- if (!opts->load_path && !opts->scenario && !opts->list_transitions
- && (argc <= 1)) {
+ if (!opts->load_path && !opts->scenario && !opts->testfile
+ && !opts->list_transitions && (argc <= 1)) {
g_printf ("%s", g_option_context_get_help (ctx, TRUE, NULL));
g_option_context_free (ctx);
*exit_status = 1;
g_free (opts->video_track_caps);
g_free (opts->audio_track_caps);
g_free (opts->scenario);
+ g_free (opts->testfile);
G_OBJECT_CLASS (ges_launcher_parent_class)->finalize (object);
}
return TRUE;
}
- ges_validate_register_action_types ();
- ges_validate_register_issues ();
+ gst_validate_init_debug ();
- if (opts->scenario) {
+ if (opts->testfile) {
+ if (opts->scenario)
+ g_error ("Can not specify scenario and testfile at the same time");
+ gst_validate_setup_test_file (opts->testfile, opts->mute);
+ } else if (opts->scenario) {
if (g_strcmp0 (opts->scenario, "none")) {
gchar *scenario_name =
g_strconcat (opts->scenario, "->gespipeline*", NULL);
}
}
+ ges_validate_register_action_types ();
+ ges_validate_register_issues ();
+
runner = gst_validate_runner_new ();
gst_tracing_register_hook (GST_TRACER (runner), "bin-add-post",
G_CALLBACK (bin_element_added));
if (metas) {
gchar **ges_options = gst_validate_utils_get_strv (metas, "ges-options");
+ if (!ges_options)
+ ges_options = gst_validate_utils_get_strv (metas, "args");
if (ges_options) {
gint i;
ges_validate_activate (GstPipeline * pipeline, GESLauncher * launcher,
GESLauncherParsedOptions * opts)
{
+ if (opts->testfile) {
+ GST_WARNING ("Trying to run testfile %s, but gst-validate not supported",
+ opts->testfile);
+
+ return FALSE;
+ }
+
if (opts->scenario) {
GST_WARNING ("Trying to run scenario %s, but gst-validate not supported",
opts->scenario);