diff options
| author | George Hazan <ghazan@miranda.im> | 2022-08-03 21:02:36 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2022-08-03 21:02:36 +0300 |
| commit | 5323a782c4e8c42781f22ce2f488962a18f82554 (patch) | |
| tree | f71537197b16f0f8fd0d6937f7120d018d220814 /include/gst/validate | |
| parent | 50acf9d37183f86f6f623aad410003392b0af41f (diff) | |
Jabber: initial version of Jingle support
Diffstat (limited to 'include/gst/validate')
22 files changed, 2683 insertions, 0 deletions
diff --git a/include/gst/validate/gst-validate-bin-monitor.h b/include/gst/validate/gst-validate-bin-monitor.h new file mode 100644 index 0000000000..300161d360 --- /dev/null +++ b/include/gst/validate/gst-validate-bin-monitor.h @@ -0,0 +1,91 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-bin-monitor.h - Validate BinMonitor class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_BIN_MONITOR_H__ +#define __GST_VALIDATE_BIN_MONITOR_H__ + +#include <glib-object.h> +#include <gst/gst.h> +#include <gst/validate/gst-validate-element-monitor.h> +#include <gst/validate/gst-validate-runner.h> +#include <gst/validate/gst-validate-scenario.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_BIN_MONITOR (gst_validate_bin_monitor_get_type ()) +#define GST_IS_VALIDATE_BIN_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_BIN_MONITOR)) +#define GST_IS_VALIDATE_BIN_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_BIN_MONITOR)) +#define GST_VALIDATE_BIN_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_BIN_MONITOR, GstValidateBinMonitorClass)) +#define GST_VALIDATE_BIN_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_BIN_MONITOR, GstValidateBinMonitor)) +#define GST_VALIDATE_BIN_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_BIN_MONITOR, GstValidateBinMonitorClass)) +#define GST_VALIDATE_BIN_MONITOR_CAST(obj) ((GstValidateBinMonitor*)(obj)) +#define GST_VALIDATE_BIN_MONITOR_CLASS_CAST(klass) ((GstValidateBinMonitorClass*)(klass)) +#endif + +typedef struct _GstValidateBinMonitor GstValidateBinMonitor; +typedef struct _GstValidateBinMonitorClass GstValidateBinMonitorClass; + +/** + * GstValidateBinMonitor: + * + * GStreamer Validate BinMonitor class. + * + * Class that wraps a #GstBin for Validate checks + */ +struct _GstValidateBinMonitor { + GstValidateElementMonitor parent; + + GList *element_monitors; + + GstValidateScenario *scenario; + + /*< private >*/ + gulong element_added_id; + gulong element_removed_id; +}; + +/** + * GstValidateBinMonitorClass: + * @parent_class: parent + * + * GStreamer Validate BinMonitor object class. + */ +struct _GstValidateBinMonitorClass { + GstValidateElementMonitorClass parent_class; +}; + +/* normal GObject stuff */ +GST_VALIDATE_API +GType gst_validate_bin_monitor_get_type (void); + +GST_VALIDATE_API GstValidateBinMonitor * +gst_validate_bin_monitor_new (GstBin * bin, + GstValidateRunner * runner, + GstValidateMonitor * parent); + +GST_VALIDATE_API GstValidateScenario * +gst_validate_bin_monitor_get_scenario (GstValidateBinMonitor * monitor); + +G_END_DECLS + +#endif /* __GST_VALIDATE_BIN_MONITOR_H__ */ + diff --git a/include/gst/validate/gst-validate-element-monitor.h b/include/gst/validate/gst-validate-element-monitor.h new file mode 100644 index 0000000000..025153d1f8 --- /dev/null +++ b/include/gst/validate/gst-validate-element-monitor.h @@ -0,0 +1,93 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-element-monitor.h - Validate ElementMonitor class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_ELEMENT_MONITOR_H__ +#define __GST_VALIDATE_ELEMENT_MONITOR_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +#include <gst/validate/gst-validate-monitor.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_ELEMENT_MONITOR (gst_validate_element_monitor_get_type ()) +#define GST_IS_VALIDATE_ELEMENT_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_ELEMENT_MONITOR)) +#define GST_IS_VALIDATE_ELEMENT_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_ELEMENT_MONITOR)) +#define GST_VALIDATE_ELEMENT_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_ELEMENT_MONITOR, GstValidateElementMonitorClass)) +#define GST_VALIDATE_ELEMENT_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_ELEMENT_MONITOR, GstValidateElementMonitor)) +#define GST_VALIDATE_ELEMENT_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_ELEMENT_MONITOR, GstValidateElementMonitorClass)) +#define GST_VALIDATE_ELEMENT_MONITOR_CAST(obj) ((GstValidateElementMonitor*)(obj)) +#define GST_VALIDATE_ELEMENT_MONITOR_CLASS_CAST(klass) ((GstValidateElementMonitorClass*)(klass)) +#endif + +#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_DECODER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_decoder) +#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_ENCODER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_encoder) +#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_DEMUXER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_demuxer) +#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_CONVERTER(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_converter) +#define GST_VALIDATE_ELEMENT_MONITOR_ELEMENT_IS_SINK(m) (GST_VALIDATE_ELEMENT_MONITOR_CAST (m)->is_sink) + +typedef struct _GstValidateElementMonitor GstValidateElementMonitor; +typedef struct _GstValidateElementMonitorClass GstValidateElementMonitorClass; + +/** + * GstValidateElementMonitor: + * + * GStreamer Validate ElementMonitor class. + * + * Class that wraps a #GstElement for Validate checks + */ +struct _GstValidateElementMonitor { + GstValidateMonitor parent; + + /*< private >*/ + gulong pad_added_id; + GList *pad_monitors; + + gboolean is_decoder; + gboolean is_encoder; + gboolean is_demuxer; + gboolean is_converter; + gboolean is_sink; +}; + +/** + * GstValidateElementMonitorClass: + * @parent_class: parent + * + * GStreamer Validate ElementMonitor object class. + */ +struct _GstValidateElementMonitorClass { + GstValidateMonitorClass parent_class; +}; + +/* normal GObject stuff */ +GST_VALIDATE_API +GType gst_validate_element_monitor_get_type (void); + +GST_VALIDATE_API +GstValidateElementMonitor * gst_validate_element_monitor_new (GstElement * element, GstValidateRunner * runner, GstValidateMonitor * parent); + +G_END_DECLS + +#endif /* __GST_VALIDATE_ELEMENT_MONITOR_H__ */ + diff --git a/include/gst/validate/gst-validate-enum-types.h b/include/gst/validate/gst-validate-enum-types.h new file mode 100644 index 0000000000..748aa15732 --- /dev/null +++ b/include/gst/validate/gst-validate-enum-types.h @@ -0,0 +1,47 @@ + +/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ + +#ifndef __GST_ENUM_TYPES_H__ +#define __GST_ENUM_TYPES_H__ + +#include <glib-object.h> +#include <gst/validate/validate.h> +#include <gst/validate/media-descriptor-writer.h> + +G_BEGIN_DECLS + +/* enumerations from "gst-validate-enums.h" */ +GST_VALIDATE_API GType gst_validate_reporting_details_get_type (void); +#define GST_TYPE_VALIDATE_REPORTING_DETAILS (gst_validate_reporting_details_get_type ()) +GST_VALIDATE_API GType gst_validate_verbosity_flags_get_type (void); +#define GST_TYPE_VALIDATE_VERBOSITY_FLAGS (gst_validate_verbosity_flags_get_type ()) +GST_VALIDATE_API GType gst_validate_structure_resolve_variables_flags_get_type (void); +#define GST_TYPE_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_FLAGS (gst_validate_structure_resolve_variables_flags_get_type ()) + +/* enumerations from "gst-validate-report.h" */ +GST_VALIDATE_API GType gst_validate_debug_flags_get_type (void); +#define GST_TYPE_VALIDATE_DEBUG_FLAGS (gst_validate_debug_flags_get_type ()) +GST_VALIDATE_API GType gst_validate_report_level_get_type (void); +#define GST_TYPE_VALIDATE_REPORT_LEVEL (gst_validate_report_level_get_type ()) +GST_VALIDATE_API GType gst_validate_issue_flags_get_type (void); +#define GST_TYPE_VALIDATE_ISSUE_FLAGS (gst_validate_issue_flags_get_type ()) + +/* enumerations from "gst-validate-reporter.h" */ +GST_VALIDATE_API GType gst_validate_interception_return_get_type (void); +#define GST_TYPE_VALIDATE_INTERCEPTION_RETURN (gst_validate_interception_return_get_type ()) + +/* enumerations from "gst-validate-scenario.h" */ +GST_VALIDATE_API GType gst_validate_action_return_get_type (void); +#define GST_TYPE_VALIDATE_ACTION_RETURN (gst_validate_action_return_get_type ()) +GST_VALIDATE_API GType gst_validate_action_type_flags_get_type (void); +#define GST_TYPE_VALIDATE_ACTION_TYPE_FLAGS (gst_validate_action_type_flags_get_type ()) + +/* enumerations from "media-descriptor-writer.h" */ +GST_VALIDATE_API GType gst_validate_media_descriptor_writer_flags_get_type (void); +#define GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS (gst_validate_media_descriptor_writer_flags_get_type ()) +G_END_DECLS + +#endif /* __GST_ENUM_TYPES_H__ */ + +/* Generated data ends here */ + diff --git a/include/gst/validate/gst-validate-enums.h b/include/gst/validate/gst-validate-enums.h new file mode 100644 index 0000000000..3dbf994818 --- /dev/null +++ b/include/gst/validate/gst-validate-enums.h @@ -0,0 +1,116 @@ +/* GStreamer + * Copyright (C) 2014 Mathieu Duponchelle <mathieu.duponchelle@collabora.com> + * + * gst-validate-enums.h - Validate constants. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_ENUMS_H__ +#define __GST_VALIDATE_ENUMS_H__ + +/** + * SECTION: gst-validate-enums.h + * @title: GstValidate enums + */ + +/** + * GstValidateReportingDetails: + * @GST_VALIDATE_SHOW_NONE: No debugging level specified or desired. Used to deactivate + * debugging output. + * @GST_VALIDATE_SHOW_SMART: Sythetic for not fatal issues and detailed for + * others + * @GST_VALIDATE_SHOW_SYNTHETIC: Summary of the issues found, with no + * details. + * @GST_VALIDATE_SHOW_SUBCHAIN: If set as the default level, similar + * issues can be reported multiple times for different subchains. + * If set as the level for a particular object (my_object:subchain), validate + * will report the issues where the object is the first to report an issue for + * a subchain. + * @GST_VALIDATE_SHOW_MONITOR: If set as the default level, all the + * distinct issues for all the monitors will be reported. + * If set as the level for a particular object, all the distinct issues for this object + * will be reported. + * Note that if the same issue happens twice on the same object, up until this + * level that issue is only reported once. + * @GST_VALIDATE_SHOW_ALL: All the issues will be reported, even those + * that repeat themselves inside the same object. This can be *very* verbose if + * set globally. + * @GST_VALIDATE_SHOW_UNKNOWN: No reporting level known, + * reporting will default to the global reporting level. + * + * Setting the reporting level allows to control the way issues are reported + * when calling #gst_validate_runner_printf. + * + * The reporting level can be set through the "GST_VALIDATE_REPORTING_DETAILS" + * environment variable, as a comma-separated list of (optional) object categories / names + * and levels. No object category / name sets the global level. + * + * Examples: GST_VALIDATE_REPORTING_DETAILS=synthetic,h264parse:all + * GST_VALIDATE_REPORTING_DETAILS=none,h264parse::sink_0:synthetic + */ +typedef enum { + GST_VALIDATE_SHOW_UNKNOWN = 0, + GST_VALIDATE_SHOW_NONE = 1, + GST_VALIDATE_SHOW_SYNTHETIC = 2, + GST_VALIDATE_SHOW_SUBCHAIN = 3, + GST_VALIDATE_SHOW_MONITOR = 4, + GST_VALIDATE_SHOW_ALL = 5, + GST_VALIDATE_SHOW_SMART = 6, + GST_VALIDATE_SHOW_COUNT +} GstValidateReportingDetails; + +/** + * GST_VALIDATE_SHOW_DEFAULT: + * + * Defines the default reporting level to be used with gst-validate. It is normally + * set to #GST_VALIDATE_SHOW_SYNTHETIC so only a synthetic report + * gets printed. + * As it can be configured at compile time, developer builds may chose to + * override that though. + */ +#ifndef GST_VALIDATE_SHOW_DEFAULT +#define GST_VALIDATE_SHOW_DEFAULT GST_VALIDATE_SHOW_SMART +#endif + +/** + * GstValidateVerbosityFlags: + * + * Defines the level of verbosity of -validate (ie, printing on stdout). + */ +typedef enum +{ + GST_VALIDATE_VERBOSITY_NONE = 0, + GST_VALIDATE_VERBOSITY_POSITION = 1 << 1, + GST_VALIDATE_VERBOSITY_MESSAGES = 1 << 2, + GST_VALIDATE_VERBOSITY_PROPS_CHANGES = 1 << 3, + GST_VALIDATE_VERBOSITY_NEW_ELEMENTS = 1 << 4, + GST_VALIDATE_VERBOSITY_ALL = GST_VALIDATE_VERBOSITY_POSITION | GST_VALIDATE_VERBOSITY_MESSAGES | GST_VALIDATE_VERBOSITY_PROPS_CHANGES | GST_VALIDATE_VERBOSITY_NEW_ELEMENTS +} GstValidateVerbosityFlags; + +/** + * GstValidateStructureResolveVariablesFlags: + * + * Since: 1.20 + */ +typedef enum { + GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_ALL = 0, + GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_LOCAL_ONLY = 1 << 0, + GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_FAILURE = 1 << 1, + GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_EXPRESSION = 1 << 1, +} GstValidateStructureResolveVariablesFlags; + +#endif /* __GST_VALIDATE_ENUMS_H__ */ diff --git a/include/gst/validate/gst-validate-media-info.h b/include/gst/validate/gst-validate-media-info.h new file mode 100644 index 0000000000..9df9bf1fe6 --- /dev/null +++ b/include/gst/validate/gst-validate-media-info.h @@ -0,0 +1,89 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-media-info.h - Media information structure + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_MEDIA_INFO_H__ +#define __GST_VALIDATE_MEDIA_INFO_H__ + +#include <gst/gst.h> +#include <gst/pbutils/pbutils.h> +#include <gst/validate/validate-prelude.h> + +G_BEGIN_DECLS + +typedef struct _GstValidateMediaInfo GstValidateMediaInfo; +typedef struct _GstValidateStreamInfo GstValidateStreamInfo; + +/** + * GstValidateMediaInfo: + * + * GStreamer Validate MediaInfo struct. + * + * Stores extracted information about a media + */ +struct _GstValidateMediaInfo { + + /* <File checking data> */ + /* Value for the expected total duration of the file in nanosecs + * Set to GST_CLOCK_TIME_NONE if it shouldn't be tested */ + GstClockTime duration; + gboolean is_image; + + /* Expected file_size, set to 0 to skip test */ + guint64 file_size; + + gboolean seekable; + + gchar *playback_error; + gchar *reverse_playback_error; + gchar *track_switch_error; + + gchar *uri; + + gboolean discover_only; + + GstValidateStreamInfo *stream_info; +}; + +GST_VALIDATE_API +void gst_validate_media_info_init (GstValidateMediaInfo * mi); +GST_VALIDATE_API +void gst_validate_media_info_clear (GstValidateMediaInfo * mi); +GST_VALIDATE_API +void gst_validate_media_info_free (GstValidateMediaInfo * mi); + +GST_VALIDATE_API +gchar * gst_validate_media_info_to_string (GstValidateMediaInfo * mi, gsize * length); +GST_VALIDATE_API +gboolean gst_validate_media_info_save (GstValidateMediaInfo * mi, const gchar * path, GError ** err); +GST_VALIDATE_API +GstValidateMediaInfo * gst_validate_media_info_load (const gchar * path, GError ** err); + +GST_VALIDATE_API +gboolean gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi, const gchar * uri, + gboolean discover_only, GError ** err); + +GST_VALIDATE_API +gboolean gst_validate_media_info_compare (GstValidateMediaInfo * expected, GstValidateMediaInfo * extracted); + +G_END_DECLS + +#endif /* __GST_VALIDATE_MEDIA_INFO_H__ */ + diff --git a/include/gst/validate/gst-validate-monitor-factory.h b/include/gst/validate/gst-validate-monitor-factory.h new file mode 100644 index 0000000000..24fe9cb788 --- /dev/null +++ b/include/gst/validate/gst-validate-monitor-factory.h @@ -0,0 +1,39 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-monitor-factory.h - Validate Element monitors factory utility functions + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_MONITOR_FACTORY_H__ +#define __GST_VALIDATE_MONITOR_FACTORY_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +#include <gst/validate/gst-validate-monitor.h> +#include <gst/validate/gst-validate-runner.h> + +G_BEGIN_DECLS + +GST_VALIDATE_API +GstValidateMonitor * gst_validate_monitor_factory_create (GstObject * target, GstValidateRunner * runner, GstValidateMonitor * parent); + +G_END_DECLS + +#endif /* __GST_VALIDATE_MONITOR_FACTORY_H__ */ + diff --git a/include/gst/validate/gst-validate-monitor.h b/include/gst/validate/gst-validate-monitor.h new file mode 100644 index 0000000000..2964705f23 --- /dev/null +++ b/include/gst/validate/gst-validate-monitor.h @@ -0,0 +1,142 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-monitor.h - Validate Monitor abstract base class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_MONITOR_H__ +#define __GST_VALIDATE_MONITOR_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +typedef struct _GstValidateMonitor GstValidateMonitor; +typedef struct _GstValidateMonitorClass GstValidateMonitorClass; + +#include <gst/validate/gst-validate-report.h> +#include <gst/validate/gst-validate-reporter.h> +#include <gst/validate/gst-validate-runner.h> +#include <gst/validate/gst-validate-override.h> +#include <gst/validate/media-descriptor-parser.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_MONITOR (gst_validate_monitor_get_type ()) +#define GST_IS_VALIDATE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_MONITOR)) +#define GST_IS_VALIDATE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_MONITOR)) +#define GST_VALIDATE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_MONITOR, GstValidateMonitorClass)) +#define GST_VALIDATE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_MONITOR, GstValidateMonitor)) +#define GST_VALIDATE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_MONITOR, GstValidateMonitorClass)) +#define GST_VALIDATE_MONITOR_CAST(obj) ((GstValidateMonitor*)(obj)) +#define GST_VALIDATE_MONITOR_CLASS_CAST(klass) ((GstValidateMonitorClass*)(klass)) +#endif + +#define GST_VALIDATE_MONITOR_GET_PARENT(m) (GST_VALIDATE_MONITOR_CAST (m)->parent) + +#define GST_VALIDATE_MONITOR_LOCK(m) \ + G_STMT_START { \ + GST_LOG_OBJECT (m, "About to lock %p", &GST_VALIDATE_MONITOR_CAST(m)->mutex); \ + (g_mutex_lock (&GST_VALIDATE_MONITOR_CAST(m)->mutex)); \ + GST_LOG_OBJECT (m, "Acquired lock %p", &GST_VALIDATE_MONITOR_CAST(m)->mutex); \ + } G_STMT_END + +#define GST_VALIDATE_MONITOR_UNLOCK(m) \ + G_STMT_START { \ + GST_LOG_OBJECT (m, "About to unlock %p", &GST_VALIDATE_MONITOR_CAST(m)->mutex); \ + (g_mutex_unlock (&GST_VALIDATE_MONITOR_CAST(m)->mutex)); \ + GST_LOG_OBJECT (m, "unlocked %p", &GST_VALIDATE_MONITOR_CAST(m)->mutex); \ + } G_STMT_END + +#define GST_VALIDATE_MONITOR_OVERRIDES_LOCK(m) g_mutex_lock (&GST_VALIDATE_MONITOR_CAST (m)->overrides_mutex) +#define GST_VALIDATE_MONITOR_OVERRIDES_UNLOCK(m) g_mutex_unlock (&GST_VALIDATE_MONITOR_CAST (m)->overrides_mutex) +#define GST_VALIDATE_MONITOR_OVERRIDES(m) (GST_VALIDATE_MONITOR_CAST (m)->overrides) + +/* #else TODO Implemen no variadic macros, use inline, + * Problem being: + * GST_VALIDATE_REPORT_LEVEL_ ## status + * GST_VALIDATE_AREA_ ## area ## _ ## subarea + */ + +/** + * GstValidateMonitor: + * + * GStreamer Validate Monitor class. + * + * Class that wraps a #GObject for Validate checks + */ +struct _GstValidateMonitor { + GstObject object; + + GWeakRef target; + GWeakRef pipeline; + GMutex mutex; + gchar *target_name; + + GstValidateMonitor *parent; + + GMutex overrides_mutex; + GQueue overrides; + GstValidateMediaDescriptor *media_descriptor; + + GstValidateReportingDetails level; + + /*< private >*/ + GHashTable *reports; + + GstValidateVerbosityFlags verbosity; +}; + +/** + * GstValidateMonitorClass: + * @parent_class: parent + * + * GStreamer Validate Monitor object class. + */ +struct _GstValidateMonitorClass { + GstObjectClass parent_class; + + gboolean (* setup) (GstValidateMonitor * monitor); + GstElement *(* get_element) (GstValidateMonitor * monitor); + void (*set_media_descriptor) (GstValidateMonitor * monitor, + GstValidateMediaDescriptor * media_descriptor); +}; + +/* normal GObject stuff */ +GST_VALIDATE_API +GType gst_validate_monitor_get_type (void); + +GST_VALIDATE_API +void gst_validate_monitor_attach_override (GstValidateMonitor * monitor, + GstValidateOverride * override); + +GST_VALIDATE_API +GstElement * gst_validate_monitor_get_element (GstValidateMonitor * monitor); +GST_VALIDATE_API +gchar * gst_validate_monitor_get_element_name (GstValidateMonitor * monitor); +GST_VALIDATE_API +void gst_validate_monitor_set_media_descriptor (GstValidateMonitor * monitor, + GstValidateMediaDescriptor *media_descriptor); +GST_VALIDATE_API +GstPipeline * gst_validate_monitor_get_pipeline (GstValidateMonitor * monitor); +GST_VALIDATE_API +GstObject * gst_validate_monitor_get_target (GstValidateMonitor * monitor); +G_END_DECLS + +#endif /* __GST_VALIDATE_MONITOR_H__ */ + diff --git a/include/gst/validate/gst-validate-override-registry.h b/include/gst/validate/gst-validate-override-registry.h new file mode 100644 index 0000000000..7dfcdb318a --- /dev/null +++ b/include/gst/validate/gst-validate-override-registry.h @@ -0,0 +1,66 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-override-registry.h - Validate Override registry + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_OVERRIDE_REGISTRY_H__ +#define __GST_VALIDATE_OVERRIDE_REGISTRY_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +#include <gst/validate/gst-validate-report.h> +#include <gst/validate/gst-validate-monitor.h> +#include <gst/validate/gst-validate-override.h> + +G_BEGIN_DECLS + +typedef struct { + GMutex mutex; + + GQueue name_overrides; + GQueue gtype_overrides; + GQueue klass_overrides; +} GstValidateOverrideRegistry; + +GST_VALIDATE_API +GstValidateOverrideRegistry * gst_validate_override_registry_get (void); + +GST_VALIDATE_API GList * +gst_validate_override_registry_get_override_for_names (GstValidateOverrideRegistry *reg, + const gchar *name, ...); +GST_VALIDATE_API GList * +gst_validate_override_registry_get_override_list (GstValidateOverrideRegistry *registry); +GST_VALIDATE_API +void gst_validate_override_register_by_name (const gchar * name, GstValidateOverride * override); +GST_VALIDATE_API +void gst_validate_override_register_by_type (GType gtype, GstValidateOverride * override); +GST_VALIDATE_API +void gst_validate_override_register_by_klass (const gchar * klass, GstValidateOverride * override); + +GST_VALIDATE_API +void gst_validate_override_registry_attach_overrides (GstValidateMonitor * monitor); + +GST_VALIDATE_API +int gst_validate_override_registry_preload (void); + +G_END_DECLS + +#endif /* __GST_VALIDATE_OVERRIDE_REGISTRY_H__ */ + diff --git a/include/gst/validate/gst-validate-override.h b/include/gst/validate/gst-validate-override.h new file mode 100644 index 0000000000..93eef630fd --- /dev/null +++ b/include/gst/validate/gst-validate-override.h @@ -0,0 +1,141 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-override.h - Validate Override that allows customizing Validate behavior + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_OVERRIDE_H__ +#define __GST_VALIDATE_OVERRIDE_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +typedef struct _GstValidateOverride GstValidateOverride; +typedef struct _GstValidateOverrideClass GstValidateOverrideClass; +typedef struct _GstValidateOverridePrivate GstValidateOverridePrivate; + + +#include <gst/validate/gst-validate-report.h> +#include <gst/validate/gst-validate-monitor.h> + +G_BEGIN_DECLS + +typedef void (*GstValidateOverrideBufferHandler)(GstValidateOverride * override, + GstValidateMonitor * pad_monitor, GstBuffer * buffer); +typedef void (*GstValidateOverrideEventHandler)(GstValidateOverride * override, + GstValidateMonitor * pad_monitor, GstEvent * event); +typedef void (*GstValidateOverrideQueryHandler)(GstValidateOverride * override, + GstValidateMonitor * pad_monitor, GstQuery * query); +typedef void (*GstValidateOverrideGetCapsHandler)(GstValidateOverride * override, + GstValidateMonitor * pad_monitor, GstCaps * caps); +typedef void (*GstValidateOverrideSetCapsHandler)(GstValidateOverride * override, + GstValidateMonitor * pad_monitor, GstCaps * caps); +typedef void (*GstValidateOverrideElementAddedHandler)(GstValidateOverride * override, + GstValidateMonitor * bin_monitor, GstElement * new_child); + +struct _GstValidateOverrideClass +{ + /*<private>*/ + GstObjectClass parent_class; + + gboolean (*can_attach)(GstValidateOverride * override, + GstValidateMonitor * monitor); + + void (*attached)(GstValidateOverride * override); +}; + +struct _GstValidateOverride +{ + GstObject parent; + + GstValidateOverrideBufferHandler buffer_handler; + GstValidateOverrideEventHandler event_handler; + GstValidateOverrideQueryHandler query_handler; + GstValidateOverrideBufferHandler buffer_probe_handler; + GstValidateOverrideGetCapsHandler getcaps_handler; + GstValidateOverrideSetCapsHandler setcaps_handler; + GstValidateOverrideElementAddedHandler element_added_handler; + + /*<private>*/ + GstValidateOverridePrivate *priv; +}; + +GST_VALIDATE_API +GType gst_validate_override_get_type (void) G_GNUC_CONST; + +/* TYPE MACROS */ +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_OVERRIDE (gst_validate_override_get_type ()) +#define GST_VALIDATE_OVERRIDE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_VALIDATE_OVERRIDE, GstValidateOverride)) +#define GST_VALIDATE_OVERRIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VALIDATE_OVERRIDE, GstValidateOverrideClass)) +#define GST_IS_VALIDATE_OVERRIDE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VALIDATE_OVERRIDE)) +#define GST_IS_VALIDATE_OVERRIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VALIDATE_OVERRIDE)) +#define GST_VALIDATE_OVERRIDE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_OVERRIDE, GstValidateOverrideClass)) +#endif + +GST_VALIDATE_API +GstValidateOverride * gst_validate_override_new (void); + +void gst_validate_override_free (GstValidateOverride * override); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstValidateOverride, gst_validate_override_free) + +GST_VALIDATE_API +void gst_validate_override_change_severity (GstValidateOverride * override, GstValidateIssueId issue_id, GstValidateReportLevel new_level); +GST_VALIDATE_API +GstValidateReportLevel gst_validate_override_get_severity (GstValidateOverride * override, GstValidateIssueId issue_id, GstValidateReportLevel default_level); + +GST_VALIDATE_API +void gst_validate_override_event_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstEvent * event); +GST_VALIDATE_API +void gst_validate_override_buffer_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstBuffer * buffer); +GST_VALIDATE_API +void gst_validate_override_query_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstQuery * query); +GST_VALIDATE_API +void gst_validate_override_buffer_probe_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstBuffer * buffer); +GST_VALIDATE_API +void gst_validate_override_getcaps_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstCaps * caps); +GST_VALIDATE_API +void gst_validate_override_setcaps_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstCaps * caps); + +GST_VALIDATE_API +void gst_validate_override_set_event_handler (GstValidateOverride * override, GstValidateOverrideEventHandler handler); +GST_VALIDATE_API +void gst_validate_override_set_buffer_handler (GstValidateOverride * override, GstValidateOverrideBufferHandler handler); +GST_VALIDATE_API +void gst_validate_override_set_query_handler (GstValidateOverride * override, GstValidateOverrideQueryHandler handler); +GST_VALIDATE_API +void gst_validate_override_set_buffer_probe_handler (GstValidateOverride * override, GstValidateOverrideBufferHandler handler); +GST_VALIDATE_API +void gst_validate_override_set_getcaps_handler (GstValidateOverride * override, GstValidateOverrideGetCapsHandler handler); +GST_VALIDATE_API +void gst_validate_override_set_setcaps_handler (GstValidateOverride * override, GstValidateOverrideSetCapsHandler handler); +GST_VALIDATE_API +void gst_validate_override_element_added_handler (GstValidateOverride * override, GstValidateMonitor * monitor, GstElement * child); +GST_VALIDATE_API +void gst_validate_override_set_element_added_handler (GstValidateOverride * override, GstValidateOverrideElementAddedHandler func); + +GST_VALIDATE_API +gboolean gst_validate_override_can_attach (GstValidateOverride * override, GstValidateMonitor *monitor); + +GST_VALIDATE_API +void gst_validate_override_attached (GstValidateOverride * override); + +G_END_DECLS + +#endif /* #ifndef __GST_VALIDATE_OVERRIDE_H__*/ diff --git a/include/gst/validate/gst-validate-pad-monitor.h b/include/gst/validate/gst-validate-pad-monitor.h new file mode 100644 index 0000000000..22c3479bcb --- /dev/null +++ b/include/gst/validate/gst-validate-pad-monitor.h @@ -0,0 +1,156 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-pad-monitor.h - Validate PadMonitor class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_PAD_MONITOR_H__ +#define __GST_VALIDATE_PAD_MONITOR_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +typedef struct _GstValidatePadMonitor GstValidatePadMonitor; +typedef struct _GstValidatePadMonitorClass GstValidatePadMonitorClass; +typedef struct _GstValidatePadSeekData GstValidatePadSeekData; + +#include <gst/validate/gst-validate-monitor.h> +#include <gst/validate/media-descriptor-parser.h> +#include <gst/validate/gst-validate-element-monitor.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_PAD_MONITOR (gst_validate_pad_monitor_get_type ()) +#define GST_IS_VALIDATE_PAD_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_PAD_MONITOR)) +#define GST_IS_VALIDATE_PAD_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_PAD_MONITOR)) +#define GST_VALIDATE_PAD_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_PAD_MONITOR, GstValidatePadMonitorClass)) +#define GST_VALIDATE_PAD_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_PAD_MONITOR, GstValidatePadMonitor)) +#define GST_VALIDATE_PAD_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_PAD_MONITOR, GstValidatePadMonitorClass)) +#define GST_VALIDATE_PAD_MONITOR_CAST(obj) ((GstValidatePadMonitor*)(obj)) +#define GST_VALIDATE_PAD_MONITOR_CLASS_CAST(klass) ((GstValidatePadMonitorClass*)(klass)) +#endif + +/** + * GstValidatePadMonitor: + * + * GStreamer Validate PadMonitor class. + * + * Class that wraps a #GstPad for Validate checks + */ +struct _GstValidatePadMonitor { + GstValidateMonitor parent; + + gboolean setup; + + GstPadChainFunction chain_func; + GstPadEventFunction event_func; + GstPadEventFullFunction event_full_func; + GstPadQueryFunction query_func; + GstPadActivateModeFunction activatemode_func; + GstPadGetRangeFunction get_range_func; + + gulong pad_probe_id; + + /*< private >*/ + /* Last caps pushed/received */ + GstCaps *last_caps; + gboolean caps_is_audio; + gboolean caps_is_video; + gboolean caps_is_raw; + + /* FIXME : Let's migrate all those booleans into a 32 (or 64) bit flag */ + gboolean first_buffer; + + gboolean has_segment; + gboolean is_eos; + + gboolean pending_flush_stop; + guint32 pending_newsegment_seqnum; + guint32 pending_eos_seqnum; + + /* List of GstValidatePadSeekData containing pending/current seeks */ + GList *seeks; + GstValidatePadSeekData *current_seek; + + /* Whether the next buffer should have a DISCONT flag on it, because + * it's the first one, or follows a SEGMENT and/or a FLUSH */ + gboolean pending_buffer_discont; + + GstEvent *expected_segment; + GPtrArray *serialized_events; + GList *expired_events; + + GstStructure *pending_setcaps_fields; + + GstCaps * last_refused_caps; + GstCaps * last_query_filter; + GstCaps * last_query_res; + + /* tracked data */ + GstSegment segment; + GstClockTime current_timestamp; + GstClockTime current_duration; + + /* Stores the timestamp range of data that has flown through + * this pad by using TIMESTAMP and TIMESTAMP+DURATION from + * incomming buffers. Every time a buffer is pushed, this range + * is extended. + * + * When a buffer is pushed, the timestamp range is checked against + * the outgoing timestamp to check it is in the received boundaries. + */ + GstClockTime timestamp_range_start; + GstClockTime timestamp_range_end; + + /* GstValidateMediaCheck related fields */ + GList *all_bufs; + /* The GstBuffer that should arrive next in a GList */ + GList *current_buf; + gboolean check_buffers; + + /* 'min-buffer-frequency' config check */ + gdouble min_buf_freq; + gint buffers_pushed; + gint last_buffers_pushed; + GstClockTime min_buf_freq_interval_ts; + GstClockTime min_buf_freq_first_buffer_ts; + GstClockTime min_buf_freq_start; +}; + +/** + * GstValidatePadMonitorClass: + * @parent_class: parent + * + * GStreamer Validate PadMonitor object class. + */ +struct _GstValidatePadMonitorClass { + GstValidateMonitorClass parent_class; +}; + +/* normal GObject stuff */ +GST_VALIDATE_API +GType gst_validate_pad_monitor_get_type (void); + +GST_VALIDATE_API +GstValidatePadMonitor * gst_validate_pad_monitor_new (GstPad * pad, GstValidateRunner * runner, GstValidateElementMonitor *element_monitor); + +G_END_DECLS + +#endif /* __GST_VALIDATE_PAD_MONITOR_H__ */ + diff --git a/include/gst/validate/gst-validate-pipeline-monitor.h b/include/gst/validate/gst-validate-pipeline-monitor.h new file mode 100644 index 0000000000..37c88bcc57 --- /dev/null +++ b/include/gst/validate/gst-validate-pipeline-monitor.h @@ -0,0 +1,98 @@ +/* GStreamer + * Copyright (C) 2014 Thibault Saunier <tsaunier@gnome.org> + * + * gst-validate-pipeline-monitor.h - Validate PipelineMonitor class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_PIPELINE_MONITOR_H__ +#define __GST_VALIDATE_PIPELINE_MONITOR_H__ + +#include <glib-object.h> +#include <gst/gst.h> +#include <gst/validate/gst-validate-bin-monitor.h> +#include <gst/validate/gst-validate-runner.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_PIPELINE_MONITOR (gst_validate_pipeline_monitor_get_type ()) +#define GST_IS_VALIDATE_PIPELINE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_PIPELINE_MONITOR)) +#define GST_IS_VALIDATE_PIPELINE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_PIPELINE_MONITOR)) +#define GST_VALIDATE_PIPELINE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_PIPELINE_MONITOR, GstValidatePipelineMonitorClass)) +#define GST_VALIDATE_PIPELINE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_PIPELINE_MONITOR, GstValidatePipelineMonitor)) +#define GST_VALIDATE_PIPELINE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_PIPELINE_MONITOR, GstValidatePipelineMonitorClass)) +#define GST_VALIDATE_PIPELINE_MONITOR_CAST(obj) ((GstValidatePipelineMonitor*)(obj)) +#define GST_VALIDATE_PIPELINE_MONITOR_CLASS_CAST(klass) ((GstValidatePipelineMonitorClass*)(klass)) +#endif + +#define GST_VALIDATE_PIPELINE_MONITOR_GET_PIPELINE(m) (GST_PIPELINE_CAST (GST_VALIDATE_ELEMENT_MONITOR_GET_ELEMENT (m))) + +typedef struct _GstValidatePipelineMonitor GstValidatePipelineMonitor; +typedef struct _GstValidatePipelineMonitorClass GstValidatePipelineMonitorClass; + +/** + * GstValidatePipelineMonitor: + * + * GStreamer Validate PipelineMonitor class. + * + * Class that wraps a #GstPipeline for Validate checks + */ +struct _GstValidatePipelineMonitor { + GstValidateBinMonitor parent; + + /*< private >*/ + gulong element_added_id; + guint print_pos_srcid; + gboolean buffering; + gboolean got_error; + + /* TRUE if monitoring a playbin2 pipeline */ + gboolean is_playbin; + /* TRUE if monitoring a playbin3 pipeline */ + gboolean is_playbin3; + + /* Latest collection received from GST_MESSAGE_STREAM_COLLECTION */ + GstStreamCollection *stream_collection; + /* Latest GstStream received from GST_MESSAGE_STREAMS_SELECTED */ + GList *streams_selected; + + gulong deep_notify_id; +}; + +/** + * GstValidatePipelineMonitorClass: + * @parent_class: parent + * + * GStreamer Validate PipelineMonitor object class. + */ +struct _GstValidatePipelineMonitorClass { + GstValidateBinMonitorClass parent_class; +}; + +/* normal GObject stuff */ +GST_VALIDATE_API +GType gst_validate_pipeline_monitor_get_type (void); + +GST_VALIDATE_API +GstValidatePipelineMonitor * gst_validate_pipeline_monitor_new (GstPipeline * pipeline, + GstValidateRunner * runner, GstValidateMonitor * parent); + +G_END_DECLS + +#endif /* __GST_VALIDATE_PIPELINE_MONITOR_H__ */ + diff --git a/include/gst/validate/gst-validate-report.h b/include/gst/validate/gst-validate-report.h new file mode 100644 index 0000000000..c16a420e71 --- /dev/null +++ b/include/gst/validate/gst-validate-report.h @@ -0,0 +1,336 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-monitor-report.h - Validate Element report structures and functions + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_REPORT_H__ +#define __GST_VALIDATE_REPORT_H__ + +#include <glib-object.h> + +typedef struct _GstValidateReport GstValidateReport; +typedef guintptr GstValidateIssueId; + +#include <gst/gst.h> +#include <gst/validate/validate-prelude.h> +#include <gst/validate/gst-validate-reporter.h> +#include "gst-validate-types.h" + +G_BEGIN_DECLS + +GST_VALIDATE_API +GType gst_validate_report_get_type (void); +#define GST_TYPE_VALIDATE_REPORT (gst_validate_report_get_type ()) + +/** + * GstValidateDebugFlags: + * GST_VALIDATE_FATAL_DEFAULT: + * GST_VALIDATE_FATAL_ISSUES: + * GST_VALIDATE_FATAL_WARNINGS: + * GST_VALIDATE_FATAL_CRITICALS: + * GST_VALIDATE_PRINT_ISSUES: + * GST_VALIDATE_PRINT_WARNINGS: + * GST_VALIDATE_PRINT_CRITICALS: + */ +typedef enum { + GST_VALIDATE_FATAL_DEFAULT = 0, + GST_VALIDATE_FATAL_ISSUES = 1 << 0, + GST_VALIDATE_FATAL_WARNINGS = 1 << 1, + GST_VALIDATE_FATAL_CRITICALS = 1 << 2, + GST_VALIDATE_PRINT_ISSUES = 1 << 3, + GST_VALIDATE_PRINT_WARNINGS = 1 << 4, + GST_VALIDATE_PRINT_CRITICALS = 1 << 5 +} GstValidateDebugFlags; + +/** + * GstValidateReportLevel: + */ +typedef enum { + GST_VALIDATE_REPORT_LEVEL_CRITICAL, + GST_VALIDATE_REPORT_LEVEL_WARNING, + GST_VALIDATE_REPORT_LEVEL_ISSUE, + GST_VALIDATE_REPORT_LEVEL_IGNORE, + GST_VALIDATE_REPORT_LEVEL_UNKNOWN, + GST_VALIDATE_REPORT_LEVEL_EXPECTED, + GST_VALIDATE_REPORT_LEVEL_NUM_ENTRIES, +} GstValidateReportLevel; + +#define _QUARK g_quark_from_static_string + +#define BUFFER_BEFORE_SEGMENT _QUARK("buffer::before-segment") +#define BUFFER_IS_OUT_OF_SEGMENT _QUARK("buffer::is-out-of-segment") +#define BUFFER_TIMESTAMP_OUT_OF_RECEIVED_RANGE _QUARK("buffer::timestamp-out-of-received-range") +#define WRONG_FLOW_RETURN _QUARK("buffer::wrong-flow-return") +#define BUFFER_AFTER_EOS _QUARK("buffer::after-eos") +#define WRONG_BUFFER _QUARK("buffer::not-expected-one") +#define FLOW_ERROR_WITHOUT_ERROR_MESSAGE _QUARK("buffer::flow-error-without-error-message") +#define BUFFER_MISSING_DISCONT _QUARK("buffer::missing-discont") + +#define PULL_RANGE_FROM_WRONG_THREAD _QUARK("threading::pull-range-from-wrong-thread") + +#define CAPS_IS_MISSING_FIELD _QUARK("caps::is-missing-field") +#define CAPS_FIELD_HAS_BAD_TYPE _QUARK("caps::field-has-bad-type") +#define CAPS_EXPECTED_FIELD_NOT_FOUND _QUARK("caps::expected-field-not-found") +#define GET_CAPS_NOT_PROXYING_FIELDS _QUARK("caps::not-proxying-fields") +#define CAPS_FIELD_UNEXPECTED_VALUE _QUARK("caps::field-unexpected-value") + +#define EVENT_NEWSEGMENT_NOT_PUSHED _QUARK("event::newsegment-not-pushed") +#define SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME _QUARK("event::serialized-event-wasnt-pushed-in-time") + +#define EOS_HAS_WRONG_SEQNUM _QUARK("event::eos-has-wrong-seqnum") +#define FLUSH_START_HAS_WRONG_SEQNUM _QUARK("event::flush-start-has-wrong-seqnum") +#define FLUSH_STOP_HAS_WRONG_SEQNUM _QUARK("event::flush-stop-has-wrong-seqnum") +#define SEGMENT_HAS_WRONG_SEQNUM _QUARK("event::segment-has-wrong-seqnum") +#define SEGMENT_HAS_WRONG_START _QUARK("event::segment-has-wrong-start") + + +#define EVENT_SERIALIZED_OUT_OF_ORDER _QUARK("event::serialized-out-of-order") +#define EVENT_NEW_SEGMENT_MISMATCH _QUARK("event::segment-mismatch") +#define EVENT_FLUSH_START_UNEXPECTED _QUARK("event::flush-start-unexpected") +#define EVENT_FLUSH_STOP_UNEXPECTED _QUARK("event::flush-stop-unexpected") +#define EVENT_CAPS_DUPLICATE _QUARK("event::caps-duplicate") +#define EVENT_SEEK_NOT_HANDLED _QUARK("event::seek-not-handled") +#define EVENT_SEEK_RESULT_POSITION_WRONG _QUARK("event::seek-result-position-wrong") +#define EVENT_SEEK_INVALID_SEQNUM _QUARK("event::seek-invalid_seqnum") +#define EVENT_EOS_WITHOUT_SEGMENT _QUARK("event::eos-without-segment") +#define EVENT_INVALID_SEQNUM _QUARK("event::invalid-seqnum") + +#define STATE_CHANGE_FAILURE _QUARK("state::change-failure") + +#define FILE_NO_STREAM_INFO _QUARK("file-checking::no-stream-info") +#define FILE_NO_STREAM_ID _QUARK("file-checking::no-stream-id") +#define FILE_TAG_DETECTION_INCORRECT _QUARK("file-checking::tag-detection-incorrect") +#define FILE_SIZE_INCORRECT _QUARK("file-checking::size-incorrect") +#define FILE_DURATION_INCORRECT _QUARK("file-checking::duration-incorrect") +#define FILE_SEEKABLE_INCORRECT _QUARK("file-checking::seekable-incorrect") +#define FILE_PROFILE_INCORRECT _QUARK("file-checking::profile-incorrect") +#define FILE_FRAMES_INCORRECT _QUARK("file-checking::frames-incorrect") +#define FILE_SEGMENT_INCORRECT _QUARK("file-checking::segment-incorrect") + +#define ALLOCATION_FAILURE _QUARK("runtime::allocation-failure") +#define MISSING_PLUGIN _QUARK("runtime::missing-plugin") +#define NOT_NEGOTIATED _QUARK("runtime::not-negotiated") +#define WARNING_ON_BUS _QUARK("runtime::warning-on-bus") +#define ERROR_ON_BUS _QUARK("runtime::error-on-bus") + +#define QUERY_POSITION_SUPERIOR_DURATION _QUARK("query::position-superior-duration") +#define QUERY_POSITION_OUT_OF_SEGMENT _QUARK("query::position-out-of-segment") + +#define SCENARIO_NOT_ENDED _QUARK("scenario::not-ended") +#define SCENARIO_FILE_MALFORMED _QUARK("scenario::malformed") +#define SCENARIO_ACTION_EXECUTION_ERROR _QUARK("scenario::execution-error") +#define SCENARIO_ACTION_CHECK_ERROR _QUARK("scenario::check-error") +#define SCENARIO_ACTION_TIMEOUT _QUARK("scenario::action-timeout") +#define SCENARIO_ACTION_EXECUTION_ISSUE _QUARK("scenario::execution-issue") + +#define CONFIG_LATENCY_TOO_HIGH _QUARK("config::latency-too-high") +#define CONFIG_TOO_MANY_BUFFERS_DROPPED _QUARK("config::too-many-buffers-dropped") +#define CONFIG_BUFFER_FREQUENCY_TOO_LOW _QUARK("config::buffer-frequency-too-low") + +#define G_LOG_ISSUE _QUARK("g-log::issue") +#define G_LOG_WARNING _QUARK("g-log::warning") +#define G_LOG_CRITICAL _QUARK("g-log::critical") + +/** + * GstValidateIssueFlags: + * GST_VALIDATE_ISSUE_FLAGS_NONE: No special flags for the issue type + * GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS: Always show all accurences of the issue in full details + * GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE: Do not generate backtrace for the issue type + */ +typedef enum { + GST_VALIDATE_ISSUE_FLAGS_NONE = 0, + GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS = 1 << 0, + GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE = 1 << 1, + + /** + * GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE: + * + * Always generate backtrace, even if not a critical issue + * + * Since: 1.20 + */ + GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE = 1 << 2, +} GstValidateIssueFlags; + +typedef struct { + GstValidateIssueId issue_id; + + /* Summary: one-liner translatable description of the issue */ + gchar *summary; + /* description: multi-line translatable description of: + * * what the issue is (and why it's an issue) + * * what the source problem could be + * * pointers to fixing the issue + */ + gchar *description; + + /* The name of the area of issue + * this one is in */ + gchar *area; + /* The name of the issue type */ + gchar *name; + + /* default_level: The default level of severity for this + * issue. */ + GstValidateReportLevel default_level; + + gint refcount; + + GstValidateIssueFlags flags; + + gpointer _gst_reserved[GST_PADDING]; + +} GstValidateIssue; + +GST_VALIDATE_API +GType gst_validate_issue_get_type (void); + +struct _GstValidateReport { + GstMiniObject mini_object; + + /* issue: The issue this report corresponds to (to get description, summary,...) */ + GstValidateIssue *issue; + + GstValidateReportLevel level; + + /* The reporter that reported the issue (to get names, info, ...) */ + GstValidateReporter *reporter; + + /* timestamp: The time at which this issue happened since + * the process start (to stay in sync with gst logging) */ + GstClockTime timestamp; + + /* message: issue-specific message. Gives more detail on the actual + * issue. Can be NULL */ + gchar *message; + + /* When reporter->intercept_report returns KEEP, the report is not + * added to the runner. It can be added as a "shadow_report" to + * the upstream report, which is tracked by the runner. */ + GMutex shadow_reports_lock; + GstValidateReport *master_report; + GList *shadow_reports; + + /* Lists the reports that were repeated inside the same reporter */ + GList *repeated_reports; + + GstValidateReportingDetails reporting_level; + gchar *reporter_name; + gchar *trace; + gchar *dotfile_name; + + gpointer _gst_reserved[GST_PADDING - 2]; +}; + +void gst_validate_report_add_message (GstValidateReport *report, + const gchar *message); + +#define GST_VALIDATE_ISSUE_FORMAT G_GUINTPTR_FORMAT " (%s) : %s: %s" +#define GST_VALIDATE_ISSUE_ARGS(i) gst_validate_issue_get_id (i), \ + gst_validate_report_level_get_name (i->default_level), \ + i->area, \ + i->summary + +#define GST_VALIDATE_ERROR_REPORT_PRINT_FORMAT GST_TIME_FORMAT " <%s>: %" GST_VALIDATE_ISSUE_FORMAT ": %s" +#define GST_VALIDATE_REPORT_PRINT_ARGS(r) GST_TIME_ARGS (r->timestamp), \ + gst_validate_reporter_get_name (r->reporter), \ + GST_VALIDATE_ISSUE_ARGS (r->issue), \ + r->message +GST_VALIDATE_API +void gst_validate_report_init (void); +GST_VALIDATE_API +GstValidateIssue *gst_validate_issue_from_id (GstValidateIssueId issue_id); +GST_VALIDATE_API +GstValidateIssueId gst_validate_issue_get_id (GstValidateIssue * issue); +GST_VALIDATE_API +void gst_validate_issue_register (GstValidateIssue * issue); +GST_VALIDATE_API +GstValidateIssue *gst_validate_issue_new (GstValidateIssueId issue_id, const gchar * summary, + const gchar * description, + GstValidateReportLevel default_level); +GST_VALIDATE_API +GstValidateIssue* gst_validate_issue_new_full(GstValidateIssueId issue_id, const gchar* summary, + const gchar* description, GstValidateReportLevel default_level, + GstValidateIssueFlags flags); +GST_VALIDATE_API +void gst_validate_issue_set_default_level (GstValidateIssue *issue, + GstValidateReportLevel default_level); + +GST_VALIDATE_API +GstValidateReport *gst_validate_report_new (GstValidateIssue * issue, + GstValidateReporter * reporter, + const gchar * message); +GST_VALIDATE_API +void gst_validate_report_unref (GstValidateReport * report); +GST_VALIDATE_API +GstValidateReport *gst_validate_report_ref (GstValidateReport * report); + +GST_VALIDATE_API +GstValidateIssueId gst_validate_report_get_issue_id (GstValidateReport * report); + +GST_VALIDATE_API +gboolean gst_validate_report_check_abort (GstValidateReport * report); +GST_VALIDATE_API +void gst_validate_report_printf (GstValidateReport * report); +GST_VALIDATE_API +void gst_validate_report_print_level (GstValidateReport *report); +GST_VALIDATE_API +void gst_validate_report_print_detected_on (GstValidateReport *report); +GST_VALIDATE_API +void gst_validate_report_print_details (GstValidateReport *report); +GST_VALIDATE_API +void gst_validate_report_print_description (GstValidateReport *report); + +GST_VALIDATE_API +const gchar * gst_validate_report_level_get_name (GstValidateReportLevel level); + +GST_VALIDATE_API +void gst_validate_printf (gpointer source, + const gchar * format, + ...) G_GNUC_PRINTF (2, 3) G_GNUC_NO_INSTRUMENT; +GST_VALIDATE_API +void gst_validate_print_action (GstValidateAction *action, const gchar * message); +GST_VALIDATE_API +void gst_validate_printf_valist (gpointer source, + const gchar * format, + va_list args) G_GNUC_PRINTF (2, 0) G_GNUC_NO_INSTRUMENT; +GST_VALIDATE_API +gboolean gst_validate_report_should_print (GstValidateReport * report); +GST_VALIDATE_API +gboolean gst_validate_report_set_master_report(GstValidateReport *report, GstValidateReport *master_report); +GST_VALIDATE_API +void gst_validate_report_set_reporting_level (GstValidateReport *report, GstValidateReportingDetails level); +GST_VALIDATE_API +void gst_validate_report_add_repeated_report (GstValidateReport *report, GstValidateReport *repeated_report); +GST_VALIDATE_API +GstValidateReportLevel gst_validate_report_level_from_name (const gchar *level_name); +GST_VALIDATE_API +void gst_validate_print_position(GstClockTime position, GstClockTime duration, gdouble rate, gchar* extra_info); +GST_VALIDATE_API void gst_validate_print_issues (void); + +GST_VALIDATE_API +void gst_validate_error_structure (gpointer action, const gchar* format, ...) G_GNUC_PRINTF (2, 3); +GST_VALIDATE_API +void gst_validate_abort (const gchar * format, ...) G_GNUC_PRINTF (1, 2); +GST_VALIDATE_API +void gst_validate_skip_test (const gchar* format, ...); +G_END_DECLS + +#endif /* __GST_VALIDATE_REPORT_H__ */ + diff --git a/include/gst/validate/gst-validate-reporter.h b/include/gst/validate/gst-validate-reporter.h new file mode 100644 index 0000000000..c4e6180368 --- /dev/null +++ b/include/gst/validate/gst-validate-reporter.h @@ -0,0 +1,158 @@ +/* GStreamer + * + * Copyright (C) 2013 Thibault Saunier <thibault.saunier@collabora.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef _GST_VALIDATE_REPORTER_ +#define _GST_VALIDATE_REPORTER_ + +typedef struct _GstValidateReporter GstValidateReporter; +typedef struct _GstValidateReporterInterface GstValidateReporterInterface; + +#include <glib-object.h> +#include <gst/validate/validate-prelude.h> +#include <gst/validate/gst-validate-report.h> +#include <gst/validate/gst-validate-runner.h> +#include <gst/validate/gst-validate-enums.h> +#include <gst/validate/gst-validate-scenario.h> + +G_BEGIN_DECLS + +/* GstValidateReporter interface declarations */ +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_REPORTER (gst_validate_reporter_get_type ()) +#define GST_VALIDATE_REPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_REPORTER, GstValidateReporter)) +#define GST_IS_VALIDATE_REPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_REPORTER)) +#define GST_VALIDATE_REPORTER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VALIDATE_REPORTER, GstValidateReporterInterface)) +#define GST_VALIDATE_REPORTER_CAST(obj) ((GstValidateReporter *) obj) +#endif + +/** + * GST_VALIDATE_REPORT: + * @m: The #GstValidateReporter where the issue happened + * @issue_id: The #GstValidateIssueId of the issue + * @...: The format of the message describing the issue in a printf + * format, followed by the parameters. + * + * Reports a new issue in the GstValidate reporting system with @m + * as the source of that issue. + */ +#ifdef G_HAVE_ISO_VARARGS +#define GST_VALIDATE_REPORT(m, issue_id, ...) \ + G_STMT_START { \ + gst_validate_report (GST_VALIDATE_REPORTER (m), \ + issue_id, \ + __VA_ARGS__ ); \ + } G_STMT_END + +#define GST_VALIDATE_REPORT_ACTION(m, a, issue_id, ...) \ + G_STMT_START { \ + gst_validate_report_action (GST_VALIDATE_REPORTER (m), a, \ + issue_id, \ + __VA_ARGS__ ); \ + } G_STMT_END + +#else /* G_HAVE_GNUC_VARARGS */ +#ifdef G_HAVE_GNUC_VARARGS +#define GST_VALIDATE_REPORT(m, issue_id, args...) \ + G_STMT_START { \ + gst_validate_report (GST_VALIDATE_REPORTER (m), \ + issue_id, ##args ); \ + } G_STMT_END +#define GST_VALIDATE_REPORT_ACTION(m, a, issue_id, args...) \ + G_STMT_START { \ + gst_validate_report_action (GST_VALIDATE_REPORTER (m), a, \ + issue_id, ##args ); \ + } G_STMT_END +#endif /* G_HAVE_ISO_VARARGS */ +#endif /* G_HAVE_GNUC_VARARGS */ +GST_VALIDATE_API +GType gst_validate_reporter_get_type (void); + +/** + * GstValidateInterceptionReturn: + * @GST_VALIDATE_REPORTER_DROP: The report will be completely ignored. + * @GST_VALIDATE_REPORTER_KEEP: The report will be kept by the reporter, + * but not reported to the runner. + * @GST_VALIDATE_REPORTER_REPORT: The report will be kept by the reporter + * and reported to the runner. + */ +typedef enum +{ + GST_VALIDATE_REPORTER_DROP, + GST_VALIDATE_REPORTER_KEEP, + GST_VALIDATE_REPORTER_REPORT +} GstValidateInterceptionReturn; + +/** + * GstValidateReporter: + */ +struct _GstValidateReporterInterface +{ + GTypeInterface parent; + + GstValidateInterceptionReturn (*intercept_report) (GstValidateReporter * reporter, + GstValidateReport * report); + GstValidateReportingDetails (*get_reporting_level) (GstValidateReporter * reporter); + GstPipeline * (*get_pipeline) (GstValidateReporter *reporter); +}; + +GST_VALIDATE_API +void gst_validate_reporter_set_name (GstValidateReporter * reporter, + gchar * name); +GST_VALIDATE_API +const gchar * gst_validate_reporter_get_name (GstValidateReporter * reporter); +GST_VALIDATE_API +GstValidateRunner * gst_validate_reporter_get_runner (GstValidateReporter *reporter); +GST_VALIDATE_API +void gst_validate_reporter_init (GstValidateReporter * reporter, const gchar *name); +GST_VALIDATE_API +void gst_validate_report (GstValidateReporter * reporter, GstValidateIssueId issue_id, + const gchar * format, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NO_INSTRUMENT; +GST_VALIDATE_API +void gst_validate_report_action (GstValidateReporter * reporter, + GstValidateAction *action, + GstValidateIssueId issue_id, + const gchar * format, ...) G_GNUC_PRINTF (4, 5) G_GNUC_NO_INSTRUMENT; +GST_VALIDATE_API +void gst_validate_report_valist (GstValidateReporter * reporter, GstValidateIssueId issue_id, + const gchar * format, va_list var_args) G_GNUC_PRINTF (3, 0); +GST_VALIDATE_API void +gst_validate_reporter_report_simple (GstValidateReporter * reporter, GstValidateIssueId issue_id, + const gchar * message); + +GST_VALIDATE_API +void gst_validate_reporter_set_runner (GstValidateReporter * reporter, GstValidateRunner *runner); +GST_VALIDATE_API +void gst_validate_reporter_set_handle_g_logs (GstValidateReporter * reporter); +GST_VALIDATE_API +GstValidateReport * gst_validate_reporter_get_report (GstValidateReporter *reporter, + GstValidateIssueId issue_id); +GST_VALIDATE_API +GList * gst_validate_reporter_get_reports (GstValidateReporter * reporter); +GST_VALIDATE_API +gint gst_validate_reporter_get_reports_count (GstValidateReporter *reporter); +GST_VALIDATE_API +GstValidateReportingDetails gst_validate_reporter_get_reporting_level (GstValidateReporter *reporter); + +GST_VALIDATE_API +void gst_validate_reporter_purge_reports (GstValidateReporter * reporter); +GST_VALIDATE_API +GstPipeline * gst_validate_reporter_get_pipeline (GstValidateReporter * reporter); + +G_END_DECLS +#endif /* _GST_VALIDATE_REPORTER_ */ diff --git a/include/gst/validate/gst-validate-runner.h b/include/gst/validate/gst-validate-runner.h new file mode 100644 index 0000000000..e513803182 --- /dev/null +++ b/include/gst/validate/gst-validate-runner.h @@ -0,0 +1,104 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + * + * gst-validate-runner.h - Validate Runner class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_RUNNER_H__ +#define __GST_VALIDATE_RUNNER_H__ + +#include <glib-object.h> +#include <gst/gst.h> + +#include <gst/gsttracer.h> + +typedef struct _GstValidateRunner GstValidateRunner; +typedef struct _GstValidateRunnerClass GstValidateRunnerClass; + +#include <gst/validate/gst-validate-report.h> +#include <gst/validate/gst-validate-enums.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_RUNNER (gst_validate_runner_get_type ()) +#define GST_IS_VALIDATE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_RUNNER)) +#define GST_IS_VALIDATE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_RUNNER)) +#define GST_VALIDATE_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_RUNNER, GstValidateRunnerClass)) +#define GST_VALIDATE_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_RUNNER, GstValidateRunner)) +#define GST_VALIDATE_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_RUNNER, GstValidateRunnerClass)) +#define GST_VALIDATE_RUNNER_CAST(obj) ((GstValidateRunner*)(obj)) +#define GST_VALIDATE_RUNNER_CLASS_CAST(klass) ((GstValidateRunnerClass*)(klass)) +#endif + +typedef struct _GstValidateRunnerPrivate GstValidateRunnerPrivate; + +/** + * GstValidateRunner: + * + * GStreamer Validate Runner class. + * + * Class that manages a Validate test run for some pipeline + */ +struct _GstValidateRunner { + GstTracer object; + + /* <private> */ + GstValidateRunnerPrivate *priv; +}; + +/** + * GstValidateRunnerClass: + * @parent_class: parent + * + * GStreamer Validate Runner object class. + */ +struct _GstValidateRunnerClass { + GstTracerClass parent_class; +}; + +/* normal GObject stuff */ +GST_VALIDATE_API +GType gst_validate_runner_get_type (void); + +GST_VALIDATE_API +GstValidateRunner * gst_validate_runner_new (void); + +GST_VALIDATE_API +void gst_validate_runner_add_report (GstValidateRunner * runner, GstValidateReport * report); + +GST_VALIDATE_API +guint gst_validate_runner_get_reports_count (GstValidateRunner * runner); +GST_VALIDATE_API +GList * gst_validate_runner_get_reports (GstValidateRunner * runner); + +GST_VALIDATE_API +int gst_validate_runner_printf (GstValidateRunner * runner); +GST_VALIDATE_API +int gst_validate_runner_exit (GstValidateRunner * runner, gboolean print_result); + +GST_VALIDATE_API +GstValidateReportingDetails gst_validate_runner_get_default_reporting_level (GstValidateRunner *runner); +GST_VALIDATE_API +GstValidateReportingDetails gst_validate_runner_get_reporting_level_for_name (GstValidateRunner *runner, + const gchar *name); + +G_END_DECLS + +#endif /* __GST_VALIDATE_RUNNER_H__ */ + diff --git a/include/gst/validate/gst-validate-scenario.h b/include/gst/validate/gst-validate-scenario.h new file mode 100644 index 0000000000..dc8a7e1a4e --- /dev/null +++ b/include/gst/validate/gst-validate-scenario.h @@ -0,0 +1,425 @@ +/* GStreamer + * Copyright (C) 2013 Thibault Saunier <thibault.saunier@collabora.com> + * + * gst-validate-runner.c - Validate Runner class + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_SCENARIO_H__ +#define __GST_VALIDATE_SCENARIO_H__ + +#include <glib.h> +#include <glib-object.h> + +#include "gst-validate-types.h" +#include <gst/validate/gst-validate-runner.h> + +G_BEGIN_DECLS + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_SCENARIO (gst_validate_scenario_get_type ()) +#define GST_VALIDATE_SCENARIO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_SCENARIO, GstValidateScenario)) +#define GST_VALIDATE_SCENARIO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_SCENARIO, GstValidateScenarioClass)) +#define GST_IS_VALIDATE_SCENARIO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_SCENARIO)) +#define GST_IS_VALIDATE_SCENARIO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_SCENARIO)) +#define GST_VALIDATE_SCENARIO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_SCENARIO, GstValidateScenarioClass)) +#endif + +typedef struct _GstValidateScenarioPrivate GstValidateScenarioPrivate; +typedef struct _GstValidateActionParameter GstValidateActionParameter; + +/** + * GstValidateActionReturn: + * GST_VALIDATE_EXECUTE_ACTION_ERROR: + * GST_VALIDATE_EXECUTE_ACTION_OK: + * GST_VALIDATE_EXECUTE_ACTION_ASYNC: + * GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED: + * GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS: + * GST_VALIDATE_EXECUTE_ACTION_NONE: + * GST_VALIDATE_EXECUTE_ACTION_DONE: + */ +typedef enum +{ + GST_VALIDATE_EXECUTE_ACTION_ERROR, + GST_VALIDATE_EXECUTE_ACTION_OK, + GST_VALIDATE_EXECUTE_ACTION_ASYNC, + + /** + * GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING: + * + * The action will be executed asynchronously without blocking further + * actions to be executed + * + * Since: 1.20 + */ + GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING, + + /** + * GST_VALIDATE_EXECUTE_ACTION_INTERLACED: + * + * Deprecated: 1.20: Use #GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING instead. + */ + GST_VALIDATE_EXECUTE_ACTION_INTERLACED = GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING, + GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED, + GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS, + GST_VALIDATE_EXECUTE_ACTION_NONE, + GST_VALIDATE_EXECUTE_ACTION_DONE, +} GstValidateActionReturn; + +const gchar *gst_validate_action_return_get_name (GstValidateActionReturn r); + +/* TODO 2.0 -- Make it an actual enum type */ +#define GstValidateExecuteActionReturn gint + +/** + * GstValidateExecuteAction: + * @scenario: The #GstValidateScenario from which the @action is executed + * @action: The #GstValidateAction being executed + * + * A function that executes a #GstValidateAction + * + * Returns: a #GstValidateExecuteActionReturn + */ +typedef GstValidateExecuteActionReturn (*GstValidateExecuteAction) (GstValidateScenario * scenario, GstValidateAction * action); + +/** + * GstValidatePrepareAction: + * @action: The #GstValidateAction to prepare before execution + * + * A function that prepares @action so it can be executed right after. + * Most of the time this function is used to parse and set fields with + * equations in the action structure. + * + * Returns: %TRUE if the action could be prepared and is ready to be run + * , %FALSE otherwise + */ +typedef GstValidateExecuteActionReturn (*GstValidatePrepareAction) (GstValidateAction * action); + + +typedef struct _GstValidateActionPrivate GstValidateActionPrivate; + +#define GST_VALIDATE_ACTION_LINENO(action) (((GstValidateAction*) action)->ABI.abi.lineno) +#define GST_VALIDATE_ACTION_FILENAME(action) (((GstValidateAction*) action)->ABI.abi.filename) +#define GST_VALIDATE_ACTION_DEBUG(action) (((GstValidateAction*) action)->ABI.abi.debug) +#define GST_VALIDATE_ACTION_N_REPEATS(action) (((GstValidateAction*) action)->ABI.abi.n_repeats) +#define GST_VALIDATE_ACTION_RANGE_NAME(action) (((GstValidateAction*) action)->ABI.abi.rangename) + +/** + * GstValidateAction: + * @type: The type of the #GstValidateAction, which is the name of the + * GstValidateActionType registered with + * #gst_validate_register_action_type + * @name: The name of the action, set from the user in the scenario + * @structure: the #GstStructure defining the action + * @scenario: The scenario for this action. This is not thread-safe + * and should be accessed exclusively from the main thread. + * If you need to access it from another thread use the + * #gst_validate_action_get_scenario method + * + * The GstValidateAction defined to be executed as part of a scenario + * + * Only access it from the default main context. + */ +struct _GstValidateAction +{ + GstMiniObject mini_object; + + /*< public > */ + const gchar *type; + const gchar *name; + GstStructure *structure; + + /* < private > */ + guint action_number; + gint repeat; + GstClockTime playback_time; + + GstValidateActionPrivate *priv; + + union { + gpointer _gst_reserved[GST_PADDING_LARGE - 1]; /* ->priv */ + struct { + gint lineno; + gchar *filename; + gchar *debug; + gint n_repeats; + const gchar *rangename; + } abi; + } ABI; +}; + +GST_VALIDATE_API +void gst_validate_action_set_done (GstValidateAction *action); +GST_VALIDATE_API +GstValidateScenario * gst_validate_action_get_scenario (GstValidateAction *action); +GST_VALIDATE_API +GstValidateAction * gst_validate_action_new (GstValidateScenario * scenario, + GstValidateActionType * action_type, + GstStructure *structure, + gboolean add_to_lists); +GST_VALIDATE_API +GstValidateAction* gst_validate_action_ref (GstValidateAction * action); +GST_VALIDATE_API +void gst_validate_action_unref (GstValidateAction * action); + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_ACTION (gst_validate_action_get_type ()) +#define GST_IS_VALIDATE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_ACTION)) +#define GST_VALIDATE_ACTION_GET_TYPE(obj) ((GstValidateActionType*)gst_validate_get_action_type(((GstValidateAction*)obj)->type)) +#endif + +GST_VALIDATE_API +GType gst_validate_action_get_type (void); + +/** + * GstValidateActionTypeFlags: + * @GST_VALIDATE_ACTION_TYPE_NONE: No special flag + * @GST_VALIDATE_ACTION_TYPE_CONFIG: The action is a config + * @GST_VALIDATE_ACTION_TYPE_ASYNC: The action can be executed ASYNC + * @GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION: The action will be executed on 'element-added' + * for a particular element type if no playback-time + * is specified + * @GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK: The pipeline will need to be synchronized with the clock + * for that action type to be used. + * @GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL: Do not consider the non execution of the action + * as a fatal error. + * @GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL: The action can use the 'optional' keyword. Such action + * instances will have the #GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL + * flag set and won't be considered as fatal if they fail. + * @GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG: The action can be used in config files even if it is not strictly a config + * action (ie. it needs a scenario to run). + */ +typedef enum +{ + GST_VALIDATE_ACTION_TYPE_NONE = 0, + GST_VALIDATE_ACTION_TYPE_CONFIG = 1 << 1, + GST_VALIDATE_ACTION_TYPE_ASYNC = 1 << 2, + GST_VALIDATE_ACTION_TYPE_NON_BLOCKING = 1 << 3, + + /** + * GST_VALIDATE_ACTION_TYPE_INTERLACED: + * + * Deprecated: 1.20: Use #GST_VALIDATE_ACTION_TYPE_NON_BLOCKING instead. + */ + GST_VALIDATE_ACTION_TYPE_INTERLACED = 1 << 3, + + /** + * GST_VALIDATE_ACTION_TYPE_NON_BLOCKING: + * + * The action can be executed asynchronously but without blocking further + * actions execution. + * + * Since: 1.20 + */ + GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION = 1 << 4, + GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK = 1 << 5, + GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL = 1 << 6, + GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL = 1 << 7, + GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE = 1 << 8, + GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG = 1 << 9, +} GstValidateActionTypeFlags; + +typedef struct _GstValidateActionTypePrivate GstValidateActionTypePrivate; + +/** + * GstValidateActionType: + * @name: The name of the new action type to add + * @implementer_namespace: The namespace of the implementer of the action type + * @execute: The function to be called to execute the action + * @parameters: (allow-none) (array zero-terminated=1) (element-type GstValidateActionParameter): The #GstValidateActionParameter usable as parameter of the type + * @description: A description of the new type + * @flags: The flags of the action type + */ +struct _GstValidateActionType +{ + GstMiniObject mini_object; + + gchar *name; + gchar *implementer_namespace; + + GstValidatePrepareAction prepare; + GstValidateExecuteAction execute; + + GstValidateActionParameter *parameters; + + gchar *description; + GstValidateActionTypeFlags flags; + + GstRank rank; + + GstValidateActionType *overriden_type; + GstValidateActionTypePrivate* priv; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE - sizeof (GstRank) - 2]; +}; + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_ACTION_TYPE (gst_validate_action_type_get_type ()) +#define GST_IS_VALIDATE_ACTION_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_ACTION_TYPE)) +#define GST_VALIDATE_ACTION_TYPE(obj) ((GstValidateActionType*) obj) +#endif + +GST_VALIDATE_API +GType gst_validate_action_type_get_type (void); + +GST_VALIDATE_API +gboolean gst_validate_print_action_types (const gchar ** wanted_types, gint num_wanted_types); + +/** + * GstValidateActionParameter: + * @name: The name of the parameter + * @description: The description of the parameter + * @mandatory: Whether the parameter is mandatory for + * a specific action type + * @types: The types the parameter can take described as a + * string. It can be precisely describing how the typing works + * using '\n' between the various acceptable types. + * NOTE: The types should end with `(GstClockTime)` if its final + * type is a GstClockTime, this way it will be processed when preparing + * the actions. + * @possible_variables: The name of the variables that can be + * used to compute the value of the parameter. + * For example for the start value of a seek + * action, we will accept to take 'duration' + * which will be replace by the total duration + * of the stream on which the action is executed. + * @def: The default value of a parameter as a string, should be %NULL + * for mandatory streams. + */ +struct _GstValidateActionParameter +{ + const gchar *name; + const gchar *description; + gboolean mandatory; + const gchar *types; + const gchar *possible_variables; + const gchar *def; + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +struct _GstValidateScenarioClass +{ + GstObjectClass parent_class; + + /*< public >*/ + /*< private >*/ + gpointer _gst_reserved[GST_PADDING]; +}; + +/** + * GstValidateScenario: + */ +struct _GstValidateScenario +{ + GstObject parent; + + /*< public >*/ + GstStructure *description; + + /*< private >*/ + GstValidateScenarioPrivate *priv; + + union { + gpointer _gst_reserved[GST_PADDING]; + struct { + GMutex eos_handling_lock; + } abi; + } ABI; +}; + +/* Some actions may trigger EOS during their execution. Unlocked this + * could cause a race condition as the main thread may terminate the test + * in response to the EOS message in the bus while the action is still + * going in a different thread. + * To avoid this, the handling of the EOS message is protected with this + * lock. Actions expecting to cause an EOS can hold the lock for their + * duration so that they are guaranteed to finish before the EOS + * terminates the test. */ +#define GST_VALIDATE_SCENARIO_EOS_HANDLING_LOCK(scenario) (g_mutex_lock(&(scenario)->ABI.abi.eos_handling_lock)) +#define GST_VALIDATE_SCENARIO_EOS_HANDLING_UNLOCK(scenario) (g_mutex_unlock(&(scenario)->ABI.abi.eos_handling_lock)) + +GST_VALIDATE_API +GType gst_validate_scenario_get_type (void); + +GST_VALIDATE_API +GstValidateScenario * gst_validate_scenario_factory_create (GstValidateRunner *runner, + GstElement *pipeline, + const gchar *scenario_name); +GST_VALIDATE_API gboolean +gst_validate_list_scenarios (gchar **scenarios, + gint num_scenarios, + gchar * output_file); + +GST_VALIDATE_API GstValidateActionType * +gst_validate_get_action_type (const gchar *type_name); + +GST_VALIDATE_API GstValidateActionType * +gst_validate_register_action_type (const gchar *type_name, + const gchar *implementer_namespace, + GstValidateExecuteAction function, + GstValidateActionParameter * parameters, + const gchar *description, + GstValidateActionTypeFlags flags); + +GST_VALIDATE_API GstValidateActionType * +gst_validate_register_action_type_dynamic (GstPlugin *plugin, + const gchar * type_name, + GstRank rank, + GstValidateExecuteAction function, + GstValidateActionParameter * parameters, + const gchar * description, + GstValidateActionTypeFlags flags); + + +GST_VALIDATE_API +gboolean gst_validate_action_get_clocktime (GstValidateScenario * scenario, + GstValidateAction *action, + const gchar * name, + GstClockTime * retval); + +GST_VALIDATE_API GstValidateExecuteActionReturn +gst_validate_scenario_execute_seek (GstValidateScenario *scenario, + GstValidateAction *action, + gdouble rate, + GstFormat format, + GstSeekFlags flags, + GstSeekType start_type, + GstClockTime start, + GstSeekType stop_type, + GstClockTime stop); + +GST_VALIDATE_API GList * +gst_validate_scenario_get_actions (GstValidateScenario *scenario); +GST_VALIDATE_API GstValidateExecuteActionReturn +gst_validate_execute_action (GstValidateActionType * action_type, + GstValidateAction * action); + +GST_VALIDATE_API GstState +gst_validate_scenario_get_target_state (GstValidateScenario *scenario); + +GST_VALIDATE_API GstElement * +gst_validate_scenario_get_pipeline (GstValidateScenario * scenario); + +GST_VALIDATE_API +void gst_validate_scenario_deinit (void); + +G_END_DECLS + +#endif /* __GST_VALIDATE_SCENARIOS__ */ diff --git a/include/gst/validate/gst-validate-types.h b/include/gst/validate/gst-validate-types.h new file mode 100644 index 0000000000..6ba6c20924 --- /dev/null +++ b/include/gst/validate/gst-validate-types.h @@ -0,0 +1,30 @@ +/* GStreamer + * + * Copyright (C) 2015 Thibault Saunier <thibault.saunier@collabora.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_VALIDATE_TYPES_H__ +#define __GST_VALIDATE_TYPES_H__ + +typedef struct _GstValidateScenario GstValidateScenario; +typedef struct _GstValidateScenarioClass GstValidateScenarioClass; + +typedef struct _GstValidateAction GstValidateAction; +typedef struct _GstValidateActionType GstValidateActionType; + +#endif /* __GST_VALIDATE_TYPES_ */ diff --git a/include/gst/validate/gst-validate-utils.h b/include/gst/validate/gst-validate-utils.h new file mode 100644 index 0000000000..2589f18f15 --- /dev/null +++ b/include/gst/validate/gst-validate-utils.h @@ -0,0 +1,93 @@ +/* GStreamer + * + * Copyright (C) 2013 Thibault Saunier <thibault.saunier@collabora.com> + * + * gst-validate-utils.h - Some utility functions + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef EXPRESSION_PARSER_H +#define EXPRESSION_PARSER_H + +#include<setjmp.h> +#include<stdlib.h> +#include<glib.h> +#include<gio/gio.h> +#include <gst/gst.h> +#include "gst-validate-scenario.h" +#include "gst-validate-reporter.h" + +typedef int (*GstValidateParseVariableFunc) (const gchar *name, + double *value, gpointer user_data); + +typedef gchar** (*GstValidateGetIncludePathsFunc)(const gchar* includer_file); + +GST_VALIDATE_API +gdouble gst_validate_utils_parse_expression (const gchar *expr, + GstValidateParseVariableFunc variable_func, + gpointer user_data, + gchar **error); +GST_VALIDATE_API +guint gst_validate_utils_flags_from_str (GType type, const gchar * str_flags); +GST_VALIDATE_API +gboolean gst_validate_utils_enum_from_str (GType type, + const gchar * str_enum, + guint * enum_value); +GST_VALIDATE_API +gchar ** gst_validate_utils_get_strv (GstStructure *str, const gchar *fieldname); + +GST_VALIDATE_API +GList * gst_validate_utils_structs_parse_from_filename (const gchar * scenario_file, + GstValidateGetIncludePathsFunc get_include_paths_func, + gchar **file_path); +GST_VALIDATE_API +GstStructure * gst_validate_utils_test_file_get_meta (const gchar * testfile, gboolean use_fakesinks); + +GST_VALIDATE_API +GList * gst_validate_structs_parse_from_gfile (GFile * scenario_file, + GstValidateGetIncludePathsFunc get_include_paths_func); + +GST_VALIDATE_API +gboolean gst_validate_element_has_klass (GstElement * element, const gchar * klass); +GST_VALIDATE_API +gboolean gst_validate_utils_get_clocktime (GstStructure *structure, const gchar * name, + GstClockTime * retval); + +GST_VALIDATE_API +GstValidateActionReturn gst_validate_object_set_property (GstValidateReporter * reporter, + GObject * object, + const gchar * property, + const GValue * value, + gboolean optional); + +GST_VALIDATE_API +void gst_validate_spin_on_fault_signals (void); + +GST_VALIDATE_API +gboolean gst_validate_element_matches_target (GstElement * element, GstStructure * s); +gchar * gst_validate_replace_variables_in_string (gpointer incom, GstStructure * local_vars, const gchar * in_string, + GstValidateStructureResolveVariablesFlags flags); +GST_VALIDATE_API +void gst_validate_structure_resolve_variables (gpointer source, GstStructure *structure, GstStructure *local_variables, + GstValidateStructureResolveVariablesFlags flags); +void gst_validate_structure_set_variables_from_struct_file(GstStructure* vars, const gchar* struct_file); +void gst_validate_set_globals(GstStructure* structure); +GST_VALIDATE_API +gboolean gst_validate_fail_on_missing_plugin(void); +GST_VALIDATE_API gboolean gst_validate_has_colored_output(void); + +#endif diff --git a/include/gst/validate/media-descriptor-parser.h b/include/gst/validate/media-descriptor-parser.h new file mode 100644 index 0000000000..b10dc05fbd --- /dev/null +++ b/include/gst/validate/media-descriptor-parser.h @@ -0,0 +1,83 @@ +/* GstValidate + * + * Copyright (c) 2012, Collabora Ltd + * Author: Thibault Saunier <thibault.saunier@collabora.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER_h +#define GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER_h + +#include <glib.h> +#include <glib-object.h> +#include <gst/gst.h> +#include "media-descriptor.h" + +G_BEGIN_DECLS + +GST_VALIDATE_API +GType gst_validate_media_descriptor_parser_get_type (void); + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER (gst_validate_media_descriptor_parser_get_type ()) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER, GstValidateMediaDescriptorParser)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER, GstValidateMediaDescriptorParserClass)) +#define GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER)) +#define GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER, GstValidateMediaDescriptorParserClass)) +#endif + +typedef struct _GstValidateMediaDescriptorParserPrivate GstValidateMediaDescriptorParserPrivate; + + +typedef struct { + GstValidateMediaDescriptor parent; + + GstValidateMediaDescriptorParserPrivate *priv; + +} GstValidateMediaDescriptorParser; + +typedef struct { + + GstValidateMediaDescriptorClass parent; + +} GstValidateMediaDescriptorParserClass; + +GST_VALIDATE_API +GstValidateMediaDescriptorParser * gst_validate_media_descriptor_parser_new (GstValidateRunner *runner, + const gchar * xmlpath, + GError **error); +GST_VALIDATE_API GstValidateMediaDescriptorParser * +gst_validate_media_descriptor_parser_new_from_xml (GstValidateRunner * runner, + const gchar * xml, + GError ** error); +GST_VALIDATE_API +gchar * gst_validate_media_descriptor_parser_get_xml_path (GstValidateMediaDescriptorParser *parser); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_parser_add_stream (GstValidateMediaDescriptorParser *parser, + GstPad *pad); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_parser_add_taglist (GstValidateMediaDescriptorParser *parser, + GstTagList *taglist); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_parser_all_stream_found (GstValidateMediaDescriptorParser *parser); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_parser_all_tags_found (GstValidateMediaDescriptorParser *parser); + +G_END_DECLS + +#endif /* GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER_h */ diff --git a/include/gst/validate/media-descriptor-writer.h b/include/gst/validate/media-descriptor-writer.h new file mode 100644 index 0000000000..334568b7c4 --- /dev/null +++ b/include/gst/validate/media-descriptor-writer.h @@ -0,0 +1,113 @@ +/* GstValidate + * + * Copyright (c) 2012, Collabora Ltd + * Author: Thibault Saunier <thibault.saunier@collabora.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_h +#define GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_h + +#include <glib.h> +#include <glib-object.h> +#include <gst/gst.h> +#include <gst/pbutils/pbutils.h> +#include "media-descriptor.h" + +G_BEGIN_DECLS + +GST_VALIDATE_API +GType gst_validate_media_descriptor_writer_get_type (void); + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER (gst_validate_media_descriptor_writer_get_type ()) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER, GstValidateMediaDescriptorWriter)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER, GstValidateMediaDescriptorWriterClass)) +#define GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER)) +#define GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER, GstValidateMediaDescriptorWriterClass)) +#endif + +typedef struct _GstValidateMediaDescriptorWriterPrivate GstValidateMediaDescriptorWriterPrivate; + + +typedef struct { + GstValidateMediaDescriptor parent; + + GstValidateMediaDescriptorWriterPrivate *priv; + +} GstValidateMediaDescriptorWriter; + +typedef struct { + + GstValidateMediaDescriptorClass parent; + +} GstValidateMediaDescriptorWriterClass; + +/** + * GstValidateMediaDescriptorWriterFlags + */ +typedef enum +{ + GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_NONE = 1 << 0, + GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_NO_PARSER = 1 << 1, + GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_FULL = 1 << 2, + GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_HANDLE_GLOGS = 1 << 3, +} GstValidateMediaDescriptorWriterFlags; + +GST_VALIDATE_API +GstValidateMediaDescriptorWriter * gst_validate_media_descriptor_writer_new_discover (GstValidateRunner *runner, + const gchar *uri, + GstValidateMediaDescriptorWriterFlags flags, + GError **err); + +GST_VALIDATE_API +GstValidateMediaDescriptorWriter * gst_validate_media_descriptor_writer_new (GstValidateRunner *runner, + const gchar *location, + GstClockTime duration, + gboolean seekable); + +gchar * gst_validate_media_descriptor_writer_get_xml_path (GstValidateMediaDescriptorWriter *writer); + +gboolean gst_validate_media_descriptor_writer_detects_frames (GstValidateMediaDescriptorWriter *writer); +GstClockTime gst_validate_media_descriptor_writer_get_duration (GstValidateMediaDescriptorWriter *writer); +gboolean gst_validate_media_descriptor_writer_get_seekable (GstValidateMediaDescriptorWriter * writer); + +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *writer, + GstPad *pad); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_writer_add_taglist (GstValidateMediaDescriptorWriter *writer, + const GstTagList *taglist); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter *writer, + GstPad *pad, + GstBuffer *buf); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter *writer, + const gchar *stream_id, + const GstTagList *taglist); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_writer_write (GstValidateMediaDescriptorWriter * writer, + const gchar * filename); +GST_VALIDATE_API +gchar * gst_validate_media_descriptor_writer_serialize (GstValidateMediaDescriptorWriter *writer); + + +G_END_DECLS + +#endif /* GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_h */ diff --git a/include/gst/validate/media-descriptor.h b/include/gst/validate/media-descriptor.h new file mode 100644 index 0000000000..65b3a57ac1 --- /dev/null +++ b/include/gst/validate/media-descriptor.h @@ -0,0 +1,194 @@ +/* GstValidate + * + * Copyright (c) 2012, Collabora Ltd. + * Author: Thibault Saunier <thibault.saunier@collabora.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_VALIDATE_MEDIA_DESCRIPTOR_H__ +#define __GST_VALIDATE_MEDIA_DESCRIPTOR_H__ + +#include <glib.h> +#include <glib-object.h> +#include <gst/gst.h> +#include "gst-validate-report.h" + +G_BEGIN_DECLS + +#define GST_VALIDATE_UNKNOWN_UINT64 (G_MAXUINT64 - 2) +#define GST_VALIDATE_UNKNOWN_BOOL (G_MAXUINT32 - 2) +typedef struct +{ + /* Children */ + /* GstValidateMediaTagNode */ + GList *tags; + + gchar *str_open; + gchar *str_close; +} GstValidateMediaTagsNode; + +/* Parsing structures */ +typedef struct +{ + /* Children */ + /* GstValidateMediaStreamNode */ + GList *streams; + /* GstValidateMediaTagsNode */ + GstValidateMediaTagsNode *tags; + + /* attributes */ + guint64 id; + gchar *uri; + GstClockTime duration; + gboolean frame_detection; + gboolean skip_parsers; + gboolean seekable; + + GstCaps *caps; + + gchar *str_open; + gchar *str_close; +} GstValidateMediaFileNode; + +typedef struct +{ + /* Children */ + GstTagList *taglist; + + /* Testing infos */ + gboolean found; + + gchar *str_open; + gchar *str_close; +} GstValidateMediaTagNode; + +typedef struct +{ + /* Children */ + /* GstValidateMediaFrameNode */ + GList *frames; + + /* GstValidateMediaTagsNode */ + GstValidateMediaTagsNode *tags; + + /* Attributes */ + GstCaps *caps; + GList * segments; + gchar *id; + gchar *padname; + + /* Testing infos */ + GstPad *pad; + GList *cframe; + + gchar *str_open; + gchar *str_close; +} GstValidateMediaStreamNode; + +typedef struct +{ + /* Attributes */ + guint64 id; + guint64 offset; + guint64 offset_end; + GstClockTime duration; + GstClockTime pts, dts; + GstClockTime running_time; + gboolean is_keyframe; + + GstBuffer *buf; + + gchar *checksum; + gchar *str_open; + gchar *str_close; +} GstValidateMediaFrameNode; + +typedef struct +{ + gint next_frame_id; + + GstSegment segment; + + gchar *str_open; + gchar *str_close; +} GstValidateSegmentNode; + +GST_VALIDATE_API +void gst_validate_filenode_free (GstValidateMediaFileNode * + filenode); +GST_VALIDATE_API +gboolean gst_validate_tag_node_compare (GstValidateMediaTagNode * + tnode, const GstTagList * tlist); + +GST_VALIDATE_API +GType gst_validate_media_descriptor_get_type (void); + +#ifndef __GI_SCANNER__ +#define GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR (gst_validate_media_descriptor_get_type ()) +#define GST_VALIDATE_MEDIA_DESCRIPTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR, GstValidateMediaDescriptor)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR, GstValidateMediaDescriptorClass)) +#define GST_IS_VALIDATE_MEDIA_DESCRIPTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR)) +#define GST_IS_VALIDATE_MEDIA_DESCRIPTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR, GstValidateMediaDescriptorClass)) +#endif + +#define GST_VALIDATE_MEDIA_DESCRIPTOR_GET_LOCK(obj) (&GST_VALIDATE_MEDIA_DESCRIPTOR(obj)->lock) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_LOCK(obj) g_mutex_lock(GST_VALIDATE_MEDIA_DESCRIPTOR_GET_LOCK(obj)) +#define GST_VALIDATE_MEDIA_DESCRIPTOR_UNLOCK(obj) g_mutex_unlock(GST_VALIDATE_MEDIA_DESCRIPTOR_GET_LOCK(obj)) + +typedef struct _GstValidateMediaDescriptorPrivate + GstValidateMediaDescriptorPrivate; + +typedef struct +{ + GstObject parent; + + GstValidateMediaFileNode *filenode; + + GMutex lock; + + GstValidateMediaDescriptorPrivate *priv; +} GstValidateMediaDescriptor; + +typedef struct +{ + GstObjectClass parent; + +} GstValidateMediaDescriptorClass; + +GST_VALIDATE_API +gboolean gst_validate_media_descriptors_compare (GstValidateMediaDescriptor * + ref, GstValidateMediaDescriptor * compared); +GST_VALIDATE_API gboolean +gst_validate_media_descriptor_detects_frames (GstValidateMediaDescriptor * + self); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_get_buffers (GstValidateMediaDescriptor * + self, GstPad * pad, GCompareFunc compare_func, GList ** bufs); +GST_VALIDATE_API gboolean +gst_validate_media_descriptor_has_frame_info (GstValidateMediaDescriptor * + self); +GST_VALIDATE_API GstClockTime +gst_validate_media_descriptor_get_duration (GstValidateMediaDescriptor * self); +GST_VALIDATE_API +gboolean gst_validate_media_descriptor_get_seekable (GstValidateMediaDescriptor + * self); +GST_VALIDATE_API +GList *gst_validate_media_descriptor_get_pads (GstValidateMediaDescriptor * + self); +G_END_DECLS +#endif diff --git a/include/gst/validate/validate-prelude.h b/include/gst/validate/validate-prelude.h new file mode 100644 index 0000000000..5163463765 --- /dev/null +++ b/include/gst/validate/validate-prelude.h @@ -0,0 +1,31 @@ +/* GStreamer Validate Library + * Copyright (C) 2018 GStreamer developers + * + * validate-prelude.h: prelude include header for gst-validate library + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_VALIDATE_PRELUDE_H__ +#define __GST_VALIDATE_PRELUDE_H__ + +#include <gst/gst.h> + +#ifndef GST_VALIDATE_API +#define GST_VALIDATE_API GST_EXPORT +#endif + +#endif /* __GST_VALIDATE_PRELUDE_H__ */ diff --git a/include/gst/validate/validate.h b/include/gst/validate/validate.h new file mode 100644 index 0000000000..64691b575a --- /dev/null +++ b/include/gst/validate/validate.h @@ -0,0 +1,38 @@ +/* GStreamer + * Copyright (C) 2013 Thiago Santos <thiago.sousa.santos@collabora.com> + */ + +#ifndef _GST_VALIDATE_H +#define _GST_VALIDATE_H + +#include <gst/validate/validate-prelude.h> + +#include <gst/validate/gst-validate-types.h> +#include <gst/validate/gst-validate-enums.h> +#include <gst/validate/gst-validate-scenario.h> + +#include <gst/validate/gst-validate-runner.h> +#include <gst/validate/gst-validate-monitor-factory.h> +#include <gst/validate/gst-validate-override-registry.h> +#include <gst/validate/gst-validate-report.h> +#include <gst/validate/gst-validate-reporter.h> +#include <gst/validate/gst-validate-media-info.h> + +G_BEGIN_DECLS + +GST_VALIDATE_API +void gst_validate_init (void); +GST_VALIDATE_API +void gst_validate_init_debug (void); +GST_VALIDATE_API +void gst_validate_deinit (void); +GST_VALIDATE_API +GList * gst_validate_plugin_get_config (GstPlugin * plugin); +GST_VALIDATE_API +gboolean gst_validate_is_initialized (void); +GST_VALIDATE_API +GstStructure *gst_validate_setup_test_file(const gchar * testfile, gboolean use_fakesinks); + +G_END_DECLS + +#endif /* _GST_VALIDATE_H */ |
