From 258453a16906a67d0384f2c8bdd3163ea9aca76d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 28 Jun 2019 17:34:00 -0400 Subject: [PATCH] validate:scenario: Keep a reference to 'description' structure For it to be reusable outside the scenario --- validate/gst/validate/gst-validate-scenario.c | 6 +++++- validate/gst/validate/gst-validate-scenario.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 4805f19a13..0258d14f88 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -3378,6 +3378,7 @@ _load_scenario_file (GstValidateScenario * scenario, &priv->max_latency); gst_structure_get_int (structure, "max-dropped", &priv->max_dropped); + scenario->description = gst_structure_copy (structure); continue; } else if (!g_strcmp0 (type, "include")) { @@ -3736,7 +3737,8 @@ gst_validate_scenario_dispose (GObject * object) static void 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 * main thread. */ @@ -3750,6 +3752,8 @@ gst_validate_scenario_finalize (GObject * object) (GDestroyNotify) gst_mini_object_unref); g_free (priv->pipeline_name); gst_structure_free (priv->vars); + if (self->description) + gst_structure_free (self->description); g_mutex_clear (&priv->lock); G_OBJECT_CLASS (gst_validate_scenario_parent_class)->finalize (object); diff --git a/validate/gst/validate/gst-validate-scenario.h b/validate/gst/validate/gst-validate-scenario.h index 94757963b9..6761f8a922 100644 --- a/validate/gst/validate/gst-validate-scenario.h +++ b/validate/gst/validate/gst-validate-scenario.h @@ -271,12 +271,13 @@ struct _GstValidateScenario GstObject parent; /*< public >*/ + GstStructure *description; /*< private >*/ GstValidateScenarioPrivate *priv; union { - gpointer _gst_reserved[GST_PADDING + 1]; + gpointer _gst_reserved[GST_PADDING]; struct { GMutex eos_handling_lock; } abi;