diff --git a/validate/README b/validate/README index edfbccb544..b7696f1737 100644 --- a/validate/README +++ b/validate/README @@ -1,2 +1,2 @@ -If you are looking for informations on how to use gst-qa -> docs/qa-usage.txt -If you are looking for informations on gst-qa design -> docs/qa-design.txt +If you are looking for informations on how to use gst-validate -> docs/validate-usage.txt +If you are looking for informations on gst-validate design -> docs/validate-design.txt diff --git a/validate/data/Makefile.am b/validate/data/Makefile.am index 6257e59f16..3a53c0259d 100644 --- a/validate/data/Makefile.am +++ b/validate/data/Makefile.am @@ -1,4 +1,4 @@ -scenariosdir=${datadir}/gstreamer-$(GST_API_VERSION)/qa-scenario +scenariosdir=${datadir}/gstreamer-$(GST_API_VERSION)/validate-scenario scenarios_DATA = simple_seeks.scenario \ seek_forward.scenario \ seek_backward.scenario \ diff --git a/validate/docs/qa-usage.txt b/validate/docs/qa-usage.txt deleted file mode 100644 index 3ba13b2742..0000000000 --- a/validate/docs/qa-usage.txt +++ /dev/null @@ -1,34 +0,0 @@ -=== Testing with monitors - -Using gst-qa monitors is quite simple, there are 2 ways to test your -pipeline/element. - -== Creating the monitors yourself -This method requires writing a specific application (or modifying yours) to -add GstQaMonitors and GstQaRunner to it. Create a GstQaRunner with -gst_qa_runner_new, then use gst_qa_monitor_factory_create to create monitors -for your pipeline. - -Now all you have to do is use your pipeline as usual, the reports will be -created and posted to the runner. You can list them after the pipeline -finishes to look at the issues found. - -== Using LD_PRELOAD and an existing application -If you want to test an already existing application without modifying it. Just -use: - -LD_PRELOAD=path/to/libgstqa.so yourapp ... - -gst-qa will try to replace GstPipeline creating functions and already -configure runners and monitors for you, reports will be printed to stderr when -they are found. - - -=== Using the file checker -The GstQaFileChecker is a convenient API to compare a media file properties -with its expected properties. The uri of the file to be tested and the -expected values can be configured via gobject properties. -gst_qa_file_checker_run is used to start the tests. - -There is also a convenience tool (gst-qa-file-check) that can be used to -run the file checker. diff --git a/validate/docs/qa-design.txt b/validate/docs/validate-design.txt similarity index 53% rename from validate/docs/qa-design.txt rename to validate/docs/validate-design.txt index 3bfead8dcf..623c8910df 100644 --- a/validate/docs/qa-design.txt +++ b/validate/docs/validate-design.txt @@ -1,33 +1,33 @@ == Main components -Gst-qa is composed of 4 parts: the issues, the reports, the runner and the -reporters. +Gst-validate is composed of 4 parts: the issues, the reports, the runner and +the reporters. = Issue -Gst-QA's main target is finding problems in GStreamer elements/pipelines. To -make it easier to track down exactly what happens, the tests run by Gst-QA use -an extensible list of 'Issues'. Each Issue describes a potential error -situation and has an unique ID and a severity level. +Gst-Validate's main target is finding problems in GStreamer elements/pipelines. +To make it easier to track down exactly what happens, the tests run by +Gst-Validate use an extensible list of 'Issues'. Each Issue describes a +potential error situation and has an unique ID and a severity level. The issues list can be extended by 3rd party libraries if specific needs should be met. = Reporters -A reporter is the object that implements the GstQaReporter interface and is -responsible for performing tests on some target element/scenario. The reporter -is able to create 'Reports' whenever a test it executes fails. +A reporter is the object that implements the GstValidateReporter interface and +is responsible for performing tests on some target element/scenario. The +reporter is able to create 'Reports' whenever a test it executes fails. = Reports -The GstQaReports are created whenever a test fails, they are posted to the -stderr and also are posted to the GstQaRunner for accumulation. +The GstValidateReports are created whenever a test fails, they are posted to the +stderr and also are posted to the GstValidateRunner for accumulation. Each report contains information about the object that generated the issue, the issue associated with the report and a specific debug message for the case, this helps tracking down the problem and fixing it. = Runner -The GstQaRunner is the point of communication for the app to gst-qa +The GstValidateRunner is the point of communication for the app to gst-validate monitoring. It provides an API to gather reports and to make them acessible to the application. @@ -38,20 +38,20 @@ The monitors are used to wrap around pipelines (and elements and pads) and attach to their data flow handling functions to be able to intercept the data and compare it with the expected behaviors. There are 3 types of monitors: - * GstQaElementMonitor - * GstQaBinMonitor - * GstQaPadMonitor + * GstValidateElementMonitor + * GstValidateBinMonitor + * GstValidatePadMonitor -All 3 inherit from the base GstQaMonitor class. Their name suggest what they -monitor and they have a relationship to their children and parents. A bin +All 3 inherit from the base GstValidateMonitor class. Their name suggest what +they monitor and they have a relationship to their children and parents. A bin monitor has, possibly, child element monitors and element monitors have child pad monitors. The monitors are responsible for listening to new children added to their monitored object and creating monitors for them. For example, element monitors listen to element's pad-added signal and create pad monitors whenever a new pad is added. -Most (if not all) the checks are implemented at the GstQaPadMonitor, as it is -where the data flow happens. +Most (if not all) the checks are implemented at the GstValidatePadMonitor, +as it is where the data flow happens. = FileChecker The file checker is another reporter that is used to make sure a file has a diff --git a/validate/docs/validate-usage.txt b/validate/docs/validate-usage.txt new file mode 100644 index 0000000000..b9bdc021ad --- /dev/null +++ b/validate/docs/validate-usage.txt @@ -0,0 +1,34 @@ +=== Testing with monitors + +Using gst-validate monitors is quite simple, there are 2 ways to test your +pipeline/element. + +== Creating the monitors yourself +This method requires writing a specific application (or modifying yours) to +add GstValidateMonitors and GstValidateRunner to it. Create a GstValidateRunner +with gst_validate_runner_new, then use gst_validate_monitor_factory_create to +create monitors for your pipeline. + +Now all you have to do is use your pipeline as usual, the reports will be +created and posted to the runner. You can list them after the pipeline +finishes to look at the issues found. + +== Using LD_PRELOAD and an existing application +If you want to test an already existing application without modifying it. Just +use: + +LD_PRELOAD=path/to/libgstvalidatepreload.so yourapp ... + +gst-validate will try to replace GstPipeline creating functions and already +configure runners and monitors for you, reports will be printed to stderr when +they are found. + + +=== Using the file checker +The GstValidateFileChecker is a convenient API to compare a media file +properties with its expected properties. The uri of the file to be tested and +the expected values can be configured via gobject properties. +gst_validate_file_checker_run is used to start the tests. + +There is also a convenience tool (gst-validate-file-check) that can be used to +run the file checker. diff --git a/validate/gst/validate/gst-validate-bin-monitor.c b/validate/gst/validate/gst-validate-bin-monitor.c index 45a0eaa88e..d833d35d7d 100644 --- a/validate/gst/validate/gst-validate-bin-monitor.c +++ b/validate/gst/validate/gst-validate-bin-monitor.c @@ -46,7 +46,7 @@ gst_validate_bin_monitor_wrap_element (GstValidateBinMonitor * monitor, static gboolean gst_validate_bin_monitor_setup (GstValidateMonitor * monitor); static void -_qa_bin_element_added (GstBin * bin, GstElement * pad, +_validate_bin_element_added (GstBin * bin, GstElement * pad, GstValidateBinMonitor * monitor); static void @@ -113,7 +113,7 @@ gst_validate_bin_monitor_new (GstBin * bin, GstValidateRunner * runner, { GstValidateBinMonitor *monitor = g_object_new (GST_TYPE_VALIDATE_BIN_MONITOR, "object", - bin, "qa-runner", runner, "qa-parent", parent, NULL); + bin, "validate-runner", runner, "validate-parent", parent, NULL); if (GST_VALIDATE_MONITOR_GET_OBJECT (monitor) == NULL) { g_object_unref (monitor); @@ -145,7 +145,7 @@ gst_validate_bin_monitor_setup (GstValidateMonitor * monitor) bin_monitor->element_added_id = g_signal_connect (bin, "element-added", - G_CALLBACK (_qa_bin_element_added), monitor); + G_CALLBACK (_validate_bin_element_added), monitor); iterator = gst_bin_iterate_elements (bin); done = FALSE; @@ -195,7 +195,7 @@ gst_validate_bin_monitor_wrap_element (GstValidateBinMonitor * monitor, } static void -_qa_bin_element_added (GstBin * bin, GstElement * element, +_validate_bin_element_added (GstBin * bin, GstElement * element, GstValidateBinMonitor * monitor) { g_return_if_fail (GST_VALIDATE_ELEMENT_MONITOR_GET_ELEMENT (monitor) == diff --git a/validate/gst/validate/gst-validate-element-monitor.c b/validate/gst/validate/gst-validate-element-monitor.c index b1983a8aad..040524a6ae 100644 --- a/validate/gst/validate/gst-validate-element-monitor.c +++ b/validate/gst/validate/gst-validate-element-monitor.c @@ -51,7 +51,7 @@ static GstElement *gst_validate_element_monitor_get_element (GstValidateMonitor * monitor); static void -_qa_element_pad_added (GstElement * element, GstPad * pad, +_validate_element_pad_added (GstElement * element, GstPad * pad, GstValidateElementMonitor * monitor); static void @@ -103,7 +103,7 @@ gst_validate_element_monitor_new (GstElement * element, g_return_val_if_fail (element != NULL, NULL); monitor = g_object_new (GST_TYPE_VALIDATE_ELEMENT_MONITOR, "object", element, - "qa-runner", runner, "qa-parent", parent, NULL); + "validate-runner", runner, "validate-parent", parent, NULL); if (GST_VALIDATE_ELEMENT_MONITOR_GET_ELEMENT (monitor) == NULL) { g_object_unref (monitor); @@ -164,7 +164,7 @@ gst_validate_element_monitor_do_setup (GstValidateMonitor * monitor) gst_validate_element_monitor_inspect (elem_monitor); elem_monitor->pad_added_id = g_signal_connect (element, "pad-added", - G_CALLBACK (_qa_element_pad_added), monitor); + G_CALLBACK (_validate_element_pad_added), monitor); iterator = gst_element_iterate_pads (element); done = FALSE; @@ -212,7 +212,7 @@ gst_validate_element_monitor_wrap_pad (GstValidateElementMonitor * monitor, } static void -_qa_element_pad_added (GstElement * element, GstPad * pad, +_validate_element_pad_added (GstElement * element, GstPad * pad, GstValidateElementMonitor * monitor) { g_return_if_fail (GST_VALIDATE_ELEMENT_MONITOR_GET_ELEMENT (monitor) == diff --git a/validate/gst/validate/gst-validate-monitor.c b/validate/gst/validate/gst-validate-monitor.c index cfbb907b2a..8881c12575 100644 --- a/validate/gst/validate/gst-validate-monitor.c +++ b/validate/gst/validate/gst-validate-monitor.c @@ -123,13 +123,13 @@ gst_validate_monitor_class_init (GstValidateMonitorClass * klass) GST_TYPE_OBJECT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RUNNER, - g_param_spec_object ("qa-runner", "VALIDATE Runner", + g_param_spec_object ("validate-runner", "VALIDATE Runner", "The Validate runner to " "report errors to", GST_TYPE_VALIDATE_RUNNER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VALIDATE_PARENT, - g_param_spec_object ("qa-parent", "VALIDATE parent monitor", + g_param_spec_object ("validate-parent", "VALIDATE parent monitor", "The Validate monitor " "that is the parent of this one", GST_TYPE_VALIDATE_MONITOR, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 4bdaaf82b7..ea5c8619e6 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -553,7 +553,7 @@ gst_validate_pad_monitor_new (GstPad * pad, GstValidateRunner * runner, GstValidateElementMonitor * parent) { GstValidatePadMonitor *monitor = g_object_new (GST_TYPE_VALIDATE_PAD_MONITOR, - "object", pad, "qa-runner", runner, "qa-parent", + "object", pad, "validate-runner", runner, "validate-parent", parent, NULL); if (GST_VALIDATE_PAD_MONITOR_GET_PAD (monitor) == NULL) { @@ -716,7 +716,8 @@ static void otherpad = g_value_get_object (&value); GST_DEBUG_OBJECT (monitor->pad, "Checking pad %s:%s input timestamps", GST_DEBUG_PAD_NAME (otherpad)); - othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor"); + othermonitor = + g_object_get_data ((GObject *) otherpad, "validate-monitor"); GST_VALIDATE_MONITOR_LOCK (othermonitor); if (gst_validate_pad_monitor_timestamp_is_in_received_range (othermonitor, ts) @@ -855,7 +856,8 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor * otherpad = g_value_get_object (&value); peerpad = gst_pad_get_peer (otherpad); if (peerpad) { - othermonitor = g_object_get_data ((GObject *) peerpad, "qa-monitor"); + othermonitor = + g_object_get_data ((GObject *) peerpad, "validate-monitor"); if (othermonitor) { found_a_pad = TRUE; GST_VALIDATE_MONITOR_LOCK (othermonitor); @@ -934,7 +936,8 @@ static void switch (gst_iterator_next (iter, &value)) { case GST_ITERATOR_OK: otherpad = g_value_get_object (&value); - othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor"); + othermonitor = + g_object_get_data ((GObject *) otherpad, "validate-monitor"); if (othermonitor) { SerializedEventData *data = g_slice_new0 (SerializedEventData); data->timestamp = last_ts; @@ -990,7 +993,8 @@ gst_validate_pad_monitor_otherpad_add_pending_field (GstValidatePadMonitor * switch (gst_iterator_next (iter, &value)) { case GST_ITERATOR_OK: otherpad = g_value_get_object (&value); - othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor"); + othermonitor = + g_object_get_data ((GObject *) otherpad, "validate-monitor"); if (othermonitor) { GST_VALIDATE_MONITOR_LOCK (othermonitor); g_assert (othermonitor->pending_setcaps_fields != NULL); @@ -1033,7 +1037,8 @@ gst_validate_pad_monitor_otherpad_clear_pending_fields (GstValidatePadMonitor * switch (gst_iterator_next (iter, &value)) { case GST_ITERATOR_OK: otherpad = g_value_get_object (&value); - othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor"); + othermonitor = + g_object_get_data ((GObject *) otherpad, "validate-monitor"); if (othermonitor) { GST_VALIDATE_MONITOR_LOCK (othermonitor); g_assert (othermonitor->pending_setcaps_fields != NULL); @@ -1077,7 +1082,8 @@ gst_validate_pad_monitor_add_expected_newsegment (GstValidatePadMonitor * switch (gst_iterator_next (iter, &value)) { case GST_ITERATOR_OK: otherpad = g_value_get_object (&value); - othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor"); + othermonitor = + g_object_get_data ((GObject *) otherpad, "validate-monitor"); GST_VALIDATE_MONITOR_LOCK (othermonitor); if (othermonitor->expected_segment) { GST_VALIDATE_REPORT (othermonitor, EVENT_NEWSEGMENT_NOT_PUSHED, ""); @@ -1370,7 +1376,7 @@ gst_validate_pad_monitor_chain_func (GstPad * pad, GstObject * parent, GstBuffer * buffer) { GstValidatePadMonitor *pad_monitor = - g_object_get_data ((GObject *) pad, "qa-monitor"); + g_object_get_data ((GObject *) pad, "validate-monitor"); GstFlowReturn ret; GST_VALIDATE_PAD_MONITOR_PARENT_LOCK (pad_monitor); @@ -1425,7 +1431,7 @@ gst_validate_pad_monitor_sink_event_func (GstPad * pad, GstObject * parent, GstEvent * event) { GstValidatePadMonitor *pad_monitor = - g_object_get_data ((GObject *) pad, "qa-monitor"); + g_object_get_data ((GObject *) pad, "validate-monitor"); gboolean ret; GST_VALIDATE_PAD_MONITOR_PARENT_LOCK (pad_monitor); @@ -1483,7 +1489,7 @@ gst_validate_pad_monitor_src_event_func (GstPad * pad, GstObject * parent, GstEvent * event) { GstValidatePadMonitor *pad_monitor = - g_object_get_data ((GObject *) pad, "qa-monitor"); + g_object_get_data ((GObject *) pad, "validate-monitor"); gboolean ret; GST_VALIDATE_MONITOR_LOCK (pad_monitor); @@ -1498,7 +1504,7 @@ gst_validate_pad_monitor_query_func (GstPad * pad, GstObject * parent, GstQuery * query) { GstValidatePadMonitor *pad_monitor = - g_object_get_data ((GObject *) pad, "qa-monitor"); + g_object_get_data ((GObject *) pad, "validate-monitor"); gboolean ret; gst_validate_pad_monitor_query_overrides (pad_monitor, query); @@ -1533,7 +1539,7 @@ gst_validate_pad_monitor_activatemode_func (GstPad * pad, GstObject * parent, GstPadMode mode, gboolean active) { GstValidatePadMonitor *pad_monitor = - g_object_get_data ((GObject *) pad, "qa-monitor"); + g_object_get_data ((GObject *) pad, "validate-monitor"); gboolean ret = TRUE; /* TODO add overrides for activate func */ @@ -1554,7 +1560,7 @@ gst_validate_pad_get_range_func (GstPad * pad, GstObject * parent, guint64 offset, guint size, GstBuffer ** buffer) { GstValidatePadMonitor *pad_monitor = - g_object_get_data ((GObject *) pad, "qa-monitor"); + g_object_get_data ((GObject *) pad, "validate-monitor"); gboolean ret; ret = pad_monitor->getrange_func (pad, parent, offset, size, buffer); return ret; @@ -1811,12 +1817,13 @@ gst_validate_pad_monitor_do_setup (GstValidateMonitor * monitor) pad = GST_VALIDATE_PAD_MONITOR_GET_PAD (pad_monitor); - if (g_object_get_data ((GObject *) pad, "qa-monitor")) { - GST_WARNING_OBJECT (pad_monitor, "Pad already has a qa-monitor associated"); + if (g_object_get_data ((GObject *) pad, "validate-monitor")) { + GST_WARNING_OBJECT (pad_monitor, + "Pad already has a validate-monitor associated"); return FALSE; } - g_object_set_data ((GObject *) pad, "qa-monitor", pad_monitor); + g_object_set_data ((GObject *) pad, "validate-monitor", pad_monitor); pad_monitor->pad = pad; diff --git a/validate/gst/validate/gst-validate-reporter.c b/validate/gst/validate/gst-validate-reporter.c index 3eb35cd00c..6c465e05d0 100644 --- a/validate/gst/validate/gst-validate-reporter.c +++ b/validate/gst/validate/gst-validate-reporter.c @@ -43,7 +43,7 @@ static void gst_validate_reporter_default_init (GstValidateReporterInterface * iface) { g_object_interface_install_property (iface, - g_param_spec_object ("qa-runner", "VALIDATE Runner", + g_param_spec_object ("validate-runner", "Validate Runner", "The Validate runner to " "report errors to", GST_TYPE_VALIDATE_RUNNER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index a29b2940de..01f118575a 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -37,7 +37,7 @@ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_VALIDATE_SCENARIO, GstValidateScenarioPrivate)) #define GST_VALIDATE_SCENARIO_SUFFIX ".scenario" -#define GST_VALIDATE_SCENARIO_DIRECTORY "qa-scenario" +#define GST_VALIDATE_SCENARIO_DIRECTORY "validate-scenario" #define DEFAULT_SEEK_TOLERANCE (0.1 * GST_SECOND) /* tolerance seek interval TODO make it overridable */ @@ -725,7 +725,7 @@ gst_validate_scenario_class_init (GstValidateScenarioClass * klass) object_class->set_property = gst_validate_scenario_set_property; g_object_class_install_property (object_class, PROP_RUNNER, - g_param_spec_object ("qa-runner", "VALIDATE Runner", + g_param_spec_object ("validate-runner", "VALIDATE Runner", "The Validate runner to " "report errors to", GST_TYPE_VALIDATE_RUNNER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); @@ -769,7 +769,7 @@ gst_validate_scenario_factory_create (GstValidateRunner * runner, { GstBus *bus; GstValidateScenario *scenario = - g_object_new (GST_TYPE_VALIDATE_SCENARIO, "qa-runner", + g_object_new (GST_TYPE_VALIDATE_SCENARIO, "validate-runner", runner, NULL); GST_LOG ("Creating scenario %s", scenario_name);