From 88fcc580beef3222b479622ff3e3554dab8a9027 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 3 Jun 2020 10:55:22 -0400 Subject: [PATCH] validate: Make extracheck and flow part of core instead plugins It makes things more complex and doesn't bring anything! Part-of: --- .../validate}/flow/formatting.c | 0 .../validate}/flow/formatting.h | 0 .../validate}/flow/gstvalidateflow.c | 25 ++++++++----------- .../validate}/flow/gstvalidateflow.h | 0 .../validate}/flow/meson.build | 0 .../validate/gst-validate-extra-checks.c} | 19 ++++++-------- validate/gst/validate/gst-validate-internal.h | 5 +++- validate/gst/validate/meson.build | 3 +++ validate/gst/validate/validate.c | 2 ++ validate/plugins/extra_checks/meson.build | 9 ------- validate/plugins/meson.build | 2 -- 11 files changed, 26 insertions(+), 39 deletions(-) rename validate/{plugins => gst/validate}/flow/formatting.c (100%) rename validate/{plugins => gst/validate}/flow/formatting.h (100%) rename validate/{plugins => gst/validate}/flow/gstvalidateflow.c (96%) rename validate/{plugins => gst/validate}/flow/gstvalidateflow.h (100%) rename validate/{plugins => gst/validate}/flow/meson.build (100%) rename validate/{plugins/extra_checks/gstvalidateextrachecks.c => gst/validate/gst-validate-extra-checks.c} (90%) delete mode 100644 validate/plugins/extra_checks/meson.build diff --git a/validate/plugins/flow/formatting.c b/validate/gst/validate/flow/formatting.c similarity index 100% rename from validate/plugins/flow/formatting.c rename to validate/gst/validate/flow/formatting.c diff --git a/validate/plugins/flow/formatting.h b/validate/gst/validate/flow/formatting.h similarity index 100% rename from validate/plugins/flow/formatting.h rename to validate/gst/validate/flow/formatting.h diff --git a/validate/plugins/flow/gstvalidateflow.c b/validate/gst/validate/flow/gstvalidateflow.c similarity index 96% rename from validate/plugins/flow/gstvalidateflow.c rename to validate/gst/validate/flow/gstvalidateflow.c index a0402dc5b7..943e8cd27d 100644 --- a/validate/plugins/flow/gstvalidateflow.c +++ b/validate/gst/validate/flow/gstvalidateflow.c @@ -28,9 +28,10 @@ #endif #include -#include "../../gst/validate/validate.h" -#include "../../gst/validate/gst-validate-utils.h" -#include "../../gst/validate/gst-validate-report.h" +#include "../validate.h" +#include "../gst-validate-utils.h" +#include "../gst-validate-report.h" +#include "../gst-validate-internal.h" #include "formatting.h" #include #include @@ -644,12 +645,12 @@ _execute_checkpoint (GstValidateScenario * scenario, GstValidateAction * action) return TRUE; } -static gboolean -gst_validate_flow_init (GstPlugin * plugin) +gboolean +gst_validate_flow_init () { GList *tmp; gint default_generate = -1; - GList *config_list = gst_validate_plugin_get_config (plugin); + GList *config_list = gst_validate_get_config ("validateflow"); if (!config_list) return TRUE; @@ -672,13 +673,14 @@ gst_validate_flow_init (GstPlugin * plugin) flow = validate_flow_override_new (config); all_overrides = g_list_append (all_overrides, flow); } + g_list_free (config_list); for (tmp = all_overrides; tmp; tmp = tmp->next) validate_flow_setup_files (tmp->data, default_generate); /* *INDENT-OFF* */ - gst_validate_register_action_type_dynamic (plugin, "checkpoint", - GST_RANK_PRIMARY, _execute_checkpoint, ((GstValidateActionParameter []) + gst_validate_register_action_type ("checkpoint", "validateflow", + _execute_checkpoint, ((GstValidateActionParameter []) { { .name = "text", @@ -694,10 +696,3 @@ gst_validate_flow_init (GstPlugin * plugin) return TRUE; } - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - validateflow, - "GstValidate plugin that records buffers and events on specified pads and matches the log with expectation files.", - gst_validate_flow_init, VERSION, "LGPL", GST_PACKAGE_NAME, - GST_PACKAGE_ORIGIN) diff --git a/validate/plugins/flow/gstvalidateflow.h b/validate/gst/validate/flow/gstvalidateflow.h similarity index 100% rename from validate/plugins/flow/gstvalidateflow.h rename to validate/gst/validate/flow/gstvalidateflow.h diff --git a/validate/plugins/flow/meson.build b/validate/gst/validate/flow/meson.build similarity index 100% rename from validate/plugins/flow/meson.build rename to validate/gst/validate/flow/meson.build diff --git a/validate/plugins/extra_checks/gstvalidateextrachecks.c b/validate/gst/validate/gst-validate-extra-checks.c similarity index 90% rename from validate/plugins/extra_checks/gstvalidateextrachecks.c rename to validate/gst/validate/gst-validate-extra-checks.c index c719859c72..01b82fe093 100644 --- a/validate/plugins/extra_checks/gstvalidateextrachecks.c +++ b/validate/gst/validate/gst-validate-extra-checks.c @@ -1,6 +1,7 @@ #include -#include "../../gst/validate/validate.h" -#include "../../gst/validate/gst-validate-utils.h" +#include "validate.h" +#include "gst-validate-utils.h" +#include "gst-validate-internal.h" #ifdef HAVE_CONFIG_H #include "config.h" @@ -135,11 +136,11 @@ gst_validate_add_num_instances_check (GstStructure * structure) gst_object_unref (o); } -static gboolean -gst_validate_extra_checks_init (GstPlugin * plugin) +gboolean +gst_validate_extra_checks_init () { GList *config, *tmp; - config = gst_validate_plugin_get_config (plugin); + config = gst_validate_get_config ("extrachecks"); if (!config) return TRUE; @@ -150,6 +151,7 @@ gst_validate_extra_checks_init (GstPlugin * plugin) if (gst_structure_has_field (check, "num-instances")) gst_validate_add_num_instances_check (check); } + g_list_free (config); gst_validate_issue_register (gst_validate_issue_new (EXTRA_CHECKS_WRONG_NUMBER_OF_INSTANCES, @@ -162,10 +164,3 @@ gst_validate_extra_checks_init (GstPlugin * plugin) return TRUE; } - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - extrachecks, - "GstValidate plugin that implements extra, configurable tests.", - gst_validate_extra_checks_init, VERSION, "LGPL", GST_PACKAGE_NAME, - GST_PACKAGE_ORIGIN) diff --git a/validate/gst/validate/gst-validate-internal.h b/validate/gst/validate/gst-validate-internal.h index 15ffc3a5e1..d454b4dbe0 100644 --- a/validate/gst/validate/gst-validate-internal.h +++ b/validate/gst/validate/gst-validate-internal.h @@ -65,6 +65,9 @@ G_GNUC_INTERNAL void gst_validate_set_test_file_globals (GstStructure* meta, con G_GNUC_INTERNAL gboolean gst_validate_get_test_file_scenario (GList** structs, const gchar** scenario_name, gchar** original_name); G_GNUC_INTERNAL GstValidateScenario* gst_validate_scenario_from_structs (GstValidateRunner* runner, GstElement* pipeline, GList* structures, gchar* origin_file); -G_GNUC_INTERNAL GList* gst_validate_get_config(const gchar *structname); +G_GNUC_INTERNAL GList* gst_validate_get_config (const gchar *structname); G_GNUC_INTERNAL GList * gst_validate_get_test_file_expected_issues (void); + +G_GNUC_INTERNAL gboolean gst_validate_extra_checks_init (void); +G_GNUC_INTERNAL gboolean gst_validate_flow_init (void); #endif diff --git a/validate/gst/validate/meson.build b/validate/gst/validate/meson.build index 090ec78565..ba61e421cd 100644 --- a/validate/gst/validate/meson.build +++ b/validate/gst/validate/meson.build @@ -17,6 +17,9 @@ gstvalidate_sources = [ 'media-descriptor-writer.c', 'media-descriptor-parser.c', 'gst-validate-media-info.c', + 'gst-validate-extra-checks.c', + 'flow/gstvalidateflow.c', + 'flow/formatting.c', 'validate.c', ] diff --git a/validate/gst/validate/validate.c b/validate/gst/validate/validate.c index 52af44735e..1c26274ea4 100644 --- a/validate/gst/validate/validate.c +++ b/validate/gst/validate/validate.c @@ -449,6 +449,8 @@ gst_validate_init (void) validate_initialized = TRUE; + gst_validate_extra_checks_init (); + gst_validate_flow_init (); gst_validate_init_plugins (); gst_validate_init_runner (); } diff --git a/validate/plugins/extra_checks/meson.build b/validate/plugins/extra_checks/meson.build deleted file mode 100644 index 7155cf6b0a..0000000000 --- a/validate/plugins/extra_checks/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -shared_library('gstextrachecks', - 'gstvalidateextrachecks.c', - include_directories : inc_dirs, - c_args: ['-DHAVE_CONFIG_H'], - install: true, - install_dir: validate_plugins_install_dir, - dependencies : [gst_dep, gst_pbutils_dep], - link_with : [gstvalidate] - ) diff --git a/validate/plugins/meson.build b/validate/plugins/meson.build index 488a1e2135..130faef95c 100644 --- a/validate/plugins/meson.build +++ b/validate/plugins/meson.build @@ -1,8 +1,6 @@ subdir('fault_injection') subdir('gapplication') subdir('ssim') -subdir('extra_checks') -subdir('flow') if gtk_dep.found() subdir('gtk')