validate:scenario: Keep a reference to 'description' structure

For it to be reusable outside the scenario
This commit is contained in:
Thibault Saunier 2019-06-28 17:34:00 -04:00
parent 71fe16fd1c
commit 258453a169
2 changed files with 7 additions and 2 deletions

View file

@ -3378,6 +3378,7 @@ _load_scenario_file (GstValidateScenario * scenario,
&priv->max_latency); &priv->max_latency);
gst_structure_get_int (structure, "max-dropped", &priv->max_dropped); gst_structure_get_int (structure, "max-dropped", &priv->max_dropped);
scenario->description = gst_structure_copy (structure);
continue; continue;
} else if (!g_strcmp0 (type, "include")) { } else if (!g_strcmp0 (type, "include")) {
@ -3736,7 +3737,8 @@ gst_validate_scenario_dispose (GObject * object)
static void static void
gst_validate_scenario_finalize (GObject * object) gst_validate_scenario_finalize (GObject * object)
{ {
GstValidateScenarioPrivate *priv = GST_VALIDATE_SCENARIO (object)->priv; GstValidateScenario *self = GST_VALIDATE_SCENARIO (object);
GstValidateScenarioPrivate *priv = self->priv;
/* Because g_object_add_weak_pointer() is used, this MUST be on the /* Because g_object_add_weak_pointer() is used, this MUST be on the
* main thread. */ * main thread. */
@ -3750,6 +3752,8 @@ gst_validate_scenario_finalize (GObject * object)
(GDestroyNotify) gst_mini_object_unref); (GDestroyNotify) gst_mini_object_unref);
g_free (priv->pipeline_name); g_free (priv->pipeline_name);
gst_structure_free (priv->vars); gst_structure_free (priv->vars);
if (self->description)
gst_structure_free (self->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);

View file

@ -271,12 +271,13 @@ struct _GstValidateScenario
GstObject parent; GstObject parent;
/*< public >*/ /*< public >*/
GstStructure *description;
/*< private >*/ /*< private >*/
GstValidateScenarioPrivate *priv; GstValidateScenarioPrivate *priv;
union { union {
gpointer _gst_reserved[GST_PADDING + 1]; gpointer _gst_reserved[GST_PADDING];
struct { struct {
GMutex eos_handling_lock; GMutex eos_handling_lock;
} abi; } abi;