qa-report: Pass the whole monitor when creating a report

So we have the proper source name already avalaible and in the future
we might need some more informations about the monitor itself.
This commit is contained in:
Thibault Saunier 2013-07-18 12:11:00 -04:00 committed by Thiago Santos
parent dd672acf8b
commit eebb3522bf
3 changed files with 9 additions and 10 deletions

View file

@ -236,9 +236,7 @@ gst_qa_monitor_do_report_valist (GstQaMonitor * monitor,
GstQaReport *report; GstQaReport *report;
message = g_strdup_vprintf (format, var_args); message = g_strdup_vprintf (format, var_args);
report = report = gst_qa_report_new (monitor, level, area, subarea, message);
gst_qa_report_new (GST_OBJECT_CAST (GST_QA_MONITOR_GET_OBJECT
(monitor)), level, area, subarea, message);
GST_INFO_OBJECT (monitor, "Received error report %d : %d : %d : %s", GST_INFO_OBJECT (monitor, "Received error report %d : %d : %d : %s",
level, area, subarea, message); level, area, subarea, message);

View file

@ -22,6 +22,7 @@
#include <string.h> #include <string.h>
#include "gst-qa-report.h" #include "gst-qa-report.h"
#include "gst-qa-monitor.h"
static GstClockTime _gst_qa_report_start_time = 0; static GstClockTime _gst_qa_report_start_time = 0;
static GstQaDebugFlags _gst_qa_flags = 0; static GstQaDebugFlags _gst_qa_flags = 0;
@ -175,7 +176,7 @@ gst_qa_report_check_abort (GstQaReport * report)
} }
GstQaReport * GstQaReport *
gst_qa_report_new (GstObject * source, GstQaReportLevel level, gst_qa_report_new (GstQaMonitor * monitor, GstQaReportLevel level,
GstQaReportArea area, gint subarea, const gchar * message) GstQaReportArea area, gint subarea, const gchar * message)
{ {
GstQaReport *report = g_slice_new0 (GstQaReport); GstQaReport *report = g_slice_new0 (GstQaReport);
@ -183,11 +184,7 @@ gst_qa_report_new (GstObject * source, GstQaReportLevel level,
report->level = level; report->level = level;
report->area = area; report->area = area;
report->subarea = subarea; report->subarea = subarea;
if (GST_IS_PAD (source)) report->source_name = g_strdup (monitor->target_name);
report->source_name =
g_strdup_printf ("%s:%s", GST_DEBUG_PAD_NAME (source));
else
report->source_name = g_strdup (GST_OBJECT_NAME (source));
report->message = g_strdup (message); report->message = g_strdup (message);
report->timestamp = gst_util_get_timestamp () - _gst_qa_report_start_time; report->timestamp = gst_util_get_timestamp () - _gst_qa_report_start_time;

View file

@ -27,6 +27,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* forward declaration */
typedef struct _GstQaMonitor GstQaMonitor;
GType gst_qa_report_get_type (void); GType gst_qa_report_get_type (void);
#define GST_TYPE_QA_REPORT (gst_qa_report_get_type ()) #define GST_TYPE_QA_REPORT (gst_qa_report_get_type ())
@ -103,7 +106,8 @@ typedef struct {
r->message r->message
void gst_qa_report_init (void); void gst_qa_report_init (void);
GstQaReport * gst_qa_report_new (GstObject * source, GstQaReportLevel level, GstQaReportArea area, GstQaReport * gst_qa_report_new (GstQaMonitor * monitor, GstQaReportLevel level,
GstQaReportArea area,
gint subarea, const gchar * message); gint subarea, const gchar * message);
void gst_qa_report_unref (GstQaReport * report); void gst_qa_report_unref (GstQaReport * report);
GstQaReport * gst_qa_report_ref (GstQaReport * report); GstQaReport * gst_qa_report_ref (GstQaReport * report);