mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
qa-report: Do not keep a ref to the source but keep its name instead
We currently do not need to access the object source after its creation but we need to be able to have a usefull for debugging name.
This commit is contained in:
parent
7faac43afb
commit
4b808aeb81
2 changed files with 8 additions and 4 deletions
|
@ -154,7 +154,11 @@ 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;
|
||||||
report->source = g_object_ref (source);
|
if (GST_IS_PAD (source))
|
||||||
|
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;
|
||||||
|
|
||||||
|
@ -166,7 +170,7 @@ gst_qa_report_unref (GstQaReport * report)
|
||||||
{
|
{
|
||||||
if (G_UNLIKELY (g_atomic_int_dec_and_test (&report->refcount))) {
|
if (G_UNLIKELY (g_atomic_int_dec_and_test (&report->refcount))) {
|
||||||
g_free (report->message);
|
g_free (report->message);
|
||||||
g_object_unref (report->source);
|
g_free (report->source_name);
|
||||||
g_slice_free (GstQaReport, report);
|
g_slice_free (GstQaReport, report);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,14 +83,14 @@ typedef struct {
|
||||||
gint subarea;
|
gint subarea;
|
||||||
gchar *message;
|
gchar *message;
|
||||||
|
|
||||||
GstObject *source;
|
gchar *source_name;
|
||||||
guint64 timestamp;
|
guint64 timestamp;
|
||||||
} GstQaReport;
|
} GstQaReport;
|
||||||
|
|
||||||
#define GST_QA_ERROR_REPORT_PRINT_FORMAT GST_TIME_FORMAT " (%s): %s, %s(%d)) %s(%d): %s"
|
#define GST_QA_ERROR_REPORT_PRINT_FORMAT GST_TIME_FORMAT " (%s): %s, %s(%d)) %s(%d): %s"
|
||||||
#define GST_QA_REPORT_PRINT_ARGS(r) GST_TIME_ARGS (r->timestamp), \
|
#define GST_QA_REPORT_PRINT_ARGS(r) GST_TIME_ARGS (r->timestamp), \
|
||||||
gst_qa_report_level_get_name (r->level), \
|
gst_qa_report_level_get_name (r->level), \
|
||||||
r->source ? GST_OBJECT_NAME(r->source) : "null", \
|
r->source_name, \
|
||||||
gst_qa_report_area_get_name(r->area), r->area, \
|
gst_qa_report_area_get_name(r->area), r->area, \
|
||||||
gst_qa_report_subarea_get_name(r->area, r->subarea), r->subarea, \
|
gst_qa_report_subarea_get_name(r->area, r->subarea), r->subarea, \
|
||||||
r->message
|
r->message
|
||||||
|
|
Loading…
Reference in a new issue