Commit graph

520 commits

Author SHA1 Message Date
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
Thibault Saunier
bb93dbb9fb validate: Check all buffers when we have the info from MediaDescriptor
We now check that each buffer is the expected one for each buffer that
come into the decoder.

+ Fix some minor leaks in test-utils

https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:21:36 +02:00
Thibault Saunier
cd9a3640b2 validate:media-descriptor-parser: Add a way to create from a string
So it is simple to make use of it from the testsuite

https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:14:05 +02:00
Thibault Saunier
f793d06783 report: g_critical are CRITICAL issues!
https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:14:05 +02:00
Thibault Saunier
b3fa06c3c1 validate: MediaDescriptors: Add md5sum to buffer informations
In the media descriptor files, we now have the md5sum of the actual
content of encoded buffers so that we can check that the buffer content is
perfectly what is was supposed to be.

+ Fix the check of whether a frame is a keyframe in the string
  comparison (g_ascii_strcasecmp  return 0 if string matches)

https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:14:05 +02:00
Thibault Saunier
50273c42a9 validate: Move some method between GstMediaDescriptorParser and GstMediaDescriptor
So that method land where they actually belong.

https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:14:05 +02:00
Thibault Saunier
c5dfd9c8c8 validate: Add a way to pass a MediaDescriptor around monitors
And add an option in gst-validate so that the user can define what
media descriptor file to use.

https://bugzilla.gnome.org/show_bug.cgi?id=736138
2014-10-21 20:14:05 +02:00
Thibault Saunier
c8a99218de validate:media-descriptor: Handle stream with no tags
It was segfaulting before.
2014-10-21 20:14:05 +02:00
Thibault Saunier
8f5347c465 validate: Move some method between GstMediaDescriptorParser and GstMediaDescriptor
So that method land where they actually belong.
2014-10-21 20:14:05 +02:00
Mathieu Duponchelle
c542d9c6bc validate-report / reporter: rework the way we repeat issues.
+ runner: update reports count algorithm.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
5690a02e0a pad-monitor: mark the peer pad as EOS too.
When a sink pad gets EOS, its src pad monitor should also
be marked as EOS (helpful with issue concatenation).
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
0b1d00df25 validate-pad-monitor / runner: Check per-object reporting levels. 2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
167c29125d validate-report: Set conditions in which a report can't be master. 2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
582cebeae6 validate-report: Add a reporting level field and setter. 2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
030e7e8ba8 validate-runner: implement synthetic report.
+ Fix criticals logic in validate_runner_printf
+ Update padmonitor tests
+ Split validate_report_printf function.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
1993229993 validate-runner: Implement REPORT_NONE for global reporting.
Yeah that was tough. Helpful already though, for example:
GST_VALIDATE_REPORT_LEVEL=none,x:all gst-validate src name=x ! sink
will only report issues reported by the source.

+ Add test.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
0a1cdb2164 tests: Check monitors correctly determine their reporting level.
+ [API] gst_validate_reporter_get_reporting_level
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
5cb60060dc validate-runner / monitor: Let the user single out pads.
That's some pretty specific code but it should be helpful.
The following syntax can be used : element-name::pad-name.

+ Free return of gst_object_get_name.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
b21bb1ff34 validate-runner / reporter: Sanitize reports refcounting.
The previous code worked but was confusing, the runner didn't actually
take the ref it was releasing later.

+ Fix indentation.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
de554ba417 tests: Test reports refcounts.
+ Set the element monitor on the element as qdata.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
c943a75766 validate-monitor: Determine the reporting level at setup. 2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
1d7f15598f validate-runner: Add code to parse GST_VALIDATE_REPORT_LEVEL.
+ Extend the tests.
+ [API] gst_validate_runner_get_default_reporting_level
+ [API] gst_validate_runner_get_reporting_level_for_name
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
6ed125bfb1 validate-runner: report-level initial work.
+ Defines reporting levels and document them.
+ Add API to get the default level.
+ fix indentation.
+ fix some typos.
+ Add the beginning of a reporting test.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
6e08079f8b validate-pad-monitor: concatenate issues.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=735665

The process is to check for a similar report in intercept_report on
the pads of the upstream element, set that report as the master report
of the intercepted report, and return REPORTER_KEEP instead
of REPORTER_REPORT.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
f001777cc6 validate-reporter: Add some methods
+ gst_validate_reporter_get_reports
+ gst_validate_reporter_get_reports_count
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
222a517384 validate-report: Add the notion of master / shadow reports.
A master report is a report that has been detected by a monitor
to stem from the same issue. It thus contains a list of
"shadow reports" which it will browse when printing itself.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
b8ac717297 validate-report: Make the ref / unref functions safer. 2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
3e557ca92b validate-reporter: Add return value to intercept_report.
It will allow to drop, keep or report reports.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
6104701268 validate-pad-monitor: Reimplement reporter interface.
+ Do nothing there for now, except chain up.
2014-10-21 20:13:51 +02:00
Mathieu Duponchelle
fb90aa2ead validate-reporter: add gst_validate_reporter_get_report.
+ Add locking.
2014-10-21 20:13:51 +02:00
Thibault Saunier
26ef55d622 validate: Print position if it could properly be queried
Otherwize we will print meaningless garbage.
2014-10-13 16:30:05 +02:00