Commit graph

9 commits

Author SHA1 Message Date
Nirbheek Chauhan
d0e6c8a78c validate: Don't use sprintf + glib format modifiers
We do not have a way to know the format modifiers to use with string
functions provided by the system. `G_GUINT64_FORMAT` and other string
modifiers only work for glib string formatting functions. We cannot
use them for string functions provided by the stdlib. See:
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#glib-Basic-Types.description

```
 ../validate/plugins/flow/formatting.c: In function 'format_number':
../validate/plugins/flow/formatting.c:68:22: error: unknown conversion type character 'l' in format [-Werror=format=]
   sprintf (dest_str, "%" G_GUINT64_FORMAT, number);
                      ^~~
In file included from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/gtypes.h:32,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/galloca.h:32,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib.h:30,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/gstreamer-1.0/gst/gst.h:27,
                 from ../validate/plugins/flow/formatting.h:26,
                 from ../validate/plugins/flow/formatting.c:30:
/builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
 #define G_GUINT64_FORMAT "llu"
                            ^
../validate/plugins/flow/formatting.c:68:22: error: too many arguments for format [-Werror=format-extra-args]
   sprintf (dest_str, "%" G_GUINT64_FORMAT, number);
                      ^~~
../validate/plugins/flow/formatting.c:68:22: error: unknown conversion type character 'l' in format [-Werror=format=]
In file included from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/gtypes.h:32,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib/galloca.h:32,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/glib-2.0/glib.h:30,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/include/gstreamer-1.0/gst/gst.h:27,
                 from ../validate/plugins/flow/formatting.h:26,
                 from ../validate/plugins/flow/formatting.c:30:
/builds/nirbheek/cerbero/cerbero-build/dist/windows_x86_64/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
 #define G_GUINT64_FORMAT "llu"
                            ^
../validate/plugins/flow/formatting.c:68:22: error: too many arguments for format [-Werror=format-extra-args]
   sprintf (dest_str, "%" G_GUINT64_FORMAT, number);
                      ^~~
```

Needed for https://gitlab.freedesktop.org/gstreamer/cerbero/merge_requests/419
2020-02-27 19:32:21 +05:30
Thibault Saunier
db2acf1cdf validate:flow: Make field filtering in what is logged more generic
Instead of forcing it on event, allow specifying filters on anything
we log, meaning also buffers
2020-02-13 00:11:45 +00:00
Thibault Saunier
39d6c7760e validateflow: Add a logged-event-fields configuration 2020-02-13 00:11:45 +00:00
Thibault Saunier
5b82274f17 validate:flow: Add a way to set the types of events to log/ignore
Added two properties to the plugin:
     * ignored-event-types: A list of event types to be ignored when logging events
     * logged-event-types: A list of event types to be logged when logging events

This commits also moves the "ignored-event-fields" property to using a proper
GstValueList for the list of event fields to be taken into account, instead
of the home grown separated by comas list of string, making the API more
uniform.

This also adds a simple helper method: `gst_validate_utils_get_strv`
2020-02-04 16:09:36 -03:00
Edward Hervey
4f0bfcc7bb validate: Fix memory leaks
Various structures were being leaked.
2019-11-20 10:19:00 +01:00
Thibault Saunier
25a7173b22 validateflow: Add buffers-checksum option to log buffers data checksum 2019-06-26 12:09:03 -04:00
Thibault Saunier
b61cb56e20 validate-flow: Add an ignored-event-fields configuration
It replaces `record-stream-id` as it is a more generic way of doing
the same thing.
2019-03-11 18:14:23 -03:00
Edward Hervey
a750e3b540 validate: Include config.h before anything else
To avoid double-defines (such as GST_LEVEL_DEFAULT)
2019-03-04 15:20:49 +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