Commit graph

866 commits

Author SHA1 Message Date
Alicia Boya García
af205f63b7 gst-validate-scenario: Fix (another) race condition in EOS handling
Since gst_validate_action_set_done() is asynchronous, the bus EOS
handler may already be running before the action is actually finished.
This patch ensures that is not a problem.
2019-02-22 00:02:08 +01:00
Guillaume Desmottes
b20f73099f validate: allow config to check for minimum buffer frequency on pads
This change allow tests to check performance of elements by checking the
frequency at which buffers are pushed on src pads.
I re-used most of the logic from fpsdisplaysink to compute the
frequency.

We can now uses something like:
  GST_VALIDATE_CONFIG='core,min-buffer-frequency=60,target-element-factory-name=v4l2src'

The 'buffer-frequency-start' optional field can be used to ignore the
frequency during the start of the pipeline. This is useful when testing live
pipelines where configuring and setting up elements can take some time slowing
down the first buffers.
2019-02-20 12:12:46 +01:00
Guillaume Desmottes
40f263e857 validate: factor out gst_validate_element_matches_target() 2019-02-20 12:12:46 +01:00
Thibault Saunier
34b5192b94 validate: report: Fix the way we print 'repeat' values 2019-02-15 14:19:03 +00:00
Thibault Saunier
53b2ca8f62 validate: Force LC_NUMERIC to C as it is required by our expression parser
And... add some expression parser unit tests
2019-02-15 14:19:03 +00:00
Thibault Saunier
394242c224 validate:scenario: Enhance variable implementation
- Stop arbitrarily consider params as ClockTime based on their names
  but add a convetion that the `.type` field of the ActionType should
  end by `(GstClockTime)` when it is a clock time.
2019-02-15 14:19:03 +00:00
Thibault Saunier
b7616e5fab validate:scenario: Make gst_validate_action_new public
Mainly so it can be used in unit tests.
2019-02-15 14:19:03 +00:00
Thibault Saunier
be854d4be8 validate:scenario: Allow using set-vars from numeric expressions
And require them to follow the `$varname` (can't be $(varname) as
parenthesis have another meaning in those expressions).

Still accept "duration" and "position" as varname for backward compat
but update our scenarios anyway.
2019-02-15 14:19:03 +00:00
Thibault Saunier
28e041b2cb validate: scenario: Parse playback times as we execute the scenario
This way we will be able to use 'set-vars' for it
2019-02-15 14:19:03 +00:00
Thibault Saunier
d24477d9e4 validate:scenario: Enforce a synthax $(varname) to reference variables
This way it is clear that you are using a variable reading the scenario
and we can verify that what the scenario writer intents is to use an
already set variable.
2019-02-15 14:19:03 +00:00
Guillaume Desmottes
3ebc26e265 validate: don't override max-latency if config contains multiple structs
gst_validate_utils_get_clocktime() is resetting the value if it's not
present in the struct so we were overriding it on the next iterations.
2019-02-12 02:21:14 +00:00
Alicia Boya García
1d4801d679 gst-validate-scenario: Add GST_VALIDATE_SCENARIO_EOS_HANDLING_LOCK
There was a race in appsrc-push when the pushed buffer caused an EOS.
The EOS event could be handled by the main thread, finishing the test
while the action, executing in the streaming thread, has not finished
yet.

A mutex is now introduced to add mutual exclusion for the two threads so
that an EOS does not cause the termination of the test while the action
is still going.
2019-02-11 14:15:30 +00:00
Guillaume Desmottes
0e03b38cc2 validate: scenario: not need to use an atomic to handle dropped count
It's all handled from the same thread.
2019-02-08 14:39:22 +01:00
Guillaume Desmottes
78a8306955 validate: scenario: fix dropped checking when terminating scenario
We want to early return if either no max value has been set for the
scenario or if we didn't receive any QoS information.
2019-02-08 14:25:52 +01:00
Guillaume Desmottes
916bf5cdf1 validate: properly namespace config related checks 2019-02-08 13:32:12 +01:00
Alicia Boya García
e96f2ca714 New validate plugin: validateflow
validateflow can be used to check the buffers and events flowing through
a custom pipeline match an expectation file. This can be used to test
non-regular-playback use cases like demuxers handling adaptive streaming
fragment pushing.

This patch includes also new actions used for these cases:
`appsrc-push`, `appsrc-eos` and `flush` (plus `checkpoint`, which is
only available with validateflow).
2019-02-07 18:19:22 +00:00
Guillaume Desmottes
921a073bdf validate: allow scenarios to define a max nb of dropped buffers
The 'max-dropped' description field can now be used to specify the max
number of buffers than can be dropped by the QoS system.
2019-02-07 14:12:59 +00:00
Guillaume Desmottes
2d8ef6e81c validate: allow scenarios to define max pipeline latency
The 'max-latency' description field can now be used to specify the max
latency allowed for the running pipeline.
2019-02-06 16:07:02 +01:00
Thibault Saunier
49102316df validate:scenario: Set variables on all action fields 2019-02-01 23:46:21 +00:00
Thibault Saunier
e50d41420e validate: Handle G_LOG_ERROR in our glog handler 2019-02-01 23:46:21 +00:00
Thibault Saunier
2f957ab932 validate:scenario: Rename action 'define-consts' to 'set-vars'
Those are not consts are they can be modified at runtime
2019-02-01 23:46:21 +00:00
Thibault Saunier
d0ee26e950 validate: Cleanup flags/enum_from_string 2019-02-01 23:46:21 +00:00
Mathieu Duponchelle
f9190236af scenario: prioritize SCENARIOS_PATH when including 2019-02-01 23:08:16 +01:00
Thibault Saunier
ba9b2c5ec5 validate: Keep trying to print stack traces when our log hanlder is removed
There are cases where a crash happens after the program ends
2019-02-01 00:08:45 -03:00
Thibault Saunier
68573ae919 validate:scenario: Give pipeline position when failling on EOS 2019-01-31 23:47:11 -03:00
Thibault Saunier
25e0694d1e validate:scenario: Explicitely mark generated stop() action as such 2019-01-31 22:37:17 -03:00
Edward Hervey
d1319a1b6d pad-monitor: Remove unused pad getrange override 2019-01-30 14:30:52 +01:00
Edward Hervey
de59b3ad00 validate: Use g_object_{get|set}_qdata where applicable
This provides a substantial speedup compared to using strings
2019-01-30 14:29:48 +01:00
Thibault Saunier
7e70bf8729 validate: scenario: Mark action as being executed right before calling ->execute
And make sure that we do not try to execute the following action

In the case the action type leads to the GMainContext to be ieterated
2019-01-29 13:09:36 -03:00
Thibault Saunier
92483ae210 validate: Plug newly introduced leak 2019-01-12 15:25:53 -03:00
Thibault Saunier
31c1a7ac63 validate: Use filename instead of full path in dotfiles names 2019-01-12 10:00:42 -03:00
Thibault Saunier
9d11ade78a validate: Lower a ERROR message to INFO
This behaviour is totally valid when running unit tests
2019-01-07 00:07:34 +01:00
Thibault Saunier
26ddc02cef validate:tests: Fix race in validate_padmonitor.buffer_before_segment
We were using a fakesrc which data flow was potentially breaking the
test. Stop using it and remove dead code.

Fixes #34
2019-01-03 15:27:33 +00:00
Matthew Waters
1559e1aec7 gst: allow building static libraries for e.g. Android/iOS 2018-12-10 16:47:50 +11:00
Thibault Saunier
72995d5bbe validate: launcher: Add a way to retrieve trace without coredumpctl
Simply spnning on segfaults (like gst-launch) and catch that in
the launcher to transform the timeout into a segfault and grab a gdb
backtrace
2018-12-07 09:06:50 -03:00
Thibault Saunier
79f686efa6 validate: Enhance printing actions with fields
If you have maby field, printed actions where unreadable, clean that
up by adding new lines.
2018-11-17 10:25:28 -03:00
Thibault Saunier
f9790f0eed validate:scenario: Add an action to 'include' another scenario
This is particularly useful for scenario that define constants
that are used to check video frame checksum for example, we can
now have one single 'scenario' file that defines consts for the
checksum of the frames, and those can be reused everywhere.
2018-11-17 09:13:22 -03:00
Thibault Saunier
d4d99267a4 validate:override: Notify override object when they get attached 2018-11-17 09:13:22 -03:00
Alicia Boya García
2c1d8433bd validate: fix bug monitor subscriptions on pads by name
gst_validate_override_register_by_name() was not working when using a
pad name because by the time gst_validate_pad_monitor_do_setup()
was called to set the name of the monitor it was too late for overrides
to have any effect.

Patch written by Thibault.
2018-11-14 17:10:28 +01:00
Thibault Saunier
288258c366 validate: Allow connecting reporters by name for overrides
Using the element that owns the pad on which we are connecting
was not making sense.
2018-10-28 14:54:47 +00:00
Wonchul Lee
955fc5fcce validate: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-09-20 15:16:16 -03:00
Nirbheek Chauhan
8c06862e80 validate: Export the plugin symbol correctly
Otherwise it doesn't get correctly exported when building with MSVC
2018-09-06 17:29:24 +05:30
Nirbheek Chauhan
d035501228 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:52:04 +05:30
Nirbheek Chauhan
68a7ad72ac meson: Build gstvalidate-default-overrides-1.0
Needed by Cerbero.
2018-07-31 23:30:36 +05:30
Thibault Saunier
0dbfa44839 validate:scenario: Add an action type to validate last sample checksum 2018-07-21 12:12:16 -04:00
Thibault Saunier
61a899acf2 validate:scenario: Add a way to define constants to be used in actions
Allowing writing simpler to read scenarios.
2018-07-21 11:43:37 -04:00
Thibault Saunier
64e84407bd validate:scenario: Add a way to set rank on all features of a plugin
You often want to make sure that elements from a particular plugins
are always/never plugged, `set-rank,name=plugin-name,rank=XXX` allows
you to simply do that.
2018-07-14 08:27:05 -04:00
Edward Hervey
8d58befadd pad-monitor: Reset stream-related variables when deactivating
Any local variable related to the stream should be resetted
when the pad is deactivated

Avoids weird issues when elements are re-used (and pads are deactivated
and reactivated).
2018-06-19 08:04:01 +02:00
Thibault Saunier
94ee508123 validate: Fix mixup in variable check 2018-06-15 15:01:32 -04:00
Thibault Saunier
b2e71e1404 validate: media-check: Add a way to skip pluggin parsers
This is useful when you want to check only the demuxer output.

- Keep the information in the media file so that we can launch media-check
  with the proper arguments in the launcher. Update it accordingly.
- Refactor compare_streams to simplify it, which in the end leads to
  reporting all the issues instead of exiting on the first one.
2018-06-15 12:05:14 -04:00