mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
qa-runner: Remove printing API from qa-runner
Replace it with functions to list the reports
This commit is contained in:
parent
4456e24cdf
commit
4e9bedcde8
4 changed files with 24 additions and 14 deletions
|
@ -158,14 +158,16 @@ gst_qa_runner_add_report (GstQaRunner * runner, GstQaReport * report)
|
|||
g_signal_emit (runner, _signals[REPORT_ADDED_SIGNAL], 0, report);
|
||||
}
|
||||
|
||||
void
|
||||
gst_qa_runner_print_reports (GstQaRunner * runner)
|
||||
guint
|
||||
gst_qa_runner_get_reports_count (GstQaRunner * runner)
|
||||
{
|
||||
GSList *iter;
|
||||
|
||||
for (iter = runner->reports; iter; iter = g_slist_next (iter)) {
|
||||
GstQaReport *report = iter->data;
|
||||
|
||||
gst_qa_report_printf (report);
|
||||
}
|
||||
return g_slist_length (runner->reports);
|
||||
}
|
||||
|
||||
GSList *
|
||||
gst_qa_runner_get_reports (GstQaRunner * runner)
|
||||
{
|
||||
/* TODO should we need locking or put in htte docs to always call this
|
||||
* after pipeline ends? */
|
||||
return runner->reports;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,9 @@ GType gst_qa_runner_get_type (void);
|
|||
GstQaRunner * gst_qa_runner_new (GstElement * pipeline);
|
||||
|
||||
void gst_qa_runner_add_report (GstQaRunner * runner, GstQaReport * report);
|
||||
void gst_qa_runner_print_reports (GstQaRunner * runner);
|
||||
|
||||
guint gst_qa_runner_get_reports_count (GstQaRunner * runner);
|
||||
GSList * gst_qa_runner_get_reports (GstQaRunner * runner);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -246,6 +246,7 @@ main (int argc, gchar ** argv)
|
|||
|
||||
GError *err = NULL;
|
||||
const gchar *scenario = NULL;
|
||||
guint count = -1;
|
||||
|
||||
GOptionEntry options[] = {
|
||||
{"output-format", 'o', 0, G_OPTION_ARG_CALLBACK, &_parse_encoding_profile,
|
||||
|
@ -315,13 +316,15 @@ main (int argc, gchar ** argv)
|
|||
goto exit;
|
||||
g_main_loop_run (mainloop);
|
||||
|
||||
g_print ("Pipeline finished, printing issues found: \n");
|
||||
gst_qa_runner_print_reports (runner);
|
||||
count = gst_qa_runner_get_reports_count (runner);
|
||||
g_print ("Pipeline finished, total issues found: %u\n", count);
|
||||
|
||||
exit:
|
||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||
g_main_loop_unref (mainloop);
|
||||
g_object_unref (runner);
|
||||
g_object_unref (pipeline);
|
||||
if (count)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ main (int argc, gchar ** argv)
|
|||
{
|
||||
GError *err = NULL;
|
||||
const gchar *scenario = NULL;
|
||||
guint count = -1;
|
||||
|
||||
GOptionEntry options[] = {
|
||||
{"set-scenario", '\0', 0, G_OPTION_ARG_STRING, &scenario,
|
||||
|
@ -104,13 +105,15 @@ main (int argc, gchar ** argv)
|
|||
goto exit;
|
||||
g_main_loop_run (mainloop);
|
||||
|
||||
g_print ("Pipeline finished, printing issues found: \n");
|
||||
gst_qa_runner_print_reports (runner);
|
||||
count = gst_qa_runner_get_reports_count (runner);
|
||||
g_print ("Pipeline finished, issues found: %u\n", count);
|
||||
|
||||
exit:
|
||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||
g_main_loop_unref (mainloop);
|
||||
g_object_unref (runner);
|
||||
g_object_unref (pipeline);
|
||||
if (count)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue