qa-runner: removing _setup call

Do setup on the _new function directly instead of having a separate
call for that
This commit is contained in:
Thiago Santos 2013-07-30 10:21:13 -03:00
parent 044084949a
commit 2eba57d387
5 changed files with 13 additions and 13 deletions

View file

@ -40,10 +40,9 @@ gst_qa_preload_wrap (GstElement * element)
/* TODO this will actually never unref the runner as it holds a ref
* to the element */
g_object_set_data_full ((GObject *) element, "qa-runner", runner,
g_object_unref);
gst_qa_runner_setup (runner);
if (runner)
g_object_set_data_full ((GObject *) element, "qa-runner", runner,
g_object_unref);
}
GstElement *

View file

@ -51,6 +51,8 @@ enum
static guint _signals[LAST_SIGNAL] = { 0 };
static gboolean gst_qa_runner_setup (GstQaRunner * runner);
static void
gst_qa_runner_dispose (GObject * object)
{
@ -119,21 +121,22 @@ gst_qa_runner_new (GstElement * pipeline)
runner = g_object_new (GST_TYPE_QA_RUNNER, NULL);
runner->pipeline = gst_object_ref (pipeline);
if ((scenario_name = g_getenv ("GST_QA_SCENARIO")))
runner->scenario = gst_qa_scenario_factory_create (runner, scenario_name);
g_object_set_data ((GObject *) pipeline, "qa-runner", runner);
if (!gst_qa_runner_setup (runner)) {
gst_object_unref (runner);
runner = NULL;
}
return runner;
}
gboolean
static gboolean
gst_qa_runner_setup (GstQaRunner * runner)
{
if (runner->setup)
return TRUE;
GST_INFO_OBJECT (runner, "Starting QA Runner setup");
runner->monitor =
gst_qa_monitor_factory_create (GST_OBJECT_CAST (runner->pipeline), runner,
@ -143,7 +146,6 @@ gst_qa_runner_setup (GstQaRunner * runner)
return FALSE;
}
runner->setup = TRUE;
GST_DEBUG_OBJECT (runner, "Setup successful");
return TRUE;
}

View file

@ -80,7 +80,6 @@ struct _GstQaRunnerClass {
GType gst_qa_runner_get_type (void);
GstQaRunner * gst_qa_runner_new (GstElement * pipeline);
gboolean gst_qa_runner_setup (GstQaRunner * runner);
void gst_qa_runner_add_report (GstQaRunner * runner, GstQaReport * report);
void gst_qa_runner_print_reports (GstQaRunner * runner);

View file

@ -300,7 +300,7 @@ main (int argc, gchar ** argv)
runner = gst_qa_runner_new (pipeline);
mainloop = g_main_loop_new (NULL, FALSE);
if (!gst_qa_runner_setup (runner)) {
if (!runner) {
g_printerr ("Failed to setup QA Runner\n");
exit (1);
}

View file

@ -89,7 +89,7 @@ main (int argc, gchar ** argv)
runner = gst_qa_runner_new (pipeline);
mainloop = g_main_loop_new (NULL, FALSE);
if (!gst_qa_runner_setup (runner)) {
if (!runner) {
g_printerr ("Failed to setup QA Runner\n");
exit (1);
}