qa-scenario: re add scenarios creation to bin-monitor

GstPipelines are monitored by bin monitors. Create scenarios if
requested from the bin monitors and store them there.
This commit is contained in:
Thiago Santos 2013-08-07 17:31:17 -03:00
parent 71fd0e57cd
commit 6544d5f67e
4 changed files with 25 additions and 6 deletions

View File

@ -56,6 +56,9 @@ gst_qa_bin_monitor_dispose (GObject * object)
if (bin && monitor->element_added_id) if (bin && monitor->element_added_id)
g_signal_handler_disconnect (bin, monitor->element_added_id); g_signal_handler_disconnect (bin, monitor->element_added_id);
if (monitor->scenario)
g_object_unref (monitor->scenario);
g_list_free_full (monitor->element_monitors, g_object_unref); g_list_free_full (monitor->element_monitors, g_object_unref);
G_OBJECT_CLASS (parent_class)->dispose (object); G_OBJECT_CLASS (parent_class)->dispose (object);
@ -81,6 +84,22 @@ gst_qa_bin_monitor_init (GstQaBinMonitor * bin_monitor)
{ {
} }
static void
gst_qa_bin_monitor_create_scenarios (GstQaBinMonitor * monitor)
{
/* scenarios currently only make sense for pipelines */
if (GST_IS_PIPELINE (GST_QA_MONITOR_GET_OBJECT (monitor))) {
const gchar *scenario_name;
if ((scenario_name = g_getenv ("GST_QA_SCENARIO"))) {
monitor->scenario =
gst_qa_scenario_factory_create (GST_QA_MONITOR_GET_RUNNER (monitor),
GST_ELEMENT_CAST (GST_QA_MONITOR_GET_OBJECT (monitor)),
scenario_name);
}
}
}
/** /**
* gst_qa_bin_monitor_new: * gst_qa_bin_monitor_new:
* @bin: (transfer-none): a #GstBin to run QA on * @bin: (transfer-none): a #GstBin to run QA on
@ -96,6 +115,9 @@ gst_qa_bin_monitor_new (GstBin * bin, GstQaRunner * runner,
g_object_unref (monitor); g_object_unref (monitor);
return NULL; return NULL;
} }
gst_qa_bin_monitor_create_scenarios (monitor);
return monitor; return monitor;
} }

View File

@ -26,6 +26,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gst-qa-element-monitor.h" #include "gst-qa-element-monitor.h"
#include "gst-qa-runner.h" #include "gst-qa-runner.h"
#include "gst-qa-scenario.h"
G_BEGIN_DECLS G_BEGIN_DECLS
@ -55,6 +56,8 @@ struct _GstQaBinMonitor {
GList *element_monitors; GList *element_monitors;
GstQaScenario *scenario;
/*< private >*/ /*< private >*/
gulong element_added_id; gulong element_added_id;
}; };

View File

@ -23,7 +23,6 @@
#include "gst-qa-report.h" #include "gst-qa-report.h"
#include "gst-qa-monitor-factory.h" #include "gst-qa-monitor-factory.h"
#include "gst-qa-override-registry.h" #include "gst-qa-override-registry.h"
#include "gst-qa-scenario.h"
/** /**
* SECTION:gst-qa-runner * SECTION:gst-qa-runner
@ -57,9 +56,6 @@ gst_qa_runner_dispose (GObject * object)
g_slist_free_full (runner->reports, (GDestroyNotify) gst_qa_report_unref); g_slist_free_full (runner->reports, (GDestroyNotify) gst_qa_report_unref);
if (runner->scenario)
g_object_unref (runner->scenario);
G_OBJECT_CLASS (parent_class)->dispose (object); G_OBJECT_CLASS (parent_class)->dispose (object);
} }

View File

@ -58,8 +58,6 @@ struct _GstQaRunner {
gboolean setup; gboolean setup;
/*< private >*/ /*< private >*/
GstQaScenario *scenario;
GSList *reports; GSList *reports;
}; };