Commit graph

750 commits

Author SHA1 Message Date
Sebastian Dröge
09c5283692 validate: Fix typo 2015-08-16 17:59:00 +02:00
Vineeth TM
14414c13c5 validate: scenario: fix leak during error cases
When message_async is not called during error cases, needs_parsing GList is
not being freed resulting in leak. Hence free'ing the same in finalize.

https://bugzilla.gnome.org/show_bug.cgi?id=753339
2015-08-07 10:18:56 +02:00
Vineeth TM
82ffd9c53e validate: descriptor-writer: Handle error when stream info is not available
There is no check to see if stream info is available. This leads to
assertion error. Adding proper error messages for the same and reported
the same as a validate warning message.

https://bugzilla.gnome.org/show_bug.cgi?id=752758
2015-08-05 17:25:04 -04:00
Vineeth TM
97e630efba validate: descriptor-writer: Print proper error message when discover fails
When discovering the files, there will be different kind of errors. If we print
the exact message, then it will be more helpful for user. Especially in the case
of missing plugins, displaying which plugin is missing as error message

https://bugzilla.gnome.org/show_bug.cgi?id=752758
2015-08-05 17:25:04 -04:00
Vineeth TM
185b3b2d7e validate:override-registry: fix memory leak
mutex is being initialized but not cleared.

https://bugzilla.gnome.org/show_bug.cgi?id=752754
2015-08-05 17:22:39 -04:00
Nicolas Dufresne
6993666749 validate: media-descriptor: Workaround file:// stream-id changing
file:// base stream-id will vary depending on the file path. As we
don't expect everyone to use the same absolute path to place the
validate testsuite, the resulting stream-id changes. Because of that,
we can't match the stream-id in the recorded file, hence cannot do
further check. We work around this by doing what filesink would do,
which is compute a SHA256 of the URI which we can use to first
validate the ID is prefixed like expected, and decide if we should
consider the stream IDs the same or not.

https://bugzilla.gnome.org/show_bug.cgi?id=753079
2015-07-31 18:38:10 -04:00
Nicolas Dufresne
e25a6aaf78 validate: media-descriptor: Fix reading seekable record
Casting the result of g_strmp0 to boolean won't make gboolean
value 0 or 1. We need proper 0 and 1 so we can use == comparision.
2015-07-31 10:49:00 -04:00
Vineeth TM
8d477c6d93 validate: media-descriptor: handle proper return values
while comparing the media descriptor with --expected-results, the return
values are not being handled properly, which results in wrong comparision

https://bugzilla.gnome.org/show_bug.cgi?id=748390
2015-07-31 09:42:04 -04:00
Nicolas Dufresne
bd5fb7be26 validate: media-descriptor: Add comment before ignored return value
As stated in the bug, this comparison failing is not a critical
error, warning is enough. Add a comment so nobody thinks it's a
coding error.

https://bugzilla.gnome.org/review?bug=748390
2015-07-31 09:42:04 -04:00
Vineeth TM
2a5ff3f3c8 validate: media-descriptor: remove duplicate conditions
when comparing tags, two conditions in if an else if are same
the correct way is to first check if both are NULL and return.
changed the condition accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=748390
2015-07-30 15:09:00 -04:00
Vineeth TM
f020c41d41 validate: media-descriptor: fix trivial spelling mistakes
replace comparse_stream with compare_streams

https://bugzilla.gnome.org/show_bug.cgi?id=748390
2015-07-30 15:09:00 -04:00
Thibault Saunier
df76ce5812 validate: Add a method to get action->scenario in a thread safe way
API:
  gst_validate_action_get_scenario
2015-07-25 10:54:19 +02:00
Olivier Crête
386b91522c validate-scenario: Use thread-safe GWeakRef
Since _set_done() is meant to be thread safe,
it can not be used with g_object_add_weak_pointer(),
instead, one must use GWeakRef. But since it is in the API,
document that fact and add a couple assertions to make sure
it doesn't get broken in the future.
2015-07-24 19:59:20 -04:00
Olivier Crête
ae9dec4cc3 validate-scenario: Use GLib functions to make sure GMainContext is used 2015-07-24 19:59:15 -04:00
Olivier Crête
0a17bfc2be scenario: Only modify the actions from the main thread
The action's content is not protected by a mutex, so only
modify it from the main thread.
2015-07-24 17:06:47 -04:00
Vineeth T M
7e91f73c76 validate-scenario: get duration from media_info if not able to query
In case of files, which don't have duration in header, baseparse
estimates the duration only after 1.5 seconds. But Async_done event
is sent before the duration is estimated, which results in error.
If duration query fails, getting the duration from the media-info being
passed through --set-media-info. If media-info is also not set,
printing an error message and throwing error.

https://bugzilla.gnome.org/show_bug.cgi?id=752521
2015-07-22 16:46:43 +01:00
Guillaume Desmottes
09145cc56b validate: don't store the full description struct
Summary:
When running valgrind we'll have 2 scenarios loaded (the normal one and
"setup_sink_props_max_lateness.scenario"). The loading code shouldn't assume
which one will contain the description it actually care about and so just look
for the fields it actually needs.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D199
2015-07-14 18:28:34 +02:00
Thibault Saunier
11b1ae5f3b validate:scenario: Report EVENT_SEEK_NOT_HANDLED as reported error on error 2015-07-14 18:16:40 +02:00
Thibault Saunier
5e2451da62 validate:scenario: Implement a config to set the interval between action calls
Allowing users to decide the time between which the action should be
executed. In some cases executing on idle might lead to action not
being executed fast enough so the user might want to force an interval
in that case.
2015-07-13 16:36:15 +02:00
Thibault Saunier
5edea350f6 validate:scenario: Reset seeked_in_paused when wrong position detected
+ Lower some debug output to LOG
2015-06-24 16:25:24 +02:00
Tim-Philipp Müller
de40a24b8f validate: spelling fixes
analize != analyze
2015-06-14 22:44:26 +01:00
Thibault Saunier
245eb9d0f9 validate: print REPORTER->name when passed as source in validate_printf 2015-06-12 12:41:59 +02:00
Wonchul Lee
de6b24d905 validate:media-descriptor-writer: cleanup get tag code
https://bugzilla.gnome.org/show_bug.cgi?id=750609
2015-06-09 10:18:00 +02:00
Thibault Saunier
8b38d4745b validate: Do not define GstValidateOverride type twice 2015-06-08 18:58:46 +02:00
Thibault Saunier
dbcb6d5614 validate: Mark gst_validate_report a G_GNUC_PRINTF
Summary:
And fix the issue it raised

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D213

Depends on D211
2015-06-08 17:40:32 +02:00
Thibault Saunier
bf610de0d6 validate:utils: Add a utility to get a GstClockTime from a structure
Summary:
Properly handling the different types that can represent ClockTime

Make use of it in gst_validate_action_get_clocktime

API: gst_validate_utils_get_clocktime

Depends on D209

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D210
2015-06-08 17:40:32 +02:00
Thibault Saunier
6ddf55eaa2 validate: Properly clear the overrides registry on deinit
Summary: Depends on D208

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D209
2015-06-08 17:40:32 +02:00
Thibault Saunier
2c6993b2bd validate: Add a way to check whether Validate is initialized
Summary:
API:

  gst_validate_is_initialized

Depends on D207

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D208
2015-06-08 17:40:32 +02:00
Thibault Saunier
ba0ab132f9 validate:override: Add a vmethod to check whether a monitor can attach it
Summary: Depends on D206

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D207
2015-06-08 17:40:32 +02:00
Thibault Saunier
38df412a54 validate:override-registry: Make use of gst_validate_element_has_klass
Summary:
+ Fix a minor mixup bug between klass_overrides and name_overrides

Depends on D205

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D206
2015-06-08 17:40:31 +02:00
Thibault Saunier
40d00e8614 validate:override: Make overrides GObjects
Summary:
This way we can subclass them getting a proper
context in the various override methods.

Depends on D204

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D205
2015-06-08 17:40:31 +02:00
Thibault Saunier
13864f4998 validate: Move plugins to the toplevel directory
Summary:
Otherwise we end up with circular / complicated dependencies between
Validate, its libraries, and the plugins

Depends on D203

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D204
2015-06-08 17:40:31 +02:00
Thibault Saunier
83a8835a65 validate:scenario: Round up computed ClockTime values
Otherwise we end up with rounding error and instead of
seeking to 0.1 we seek to 0.09999999999 for example

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D203
2015-06-08 17:39:57 +02:00
Thibault Saunier
dfe29c56e5 validate🏃 Add a method to force exiting the runner
This method is similar to runner_printf() but can be used
only once. The user needs to make sure all the pipeline
are in NULL state when this is called.

The method emits a "STOPPING" signal and at that point
overrides or monitors should do extra processing/checks if
needed.

+ Make use of it everywhere where it makes sense.

API:
  gst_validate_runner_exit
  GstValidateRunner::stopping signal
2015-06-06 08:50:47 +02:00
Olivier Crête
5ce8ab213e pad-monitor: Check that an ERROR GstMessage has been posted on GST_FLOW_ERROR
Summary:
Before returning GST_FLOW_ERROR, an element must post an ERROR GstMessage,
enforce that.

Reviewers: thiblahute, Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D201
2015-06-03 11:43:12 -04:00
Luis de Bethencourt
111b7344a3 validate: remove unused assignment
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D202
2015-06-03 11:50:51 +01:00
Olivier Crête
dad9d252bc Revert "validate-utils: simplify _read_builtin ()"
This breaks the fast_forward scenario parsing.

This reverts commit 0cfff156b1.
2015-06-02 16:46:15 -04:00
Luis de Bethencourt
ab65b1e743 validate-utils: clean error handling in _file_get_lines () 2015-05-29 17:40:26 +01:00
Luis de Bethencourt
0cfff156b1 validate-utils: simplify _read_builtin () 2015-05-29 16:47:48 +01:00
Vineeth T M
1e3084aa95 validate-utils: sqrt(-1.0) leads to undefined result
Using sqrt of -1 is not valid and leads to undefined results.
When comparing the return value of the fucntion in validate-scenario,
it is being checked with ret == -1, so it makes sense to just return -1 in error case.

https://bugzilla.gnome.org/show_bug.cgi?id=748389
2015-05-29 15:40:55 +01:00
Thibault Saunier
e832785604 validate:scenario: Make sure to actually test position to execute actions 2015-05-20 14:16:14 +02:00
Thibault Saunier
4829e44147 validate:gtk: Use event->type directly
gdk_event_get_event_type was introduced in Gtk 3.10 only

https://bugzilla.gnome.org/show_bug.cgi?id=749421
2015-05-18 10:15:33 +02:00
Thibault Saunier
817ef82bb0 validate: overrides: Allow using regex for named overrides
Summary:
And minor fixes

Depends on D172

Reviewers: Mathieu_Du, gdesmott

Differential Revision: http://phabricator.freedesktop.org/D173
2015-05-14 15:56:57 +02:00
Thibault Saunier
d90f17a5b1 validate:scenario: Handle action execution after pipeline destruction
Summary:
It is possible to keep executing actions after the pipeline
has been destroyed.

API:
  GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE

Depends on D171

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D172
2015-05-14 15:56:56 +02:00
Thibault Saunier
92732c9f24 validate:scenario: Add a macro to get ActionType from an Action
Summary: Depends on D170

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D171
2015-05-14 15:56:56 +02:00
Thibault Saunier
53628bd7f2 validate:scenario: Factor out code to check position
Summary:
Making simpler to follow the execute_next_action function.

Depends on D169

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D170
2015-05-14 15:56:56 +02:00
Thibault Saunier
0f1f1db171 validate:pipeline-monitor: Stop printing position when not possible
Summary:
If from anything >= PAUSED to anything <= READY we can not query
pipeline position, so do not try to.

Depends on D168

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D169
2015-05-14 15:56:56 +02:00
Thibault Saunier
2ccae6e500 validate:scenario: Rename 'get_position_id' to 'execute_actions_source_id'
Summary: Depends on D167

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D168
2015-05-14 15:56:56 +02:00
Thibault Saunier
319e86c81c validate: Do not unref twice the same list
Summary: Depends on D166

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D167
2015-05-14 15:56:56 +02:00
Thibault Saunier
2e8552eff0 validate:scenario: Add a way to specify the pipeline on which a scenario applies
Summary:
From within the scenario itself.

Depends on D165

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D166
2015-05-14 15:56:56 +02:00
Thibault Saunier
2548eafd11 validate: Avoid depending on Gst 1.4
Summary: Depends on D117

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D165
2015-05-14 15:56:56 +02:00
Thibault Saunier
b5d3622b31 validate: Add a gtk plugins that implements action types relative to Gtk
Summary:
Currently the only supported action is gtk-put-event allowing press and
release keyboard keys.

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D117
2015-05-14 15:56:56 +02:00
Guillaume Desmottes
4927c65710 validate: disable QOS features when running with valgrind
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D156
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
b54a22c9bc validate: move element_has_klass() to utils
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D163
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
2760da33a3 validate: allow to pass more than one file to GST_VALIDATE_CONFIG
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D161
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
e5e7afd86f validate: gst_validate_plugin_get_config() return 'core' conf if plugin is NULL
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D160
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
92fa2b5681 validate: add gst_validate_deinit()
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D159
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
596daaed74 validate: don't leak not maching config structures
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D158
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
c2fef15266 validate: factor out create_config()
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D157
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
63ca026b03 validate: display debug info when stopping because EOS
Summary:
Useful to know if we are executing the 'stop' command provided by the scenario
or not.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D155
2015-05-11 21:55:24 +02:00
Guillaume Desmottes
0417e47e50 validate: unref last_caps when destroying pad monitor
Reviewers: thiblahute

Reviewed By: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D150
2015-05-07 11:19:57 +02:00
Guillaume Desmottes
c2128e45af validate: initialize position
Summary: Fix invalid read when executing without having the actual position.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D147
2015-05-06 11:32:30 +02:00
Guillaume Desmottes
4a8d4ddbf6 validate: add 'target-element-klass' property on set-property action
Summary:
This allows us to set a property on all the elements of the pipeline matching
a specific klass name.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D140
2015-05-04 14:13:45 +02:00
Guillaume Desmottes
316a7bb74d validate: add 'optional' action keyword
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D139
2015-05-04 13:24:21 +02:00
Guillaume Desmottes
d0a02df6e5 validate: scenario: call _element_added_cb() on existing children
Summary:
We want to have a chance to set property on all the elements of the pipelines,
including the existing children when the element is added.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D138
2015-05-04 13:24:21 +02:00
Guillaume Desmottes
db366e0a37 Fix 'stoped' typo
Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D137
2015-05-01 18:19:39 +02:00
Thibault Saunier
9bba59d9ba validate:scenario: Fix 'duration' property of the pause action
We preparse it into and set it as GstClockTime in the
structures so make sure to use them as such.
2015-04-29 13:22:11 +02:00
Guillaume Desmottes
8c4a3de701 move scenarios to data/scenarios
Differential Revision: http://phabricator.freedesktop.org/D115
2015-04-20 15:31:26 +02:00
Guillaume Desmottes
60498f73b3 validate: scenario: fix structure and action leak 2015-04-20 08:35:58 +02:00
Guillaume Desmottes
308fa194a7 validate: report: fix GString leak when early returning 2015-04-20 08:35:58 +02:00
Thibault Saunier
848d660603 validate:pipelinemonitor: Print position only when in state >= PAUSED
Reviewers: Mathieu_Du

Reviewed By: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D86
2015-04-19 11:58:01 +02:00
Thibault Saunier
86efbffa32 validate:scenario: Stop scenario execution on stop action
And document it properly.

Summary:
The stop action was defined as "setting state to NULL" but
its actual goal is to stop the execution of the scenario. Make sure
that the scenario will not try to execute other actions when that
one has been executed.

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D103
2015-04-17 19:31:07 +02:00
Thibault Saunier
5d6fcb5727 validate: Gracefully handle absence of TAG on streams
Summary: And do not segfault when it happens!

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D99
2015-04-16 13:43:33 +02:00
Guillaume Desmottes
abb9e0ff2a validate: don't pass NULL to gst_caps_copy() 2015-04-16 12:41:25 +02:00
Guillaume Desmottes
36e69f305a validate: use GstMediaDescriptorWriter as log handler
Allow us to catch warnings when running gst-validate-media-check-1.0.
2015-04-16 12:41:25 +02:00
Guillaume Desmottes
2133207113 validate: media-descriptor-writer: fix string leaks 2015-04-16 12:41:25 +02:00
Ramiro Polla
6bb04c037c validate:scenario: Add support for waiting on signals and messages
Reviewers: Mathieu_Du

Differential Revision:
http://phabricator.freedesktop.org/D88
2015-04-13 11:27:02 +02:00
Thibault Saunier
774dbf9346 validate:scenario: Report disabling plugin issues
Summary:
+ typedef GstValidateActionReturn so it can be used in the introspection
+ Add GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED which should be used
  to tell Validate that something wrong happened so the sub action
  won't be executed, but that it should not report an error itself
  as it has already been handled in the action function.

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D81
2015-04-10 16:53:41 +02:00
Thibault Saunier
69ca5c69cc validate:scenario: Allow execution of disable-plugin as a config action
Summary:
And fix a bug where config actions were added to the list of action even
if they had already been executed

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D80
2015-04-10 16:53:41 +02:00
Thibault Saunier
5d7403a6a5 validate: Add a method to easily get plugin configuration
Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D77
2015-04-10 16:53:41 +02:00
Thibault Saunier
4dce5054de validate:plugins: Add support to all GApplication as a test apps
Summary:
Add a very simple plugin that will allow any GApplication to easily be
used with GstValidate using the LD_PRELOAD feature

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D75
2015-04-10 16:53:41 +02:00
Mathieu Duponchelle
23bb7dfdcc validate: let structs_from_filename be exported.
Summary: It is useful for plugins too

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D74
2015-04-10 16:53:41 +02:00
Thibault Saunier
0159c96ab0 validate:scenario: Update Action.repeat field when needed
Summary: And print the current repeat value of the action that have such a field

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D73
2015-04-10 16:53:41 +02:00
Thibault Saunier
1e6b188d78 validate:scenario: Alway execute a 'quit' action on EOS
Summary: Making scenario more usable with LD_PRELOAD

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D72
2015-04-10 16:53:41 +02:00
Thibault Saunier
460bf61345 validate:scenario: Set the main action structure in fill_structure
Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D71
2015-04-10 16:53:40 +02:00
Guillaume Desmottes
2f643bde2c validate: scenario: fix caps leak 2015-03-31 09:45:06 +02:00
Guillaume Desmottes
37d0ea4335 validate: media-descriptor: fix filenode->caps leak 2015-03-31 09:45:06 +02:00
Guillaume Desmottes
c8e6b90f4b validate: pad-monitor: fix caps leak
Don't create othercaps when early returning.
2015-03-31 09:45:06 +02:00
Guillaume Desmottes
625fe7b5df validate: media-descriptor-writer: don't leak info and streaminfo 2015-03-26 15:42:11 +01:00
Guillaume Desmottes
32eac4db44 validate: media-descriptor: fix caps leak
gst_pad_get_current_caps() returns a reffed caps.
2015-03-26 10:32:09 +01:00
Guillaume Desmottes
a35614d108 validate: call gst_bus_remove_signal_watch()
We are supposed to call gst_bus_remove_signal_watch() for each gst_bus_add_signal_watch() call to prevent leaks.
2015-03-23 13:41:03 +01:00
Guillaume Desmottes
6e776b8f0f validate: media-descriptor-parser: fix string leak
_set_content() doesn't actually consume @content so the caller is responsible
freeing it.
2015-03-23 13:41:03 +01:00
Guillaume Desmottes
d9a13b5563 validate: pad-monitor: fix buffers list leak 2015-03-23 13:41:03 +01:00
Guillaume Desmottes
3f0cb5fedf validate: pad-monitor: fix caps leak 2015-03-23 13:41:03 +01:00
Guillaume Desmottes
81a33d5f6a validate: fix a bunch of GstBus leaks 2015-03-23 13:41:03 +01:00
Guillaume Desmottes
2aeaa1b279 validate: report: fix invalid read when destroying Report
Summary:
@report was invalid when we were trying to clear the mutex.

validate: scenario: remove weak pointer when destroying action

Free an invalid read when the scenario is destroyed after the action.

Differential Revision: http://phabricator.freedesktop.org/D44
2015-03-20 15:13:30 +01:00
Guillaume Desmottes
7aa5f85ccd validate: report: fix invalid read when destroying Report
@report was invalid when we were trying to clear the mutex.
2015-03-20 14:49:24 +01:00
Guillaume Desmottes
ba175368d1 validate: scenario: don't borrow @structure in _fill_action()
@structure was borrowed in some code path and wasn't in some other. Make it
clearer, and fix a leak, by always copying it.
2015-03-20 11:39:32 +01:00
Guillaume Desmottes
9691136887 validate: override-registry: fix structs list leak
The list returned by _lines_get_strutures() needs to be deeply freed.
2015-03-20 11:33:01 +01:00
Guillaume Desmottes
a99c13da4b validate: scenario: fix scenarios leak 2015-03-20 11:27:29 +01:00
Guillaume Desmottes
38342dfe2e validate: reporter: fix message leak 2015-03-20 11:25:39 +01:00
Guillaume Desmottes
e9aeca28a8 validate: report: don't shadow the GString variable
We were leaking the GString as it's freed outside of the block.
2015-03-20 11:24:27 +01:00
Guillaume Desmottes
3a275d2212 validate: report: fix GStrv leak 2015-03-20 11:24:04 +01:00
Guillaume Desmottes
7373286968 validate: report: fix GStrv leak
We borrow the content of the GStrv but were leaking the array itself.
2015-03-20 11:23:29 +01:00
Guillaume Desmottes
2778e501c4 validate: move scenarios to validate/scenarios/
https://bugzilla.gnome.org/show_bug.cgi?id=746465
2015-03-20 10:34:48 +01:00
Thibault Saunier
b8c085b319 validate: keep executing actions even after linking up following execution
When linking actions execution without waiting on execution context, then
idle callback should keep being called so following action keep being
executed.
2015-03-13 18:04:42 +00:00
Thibault Saunier
49b2ed5d7a validate:scenario: Rename get_position to execute_next_action
That function was wrongly called and did not correspond to what it
actually does.
2015-03-10 11:32:15 +01:00
Vincent Penquerc'h
3bb6ecd6fa Revert "validate: add non flushing seek support"
This reverts commit 3ff55dcc31.

Regressions on the test server, apparently linked to this patchset.
2015-03-09 18:26:37 +00:00
Vincent Penquerc'h
09988a97bf Revert "validate: use segments to detect success of flushing seeks too"
This reverts commit c47cc7ba90.

Regressions on the test server, apparently linked to this patchset.
2015-03-09 18:26:33 +00:00
Vincent Penquerc'h
d78c20322f Revert "validate: expect a buffer with discontinuity after a seek"
This reverts commit 87064b6994.

Regressions on the test server, apparently linked to this patchset.
2015-03-09 18:26:06 +00:00
Vincent Penquerc'h
87064b6994 validate: expect a buffer with discontinuity after a seek
https://bugzilla.gnome.org/show_bug.cgi?id=744783
2015-03-09 10:06:34 +00:00
Vincent Penquerc'h
c47cc7ba90 validate: use segments to detect success of flushing seeks too
https://bugzilla.gnome.org/show_bug.cgi?id=744783
2015-03-09 10:06:34 +00:00
Vincent Penquerc'h
3ff55dcc31 validate: add non flushing seek support
and a couple scenarios using them

https://bugzilla.gnome.org/show_bug.cgi?id=744783
2015-03-09 10:06:34 +00:00
Thibault Saunier
d5ddeaf8c2 validate:scenario: Handle not mandatory action types
Summary:
There is currently no way to handle the fact that action types
might be handled only by a specific application but not handling
this action types would not cause any difference for the good execution
of the scenario as a whole

Differential Revision: http://phabricator.freedesktop.org/D33
2015-03-05 14:55:39 +01:00
Thibault Saunier
88da04e0a0 validate:report: Allow registering of issue types through the introspection
Fixing annotations and make GstValidateIssue refcounted

We break the ABI in that commit but I do not expect anyone to register
issue type outside GstValidate yet.

Add padding in the structures so we can avoid breaking the ABI again later.
2015-03-04 17:28:50 +01:00
Thibault Saunier
433c8676dc validate:monitor: Do not requiere a GstObject as target
We can work with any GObject and that allows applications to write
monitors for other aspects too
2015-03-04 17:24:52 +01:00
Thibault Saunier
8b261599e4 validate:scenario: Alway execute sub action on action running SYNC
Move methods around to avoid needing on top prototypes
2015-03-03 12:31:37 +01:00
Thibault Saunier
34394b0c7a validate:scenario: Do not execute last sub action twice when ASYNC 2015-03-03 11:33:06 +01:00
Thibault Saunier
7888293f8f validate:scenario: Properly print sub action as if they were main actions 2015-03-03 10:39:52 +01:00
Thibault Saunier
ec27b86fa9 validate: Build the preload so when possible 2015-02-26 11:09:23 +01:00
Thibault Saunier
f3adc999f1 validate:scenario: Fix GstValidateAction ABI adding a private structure
This way we can easily extend the structure and avoid needing using
a union and such
2015-02-19 13:57:30 +01:00
Thibault Saunier
3b6f187d85 validate: Properly notify user about missing plugins
This way it is clear in gst-validate-launcher that the failure is due
to a missing plugin
2015-02-18 10:07:17 +01:00
Thibault Saunier
f0511cc3a2 validate: Fix wrong sizeof usage
sizeof(int) is always <= sizeof(gpointer)
2015-02-17 18:22:12 +01:00
Thibault Saunier
08afce235c validate: Print actions directly from the scenario
Avoiding user to have to print them in each and every action type
implementation.

This requires adding some API to prepare actions before printing them.
Preparing action in that case mean parsing the values contained in the
GstStructure parsing equations and setting back the actual value
afterward

API:
  * GstValidatePrepateAction
  * gst_validate_action_type_set_prepare_function
2015-02-17 17:11:51 +01:00
Thibault Saunier
8b6c521bb1 validate: Fix build on windows
Check where libgstvalidate.dll is installed and use that base folder to
figure out where GstValidate plugins are installed
2015-02-17 09:23:27 +01:00
Thibault Saunier
62a0db232c validate: Do not forget to dist _full variant of scrubing scenarios 2015-02-16 20:56:49 +01:00
Thibault Saunier
8e5b495c62 validate: Create a gst-validate-types.h header where we define types
And include it from validate.h.

This way we avoid to need to typedef GstValidateAction twice, which is
a C11 feature
2015-02-16 19:52:12 +01:00
Edward Hervey
a1da4cd733 validate-report: Fix valist usage
a va_list always 'exists' (it's a struct). It therefore can't be NULL
(and can't be tested)

Just use the regular print variant where appropriate.
2015-02-16 19:24:23 +01:00
Thibault Saunier
3d83370770 validate:scenario: Document locking 2015-02-16 17:18:37 +01:00
Thibault Saunier
89e2855964 validate:scenario: Make get_position happen on idle
Summary:
- Add a way to force action to be executed in their own GSource dispatch, disabling chain action execution

API:
  GstValidateScenario::execute-on-idle property
2015-02-16 17:18:32 +01:00
Thibault Saunier
51593df323 validate:scenario: Add a method to retrieve all remaining actions
Not only the next one as it was not making much sense!

API:
  - gst_validate_scenario_get_next_action
  + gst_validate_scenario_get_actions
2015-02-16 17:18:31 +01:00
Thibault Saunier
16f97e3df6 validate:utils: Fix some annotations 2015-02-16 17:18:31 +01:00
Thibault Saunier
a69af22ca9 validate:scenario: Allow link up of action executions for overriden types
Exposing a GstValidateActionType.overriden_type field
And properly expose gst_validate_execute_action
2015-02-16 17:18:31 +01:00
Thibault Saunier
19f9172586 validate:reporter: Always print reports in the Gst debug system 2015-02-16 17:18:31 +01:00
Thibault Saunier
6181f7763d validate: Misc fixes 2015-02-16 17:18:21 +01:00
Thibault Saunier
f4c6ed368e validate: Properly annotate gst_validate_register_action_type*
It does not return any reference to the type
2015-02-14 16:32:12 +01:00
Thibault Saunier
135cb2d2e4 Revert "validate:scenario: Add a way to specify action structure size"
This reverts commit b976319ef7f977b8ce910c4b8aa1a843da3b264f.

Now that the exact same structure can be used to represent different
action types, we can not rely on the structure size to stuff
informations into the action.  Users should just make use of
GstMiniObject.qdata.
2015-02-14 16:32:12 +01:00
Thibault Saunier
a5dab4b378 validate:scenario: We do not own any ref in GstValidateExecuteAction
And gst_validate_action_set_done might very well unref the last
reference to the action
2015-02-14 16:32:12 +01:00
Thibault Saunier
45f3f3d772 validate: Make sure that the latest action type registration is kept
Avoiding to change the behaviour!
2015-02-14 16:32:12 +01:00
Thibault Saunier
e80a7df4d3 validate:scenario: Handle scenario repeat property with sub actions
And port change_state_intensive.scenario to it
2015-02-14 16:32:12 +01:00
Thibault Saunier
a5a0722d20 validate:scenario: Add the notion of sub actions
Sub action will allow user to executed action *right* after the
previous action has been completed, meaning in the end that both
action can be considered as one single action.

+ Factor out a function to fill an GstValidateAction structure from a
  GstStructure
+ Factor out a function to set action playback time
2015-02-14 16:32:12 +01:00
Thibault Saunier
441513e689 validate: Add an API to cleanly register action type from plugins
API:
    gst_validate_register_action_type_dynamic

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:11 +01:00
Thibault Saunier
1194b313af validate: Rename libfaultinjector to libgstvalidatefaultinjector
https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:11 +01:00
Thibault Saunier
dae4051ed6 validate: Use plugin name as implementer_namespace when registering action type
And document it as a good practice as it will allow us to map plugins
and action types

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:11 +01:00
Thibault Saunier
cdc6565605 validate: Move the fault_injection plugin to gst/plugins/
https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:11 +01:00
Thibault Saunier
5c90a06645 validate: Use an actual GstRegistry to track our plugins
Keeping everything internal for now

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:11 +01:00
Thibault Saunier
ed43ab1509 validate: Implement fault_injection as a Gs(tValidate)Plugin
https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:11 +01:00
Thibault Saunier
a9b27057bb validate:scenario: Add a way to specify action structure size
And return the register GstValidateActionType on registration

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:10 +01:00
Thibault Saunier
fbfcf16b20 scenario: Do not concider we are seek_in_paused if executing a new action
The new action might change the position on purpose and we should not
fail in that case.

Also at that point we know the test of position after the seek has
been executed

+ Minor cosmetic fixes

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:10 +01:00
Thibault Saunier
9f5310b1d8 validate: scenario: Add a method to get the following action to be executed
API:
  + gst_validate_scenario_get_next_action

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:10 +01:00
Thibault Saunier
8125c46122 validate: Add helper functions ti print actions
API:
  + gst_validate_scenario_get_next_action
  + gst_validate_reporter_report_simple

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:10 +01:00
Thibault Saunier
16d52a445b validate: Minor documentation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:09 +01:00
Thibault Saunier
11f923fa52 validate: Fix the check of action that can be *not* executed
The check was wrong and we ended up allowing seek actions to no be
executed.

API:
    GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:09 +01:00
Thibault Saunier
5069e0347c validate:scenario; Advertise action types that will be executed on addition
Adding a flag to the action type

And make that code thread safe.

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:09 +01:00
Thibault Saunier
c74f33bd17 validate:scenario: Add a Flag fore ActionType that need clocks sync
And cleanly use it to set the need-clock-sync field in
the scenario properties

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:09 +01:00
Thibault Saunier
ef0f78f600 validate: Add the notion of INTERLACED actions
An interlaced action is an action that will be executed ASYNC but
without that will not block following actions during its execution.
The action should be set to done later on at any point during the
execution of the scenario.

API:
  + GST_VALIDATE_EXECUTE_ACTION_INTERLACED
  + GST_VALIDATE_ACTION_TYPE_INTERLACED

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:09 +01:00
Thibault Saunier
e7cc086f95 validate: Add a way to retrieve register actoin type from outside
API:
  * GstValidateActionType
  * gst_validate_get_action_type

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:09 +01:00
Thibault Saunier
71d53bb2d3 validate:scenario: Make action->scenario public API
It can be usefull for action type implementers

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:08 +01:00
Thibault Saunier
8848657ce3 validate:scenario: Add a disable-plugin action type
https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:08 +01:00
Thibault Saunier
5f888fb5b6 validate: Properly advertise the wait action as ASYNC
And add some printing when executing the set-property action

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:08 +01:00
Thibault Saunier
bee292f548 validate: Wait for switch-track to complete before executing next action
This action type can take some time, we need to make sure that the
combiner/input-selector element properly pushed a buffer marked
as DISCONT to concider the action is done.

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:08 +01:00
Thibault Saunier
d7b5d57305 validate:scenario: Avoid waiting for 50ms between actions
We should be able to execute the next action as soon as the previous
one is fully completed, make sure the code tries to do that and does
not artificially add some waiting time.

And make sure if the gst_validate_action_set_done is called from outside
our execution thread, we do not try to execute anything

https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:32:07 +01:00
Thibault Saunier
508678cfe1 scenario: Add a signal to notify user when the scenario is DONE executing
https://bugzilla.gnome.org/show_bug.cgi?id=743994
2015-02-14 16:31:57 +01:00
Mathieu Duponchelle
4ce91b98f0 validate: Implement a fault injection library.
+ And implement a corrupt-socket-recv action
+ Only compile this on Linux, LD_PRELOAD won't work on Windows.

For now the registering of the action is done through
a call to socket_interposer_init, this will get better
when we refactor the action logic.

https://bugzilla.gnome.org/show_bug.cgi?id=743871
2015-02-03 15:30:54 +01:00
Mathieu Duponchelle
165e35b3f0 bin-monitor: add itself as gobject data. 2015-01-22 22:07:37 +01:00
Thiago Santos
10fe72aa52 pad-monitor: plug caps leak on iterator resync 2015-01-09 14:04:16 -03:00
Thiago Santos
389f6d96b4 pad-monitor: use the same filter caps when querying downstream caps
To avoid comparing the real result that has been filtered against
a much larger caps that contains all possibilities.
2015-01-09 14:04:13 -03:00
Thiago Santos
7b4df44f61 pad-monitor: get correct caps to check for proxied fields in caps queries
Elements should proxy the peer element's caps fields and not what they
have currently set on their pads when replying to a caps query
2014-12-08 17:28:47 -03:00
Thiago Santos
af2707d3a3 pad-monitor: Only add pending caps fields for source pads
As caps events are downstream, caps set travels from sinks to
sources. Adding pending setcaps values to sink pads makes no sense
as when a new caps is set on the sink it would compare with values
currently set on the source pad, causing a critical failure when
renegotiation happens.
2014-12-08 17:28:47 -03:00
Thibault Saunier
515c8405f0 validate: Remove file specific blacklisted tests 2014-12-05 16:16:53 +01:00
Thibault Saunier
36aed39259 validate: Make sure to at least listen to GStreamer and GLib g_logs
If somewhere else someone is overriding the g_log default handler,
we would not get notified of anything.
2014-12-05 12:16:55 +01:00
Thibault Saunier
582f1cfc06 validate: Factor out a function to print action types parametters
+ Remove playback-type from the list and just print it
2014-12-05 12:16:54 +01:00
Thiago Santos
db67a92b3f pad-monitor: do not enforce caps querying rules for converters
Some encoders/decoders can also be converters, do not enforce
caps proxying rules for them
2014-11-28 17:21:23 -03:00
Thibault Saunier
c952886813 validate: Already having a monitor is no error 2014-11-25 19:41:01 +01:00
Thibault Saunier
b56ebc8a43 validate: Enhance documentation 2014-11-25 19:41:00 +01:00
Thibault Saunier
11c49a7db8 validate:scenario: Execute actions without playback time without a valid position
If the user did not specify any playback time we should be able to
execute actions even if the pipeline can't answer the position query

+ Make simpler to read the conditions of an action execution
2014-11-25 19:41:00 +01:00
Thibault Saunier
cdfa1ee61b validate:scenario: Properly handle ASYNC action execution in the API
The ->execute function now return a GstValidateExecuteActionReturn
which can be set as ASYNC in order to tell the scenario that the action
will be executed asynchronously, when the action is done, the caller is
responsible for calling gst_validate_action_set_done(); so that the
scenario keeps going on.

In this commit we make sure that the old API keeps working as
GST_VALIDATE_EXECUTE_ACTION_ERROR == FALSE and
GST_VALIDATE_EXECUTE_ACTION_OK == TRUE

Morevover GstValidateExecuteActionReturn is just a define

API:
    + gst_validate_action_set_done
    + GstValidateExecuteActionReturn

https://bugzilla.gnome.org/show_bug.cgi?id=739854
2014-11-25 19:41:00 +01:00
Thibault Saunier
4cbcb97258 validate: Add a GstValidateActionTypeFlag flag
Allowing us to define action types more in detail.
Keep backward compatibility, at least with the C API

https://bugzilla.gnome.org/show_bug.cgi?id=739854
2014-11-25 19:29:13 +01:00
Thibault Saunier
fcb0f20828 validate: Add a GstValidatePipelineMonitor subclass
We had quite a bit of code dedicated to handled GstPipeline monitoring
inside GstValidateBinMonitor, cleanly split that code into a new object
type

https://bugzilla.gnome.org/show_bug.cgi?id=740704
2014-11-25 19:29:13 +01:00
Thibault Saunier
057a864223 validate: Don't fail getting master report from a ghostpad without target 2014-11-20 12:09:26 +01:00
Thibault Saunier
6300fb9602 validate: Print current position even if we do not know the rate
That could cause gst-validate-launcher to wrongly concider tests
as timeout
2014-11-19 20:05:57 +01:00
Thibault Saunier
2be3c04b9b validate:scenario: Force clock sink for scenarios with a pause action 2014-11-19 17:59:26 +01:00
Thibault Saunier
7f8c0c2751 validate: Do not check if first buffer running time is 0
It can perfectly not be 0, so it makes no sense to check that.

https://bugzilla.gnome.org/show_bug.cgi?id=739965
2014-11-19 17:59:26 +01:00
Thibault Saunier
9255a8f876 pad-monitor: Give better details about segment mismatch issues 2014-11-16 18:27:32 +01:00
Thibault Saunier
4a2b9d6431 validate: Be more precise in issue type for wrong seqnum
Depending on the type of event where the bug occurs,
it is not the same issue type. That allows us to have
much precise reports, and better explain the user
where the issue stands.
2014-11-16 18:27:32 +01:00
Thibault Saunier
c77089cc62 validate: Fix a few annotation issues 2014-11-16 18:27:32 +01:00
Thibault Saunier
8c6803c467 validate: Add the notion of WAIT_MULTIPLIER for the wait action
Allowing the user to decide to wait more, or less, or even not wait
for the wait action to execute when running scenarios.
2014-11-16 18:27:32 +01:00
Thibault Saunier
1c2c0e63c2 validate:scenario: Report an EXECUTION_ERROR on action execution failure
If the action type handles a better error report type, it should just
return TRUE, and report its issue itself.
2014-11-04 17:33:09 +01:00
Edward Hervey
4814110a86 scenario: Allow set-property action to work much earlier
By default an action has no playback-time, this makes it actionable
immediatly.

When no playback-time is set on a set-property action, it will
be activated the moment the element is added in the pipeline.
2014-11-04 17:12:00 +01:00
Edward Hervey
6a86f7c1c9 validate-bin-monitor: Initialize local variable
Avoids segfaults when freeing them if they didn't get filled in
2014-10-31 16:01:52 +01:00
Mathieu Duponchelle
fa39e0358a validate-utils: downgrade ERROR to DEBUG.
This function is called in places where it is legit for it
to return NULL.
2014-10-30 15:39:01 +01:00
Ramprakash Jelari
eb47b1021f validate: Fix compiler warning about implicit enum type conversion
gst-validate-reporter.c:119:39: error: implicit conversion from enumeration type
      'GstValidateReportingDetails' to different enumeration type
      'GstValidateInterceptionReturn' [-Werror,-Wenum-conversion]
  GstValidateInterceptionReturn ret = GST_VALIDATE_SHOW_UNKNOWN;
                                ~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~
gst-validate-reporter.c:124:11: error: implicit conversion from enumeration type
      'GstValidateReportingDetails' to different enumeration type
      'GstValidateInterceptionReturn' [-Werror,-Wenum-conversion]
    ret = iface->get_reporting_level (reporter);
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gst-validate-reporter.c:127:10: error: implicit conversion from enumeration type
      'GstValidateInterceptionReturn' to different enumeration type
      'GstValidateReportingDetails' [-Werror,-Wenum-conversion]
  return ret;
  ~~~~~~ ^~~
2014-10-24 15:19:19 +02:00
Mathieu Duponchelle
6cf2d92b0f build: We install all headers system wide for now.
Will be fixed when the API is deemed stable enough
2014-10-22 14:16:45 +02:00
Mathieu Duponchelle
30aef5ba84 validate: rename GstValidateReportingLevel.
Removes the confusion with GstValidateReportLevel.

Modeled on GstDebugGraphDetails.
2014-10-21 23:41:04 +02:00
Thibault Saunier
6d0930bb36 validate: Verify that elements always send a segment before pushing EOS
EOS is some kind of data flow and thus a segment event should always be
pushed before the EOS is sent
2014-10-21 20:40:27 +02:00
Thibault Saunier
23d7df3788 validate: Properly check that the seqnum of the EOS is always properly set
In the pipeline, an EOS should always have the same seqnum of the
previous SEGMENT event that was received. If the segment is the result
of a seek, it should always be the same as the seek seqnum too.

+ (Mathieu Duponchelle): fix reporting and concatenation tests.
2014-10-21 20:37:23 +02:00
Thibault Saunier
34a9c36edc validate: Add support for text based override files
Allowing user to easily determine the severity of issue
types in a config file

https://bugzilla.gnome.org/show_bug.cgi?id=737852
2014-10-21 20:23:32 +02:00
Thibault Saunier
b0d39c1c45 validate: Remove unused method
gst_media_descriptor_add_frame is not used anywhere

https://bugzilla.gnome.org/show_bug.cgi?id=737852
2014-10-21 20:21:58 +02:00
Thibault Saunier
a3513fc952 validate: Move GstStructure file parsing into utils
So it can be reused, at least in GstValidate.
2014-10-21 20:21:52 +02:00
Thibault Saunier
8ec61ddac2 validate: report: Simplify the issue ID registering using GQuarks
+ Remove unused issue types

https://bugzilla.gnome.org/show_bug.cgi?id=737790
2014-10-21 20:21:42 +02:00