if (monitor->scenario) {
gst_validate_reporter_purge_reports (GST_VALIDATE_REPORTER
(monitor->scenario));
- gst_object_unref (monitor->scenario);
+ gst_clear_object (&monitor->scenario);
}
g_list_free_full (monitor->element_monitors, purge_and_unref_reporter);
GST_ELEMENT_NAME (element),
gst_validate_reporter_get_name (GST_VALIDATE_REPORTER (monitor)));
}
+
+/**
+ * gst_validate_bin_monitor_get_scenario:
+ * @monitor: A #GstValidateBinMonitor
+ *
+ * Returns: (transfer full) (nullable): The #GstValidateScenario being executed
+ * under @monitor watch
+ *
+ * Since: 1.20
+ */
+GstValidateScenario *
+gst_validate_bin_monitor_get_scenario (GstValidateBinMonitor * monitor)
+{
+ if (monitor->scenario)
+ return gst_object_ref (monitor->scenario);
+
+ return NULL;
+}
GST_VALIDATE_API
GType gst_validate_bin_monitor_get_type (void);
-GST_VALIDATE_API
-GstValidateBinMonitor * gst_validate_bin_monitor_new (GstBin * bin, GstValidateRunner * runner, GstValidateMonitor * parent);
+GST_VALIDATE_API GstValidateBinMonitor *
+gst_validate_bin_monitor_new (GstBin * bin,
+ GstValidateRunner * runner,
+ GstValidateMonitor * parent);
+
+GST_VALIDATE_API GstValidateScenario *
+gst_validate_bin_monitor_get_scenario (GstValidateBinMonitor * monitor);
G_END_DECLS