mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
validate:scenario: Add a way to specify the pipeline on which a scenario applies
Summary: From within the scenario itself. Depends on D165 Reviewers: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D166
This commit is contained in:
parent
2548eafd11
commit
2e8552eff0
1 changed files with 32 additions and 1 deletions
|
@ -137,6 +137,8 @@ struct _GstValidateScenarioPrivate
|
||||||
GstState target_state;
|
GstState target_state;
|
||||||
|
|
||||||
GList *overrides;
|
GList *overrides;
|
||||||
|
|
||||||
|
GstStructure *description;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct KeyFileGroupName
|
typedef struct KeyFileGroupName
|
||||||
|
@ -2138,6 +2140,9 @@ _load_scenario_file (GstValidateScenario * scenario,
|
||||||
gst_structure_get_boolean (structure, "is-config", is_config);
|
gst_structure_get_boolean (structure, "is-config", is_config);
|
||||||
gst_structure_get_boolean (structure, "handles-states",
|
gst_structure_get_boolean (structure, "handles-states",
|
||||||
&priv->handles_state);
|
&priv->handles_state);
|
||||||
|
|
||||||
|
priv->description = gst_structure_copy (structure);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else if (!(action_type = _find_action_type (type))) {
|
} else if (!(action_type = _find_action_type (type))) {
|
||||||
if (gst_structure_has_field (structure, "optional-action-type")) {
|
if (gst_structure_has_field (structure, "optional-action-type")) {
|
||||||
|
@ -2435,7 +2440,8 @@ gst_validate_scenario_finalize (GObject * object)
|
||||||
(GDestroyNotify) gst_mini_object_unref);
|
(GDestroyNotify) gst_mini_object_unref);
|
||||||
g_list_free_full (priv->on_addition_actions,
|
g_list_free_full (priv->on_addition_actions,
|
||||||
(GDestroyNotify) gst_mini_object_unref);
|
(GDestroyNotify) gst_mini_object_unref);
|
||||||
|
if (priv->description)
|
||||||
|
gst_structure_free (priv->description);
|
||||||
g_mutex_clear (&priv->lock);
|
g_mutex_clear (&priv->lock);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gst_validate_scenario_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gst_validate_scenario_parent_class)->finalize (object);
|
||||||
|
@ -2567,6 +2573,22 @@ gst_validate_scenario_factory_create (GstValidateRunner *
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scenario->priv->description) {
|
||||||
|
const gchar *pipeline_name =
|
||||||
|
gst_structure_get_string (scenario->priv->description,
|
||||||
|
"pipeline-name");
|
||||||
|
|
||||||
|
if (pipeline_name && !g_pattern_match_simple (pipeline_name,
|
||||||
|
GST_OBJECT_NAME (pipeline))) {
|
||||||
|
GST_INFO ("Scenario %s only applies on pipeline %s not %s",
|
||||||
|
scenario_name, pipeline_name, GST_OBJECT_NAME (pipeline));
|
||||||
|
|
||||||
|
gst_object_unref (scenario);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
scenario->pipeline = pipeline;
|
scenario->pipeline = pipeline;
|
||||||
g_object_weak_ref (G_OBJECT (pipeline),
|
g_object_weak_ref (G_OBJECT (pipeline),
|
||||||
(GWeakNotify) _pipeline_freed_cb, scenario);
|
(GWeakNotify) _pipeline_freed_cb, scenario);
|
||||||
|
@ -3141,6 +3163,15 @@ init_scenarios (void)
|
||||||
.possible_variables = NULL,
|
.possible_variables = NULL,
|
||||||
.def = "infinite (GST_CLOCK_TIME_NONE)"
|
.def = "infinite (GST_CLOCK_TIME_NONE)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "pipeline-name",
|
||||||
|
.description = "The name of the GstPipeline on which the scenario should be executed.\n"
|
||||||
|
"It has the same effect as setting the pipeline using pipeline_name->scenario_name.",
|
||||||
|
.mandatory = FALSE,
|
||||||
|
.types = "string",
|
||||||
|
.possible_variables = NULL,
|
||||||
|
.def = "NULL"
|
||||||
|
},
|
||||||
{NULL}
|
{NULL}
|
||||||
}),
|
}),
|
||||||
"Allows to describe the scenario in various ways",
|
"Allows to describe the scenario in various ways",
|
||||||
|
|
Loading…
Reference in a new issue