mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-05 19:31:26 +00:00
qa-report: expose API for adding custom issues
expose gst_qa_issue_register and gst_qa_issue_new to allow applications to register their own custom issues. Issues IDs should use Areas higher than GST_QA_AREA_OTHER for custom areas. And to add more issues to existing areas, the IDs should be higher than GST_QA_ISSUE_ID_CUSTOM_FIRST. Custom issues registering should be done at startup and from the same thread as there is no locking around the issues hashtable
This commit is contained in:
parent
2034fb11d9
commit
76679b1c7e
2 changed files with 12 additions and 3 deletions
|
@ -43,7 +43,7 @@ gst_qa_issue_get_id (GstQaIssue * issue)
|
||||||
return issue->issue_id;
|
return issue->issue_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstQaIssue *
|
GstQaIssue *
|
||||||
gst_qa_issue_new (GstQaIssueId issue_id, gchar * summary,
|
gst_qa_issue_new (GstQaIssueId issue_id, gchar * summary,
|
||||||
gchar * description, GstQaReportLevel default_level)
|
gchar * description, GstQaReportLevel default_level)
|
||||||
{
|
{
|
||||||
|
@ -65,9 +65,12 @@ gst_qa_issue_free (GstQaIssue * issue)
|
||||||
g_slice_free (GstQaIssue, issue);
|
g_slice_free (GstQaIssue, issue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
gst_qa_issue_register (GstQaIssue * issue)
|
gst_qa_issue_register (GstQaIssue * issue)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (g_hash_table_lookup (_gst_qa_issues,
|
||||||
|
(gpointer) gst_qa_issue_get_id (issue)) != NULL);
|
||||||
|
|
||||||
g_hash_table_insert (_gst_qa_issues, (gpointer) gst_qa_issue_get_id (issue),
|
g_hash_table_insert (_gst_qa_issues, (gpointer) gst_qa_issue_get_id (issue),
|
||||||
issue);
|
issue);
|
||||||
}
|
}
|
||||||
|
@ -207,6 +210,8 @@ gst_qa_report_level_get_name (GstQaReportLevel level)
|
||||||
return "warning";
|
return "warning";
|
||||||
case GST_QA_REPORT_LEVEL_ISSUE:
|
case GST_QA_REPORT_LEVEL_ISSUE:
|
||||||
return "issue";
|
return "issue";
|
||||||
|
case GST_QA_REPORT_LEVEL_IGNORE:
|
||||||
|
return "ignore";
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ typedef guintptr GstQaIssueId;
|
||||||
#define GST_QA_ISSUE_ID_UNKNOWN 0
|
#define GST_QA_ISSUE_ID_UNKNOWN 0
|
||||||
|
|
||||||
#define GST_QA_ISSUE_ID_SHIFT 16
|
#define GST_QA_ISSUE_ID_SHIFT 16
|
||||||
|
#define GST_QA_ISSUE_ID_CUSTOM_FIRST (2 << 15)
|
||||||
|
|
||||||
#define GST_QA_ISSUE_ID_BUFFER_BEFORE_SEGMENT (((GstQaIssueId) GST_QA_AREA_BUFFER) << GST_QA_ISSUE_ID_SHIFT | 1)
|
#define GST_QA_ISSUE_ID_BUFFER_BEFORE_SEGMENT (((GstQaIssueId) GST_QA_AREA_BUFFER) << GST_QA_ISSUE_ID_SHIFT | 1)
|
||||||
#define GST_QA_ISSUE_ID_BUFFER_IS_OUT_OF_SEGMENT (((GstQaIssueId) GST_QA_AREA_BUFFER) << GST_QA_ISSUE_ID_SHIFT | 2)
|
#define GST_QA_ISSUE_ID_BUFFER_IS_OUT_OF_SEGMENT (((GstQaIssueId) GST_QA_AREA_BUFFER) << GST_QA_ISSUE_ID_SHIFT | 2)
|
||||||
|
@ -144,6 +145,10 @@ typedef struct {
|
||||||
void gst_qa_report_init (void);
|
void gst_qa_report_init (void);
|
||||||
GstQaIssue * gst_qa_issue_from_id (GstQaIssueId issue_id);
|
GstQaIssue * gst_qa_issue_from_id (GstQaIssueId issue_id);
|
||||||
GstQaIssueId gst_qa_issue_get_id (GstQaIssue * issue);
|
GstQaIssueId gst_qa_issue_get_id (GstQaIssue * issue);
|
||||||
|
void gst_qa_issue_register (GstQaIssue * issue);
|
||||||
|
GstQaIssue * gst_qa_issue_new (GstQaIssueId issue_id, gchar * summary,
|
||||||
|
gchar * description,
|
||||||
|
GstQaReportLevel default_level);
|
||||||
|
|
||||||
GstQaReport * gst_qa_report_new (GstQaIssue * issue,
|
GstQaReport * gst_qa_report_new (GstQaIssue * issue,
|
||||||
GstQaReporter * reporter,
|
GstQaReporter * reporter,
|
||||||
|
@ -156,7 +161,6 @@ GstQaIssueId gst_qa_report_get_issue_id (GstQaReport * report);
|
||||||
void gst_qa_report_check_abort (GstQaReport * report);
|
void gst_qa_report_check_abort (GstQaReport * report);
|
||||||
void gst_qa_report_printf (GstQaReport * report);
|
void gst_qa_report_printf (GstQaReport * report);
|
||||||
|
|
||||||
|
|
||||||
const gchar * gst_qa_report_level_get_name (GstQaReportLevel level);
|
const gchar * gst_qa_report_level_get_name (GstQaReportLevel level);
|
||||||
const gchar * gst_qa_report_area_get_name (GstQaReportArea area);
|
const gchar * gst_qa_report_area_get_name (GstQaReportArea area);
|
||||||
const gchar * gst_qa_report_subarea_get_name (GstQaReportArea area, gint subarea);
|
const gchar * gst_qa_report_subarea_get_name (GstQaReportArea area, gint subarea);
|
||||||
|
|
Loading…
Reference in a new issue