3 * Copyright (C) 2013 Thibault Saunier <thibault.saunier@collabora.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 #ifndef _GST_VALIDATE_REPORTER_
21 #define _GST_VALIDATE_REPORTER_
23 typedef struct _GstValidateReporter GstValidateReporter;
24 typedef struct _GstValidateReporterInterface GstValidateReporterInterface;
26 #include <glib-object.h>
27 #include <gst/validate/validate-prelude.h>
28 #include <gst/validate/gst-validate-report.h>
29 #include <gst/validate/gst-validate-runner.h>
30 #include <gst/validate/gst-validate-enums.h>
31 #include <gst/validate/gst-validate-scenario.h>
35 /* GstValidateReporter interface declarations */
36 #ifndef __GI_SCANNER__
37 #define GST_TYPE_VALIDATE_REPORTER (gst_validate_reporter_get_type ())
38 #define GST_VALIDATE_REPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_REPORTER, GstValidateReporter))
39 #define GST_IS_VALIDATE_REPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_REPORTER))
40 #define GST_VALIDATE_REPORTER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VALIDATE_REPORTER, GstValidateReporterInterface))
41 #define GST_VALIDATE_REPORTER_CAST(obj) ((GstValidateReporter *) obj)
45 * GST_VALIDATE_REPORT:
46 * @m: The #GstValidateReporter where the issue happened
47 * @issue_id: The #GstValidateIssueId of the issue
48 * @...: The format of the message describing the issue in a printf
49 * format, followed by the parameters.
51 * Reports a new issue in the GstValidate reporting system with @m
52 * as the source of that issue.
54 #ifdef G_HAVE_ISO_VARARGS
55 #define GST_VALIDATE_REPORT(m, issue_id, ...) \
57 gst_validate_report (GST_VALIDATE_REPORTER (m), \
62 #define GST_VALIDATE_REPORT_ACTION(m, a, issue_id, ...) \
64 gst_validate_report_action (GST_VALIDATE_REPORTER (m), a, \
69 #else /* G_HAVE_GNUC_VARARGS */
70 #ifdef G_HAVE_GNUC_VARARGS
71 #define GST_VALIDATE_REPORT(m, issue_id, args...) \
73 gst_validate_report (GST_VALIDATE_REPORTER (m), \
76 #define GST_VALIDATE_REPORT_ACTION(m, a, issue_id, args...) \
78 gst_validate_report_action (GST_VALIDATE_REPORTER (m), a, \
81 #endif /* G_HAVE_ISO_VARARGS */
82 #endif /* G_HAVE_GNUC_VARARGS */
84 GType gst_validate_reporter_get_type (void);
87 * GstValidateInterceptionReturn:
88 * @GST_VALIDATE_REPORTER_DROP: The report will be completely ignored.
89 * @GST_VALIDATE_REPORTER_KEEP: The report will be kept by the reporter,
90 * but not reported to the runner.
91 * @GST_VALIDATE_REPORTER_REPORT: The report will be kept by the reporter
92 * and reported to the runner.
96 GST_VALIDATE_REPORTER_DROP,
97 GST_VALIDATE_REPORTER_KEEP,
98 GST_VALIDATE_REPORTER_REPORT
99 } GstValidateInterceptionReturn;
102 * GstValidateReporter:
104 struct _GstValidateReporterInterface
106 GTypeInterface parent;
108 GstValidateInterceptionReturn (*intercept_report) (GstValidateReporter * reporter,
109 GstValidateReport * report);
110 GstValidateReportingDetails (*get_reporting_level) (GstValidateReporter * reporter);
111 GstPipeline * (*get_pipeline) (GstValidateReporter *reporter);
115 void gst_validate_reporter_set_name (GstValidateReporter * reporter,
118 const gchar * gst_validate_reporter_get_name (GstValidateReporter * reporter);
120 GstValidateRunner * gst_validate_reporter_get_runner (GstValidateReporter *reporter);
122 void gst_validate_reporter_init (GstValidateReporter * reporter, const gchar *name);
124 void gst_validate_report (GstValidateReporter * reporter, GstValidateIssueId issue_id,
125 const gchar * format, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NO_INSTRUMENT;
127 void gst_validate_report_action (GstValidateReporter * reporter,
128 GstValidateAction *action,
129 GstValidateIssueId issue_id,
130 const gchar * format, ...) G_GNUC_PRINTF (4, 5) G_GNUC_NO_INSTRUMENT;
132 void gst_validate_report_valist (GstValidateReporter * reporter, GstValidateIssueId issue_id,
133 const gchar * format, va_list var_args) G_GNUC_PRINTF (3, 0);
134 GST_VALIDATE_API void
135 gst_validate_reporter_report_simple (GstValidateReporter * reporter, GstValidateIssueId issue_id,
136 const gchar * message);
139 void gst_validate_reporter_set_runner (GstValidateReporter * reporter, GstValidateRunner *runner);
141 void gst_validate_reporter_set_handle_g_logs (GstValidateReporter * reporter);
143 GstValidateReport * gst_validate_reporter_get_report (GstValidateReporter *reporter,
144 GstValidateIssueId issue_id);
146 GList * gst_validate_reporter_get_reports (GstValidateReporter * reporter);
148 gint gst_validate_reporter_get_reports_count (GstValidateReporter *reporter);
150 GstValidateReportingDetails gst_validate_reporter_get_reporting_level (GstValidateReporter *reporter);
153 void gst_validate_reporter_purge_reports (GstValidateReporter * reporter);
155 GstPipeline * gst_validate_reporter_get_pipeline (GstValidateReporter * reporter);
158 #endif /* _GST_VALIDATE_REPORTER_ */