Commit graph

2547 commits

Author SHA1 Message Date
Tim-Philipp Müller
d93ebba58b meson: add option to disable tracer hooks 2017-07-05 13:27:48 +01:00
Tim-Philipp Müller
736efc2d9e tests: memory: skip test that depends on debug system if it's disabled 2017-07-05 13:19:00 +01:00
Tim-Philipp Müller
25bf82a187 meson: fix tests build with --werror
Need to pass -DGST_DISABLE_DEPRECATED to avoid warnings when
testing deprecated API such as gst_uri_construct().

Also remove #ifndef GST_DISABLE_DEPRECATED guard from header
file, we don't use those any more for functions, the
GST_DEPRECATED_FOR macro is enough.
2017-06-15 10:53:11 +01:00
Dimitrios Katsaros
688d79033f gsturi: Fixed incorrect escaping of path as a generic string
The gst_uri_construct function was escaping the location string
as a generic uri string. This is incorrect since the slash('/')
characters are reserved for use in this exact case. The patch
changes the escape_string function mode to handle the path correctly.

I have deleted the escape_string function since it is no longer being
used and have created a unit test for the function. I have also
deprecated this function in favour of the GstUri API.

https://bugzilla.gnome.org/show_bug.cgi?id=783787
2017-06-15 11:39:00 +03:00
Thibault Saunier
d4032d9e0f meson: Do not use path separator in test names
Avoiding warnings like:

    WARNING: Target "elements/audioamplify" has a path separator in its name.
2017-06-07 11:42:28 -04:00
Tim-Philipp Müller
fe5111e71d meson: make C++ compiler optional
It's only used to build tests to see if our headers are C++ clean.
2017-05-21 09:02:54 +01:00
Christoph Reiter
9bf46a1065 gst: ref_sink() some more floating references returned by g_object_new()
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 15:36:12 +03:00
Sebastian Dröge
daa98fc02a gst: Don't ref_sink() GstObject subclasses in instance_init/constructor
This is something bindings can't handle and it causes leaks. Instead
move the ref_sink() to the explicit, new() constructors.

This means that abstract classes, and anything that can have subclasses,
will have to do ref_sink() in their new() function now. Specifically
this affects GstClock and GstControlSource.

https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 10:40:37 +03:00
Tim-Philipp Müller
2bf0a98bcd meson: fix gstprintf test linking
Must link against gstprint helper lib to use private symbol.
2017-05-16 00:02:11 +01:00
Vincent Penquerc'h
8d32fbb714 tests: fix message leak in seek test
https://bugzilla.gnome.org/show_bug.cgi?id=780757
2017-04-19 13:39:46 +01:00
Olivier Crête
dd1f0f49ab value: Accept NULL as a structure
Some GstStructure properties default to NULL, so it should
be a supported value.

With unit test.
2017-04-10 12:37:12 -04:00
Tim-Philipp Müller
519d64881f Don't use deprecated g_object_newv()
Use g_object_new() instead which nowadays has a shortcut for the
no-properties check. It still does an extra GType check in the
function guard, but there's a pending patch to remove that
and it's hardly going to be a performance issue in practice,
even less so on a system that's compiled without run-time checks.

Alternative would be to move to the new g_object_new_properties()
with a fallback define for older glib versions, but it makes the
code look more unwieldy and doesn't seem worth it.

Fixes deprecation warnings when building against newer GLib versions.

https://bugzilla.gnome.org/show_bug.cgi?id=780903
2017-04-08 09:49:59 +01:00
Olivier Crête
7699b8a1bc test: Add test for serializing/deserializing NULL strings 2017-04-07 13:49:55 -04:00
Nicolas Dufresne
84f826a937 gstvalue: Add transformation to/from GValueArray
This allow transforming a GValue of type G_TYPE_VALUE_ARRAY to
and from GST_TYPE_ARRAY/LIST.

https://bugzilla.gnome.org/show_bug.cgi?id=753754
2017-03-24 13:30:45 -04:00
Vincent Penquerc'h
371fe0be65 value: fix union of int range and int when extending on a side
The internal representation uses bounds scaled by the step

Add tests to catch those cases
2017-03-20 14:09:55 +00:00
Thiago Santos
3c617f1ca1 tests: bin: add more tests for suppressed flags
Add tests to confirm flags are persisted even after removing
elements that have those suppressed flags
2017-03-11 11:19:33 -08:00
Jan Schmidt
d781d09d99 gstvalue: Do more checks when guessing at flagset strings
If guessing that a string matches a flagset, be more thorough
at checking that the string following a string of hex:hex:
actually looks like a flag set string. Add some unit tests
to catch more cases.

https://bugzilla.gnome.org/show_bug.cgi?id=779755
2017-03-09 12:09:57 +11:00
Vivia Nikolaidou
63775ac6e3 value: Add deserialization for arrays/lists outside GstStructures
This is mostly useful for properties of those types when used in
gst-launch or similar.

https://bugzilla.gnome.org/show_bug.cgi?id=777375
2017-02-23 21:00:16 +02:00
Tim-Philipp Müller
834fd18dfa bytereader: fix peek value when scanning for 00 00 01 with non-0 offset
We would add the offset a second time in _scan_for_start_code()
when we found a result, but it's already been added to the data
pointer at the beginning of _masked_scan_uint32_peek(), so the
peeked value would be wrong if the initial offset was >0, and
we would potentially read memory out-of-bounds.

Add unit test for all of this.

https://bugzilla.gnome.org/show_bug.cgi?id=778365
2017-02-22 11:07:24 +00:00
Julien Isorce
b66109abf7 tests: add 2 unit tests for non-flush seek with gstbaseparse
The unit test defines a test parse element that inherit from GstBaseParse.
The test pipeline is: fakesrc ! testparse ! fakesink sync=1

Before the fix b2c05cac8 the first new test would have fail because the
pipeline would have wait doing nothing just after proceeded the seek event.
The second new test would have fail because the pipeline would have
played the media instantly just after proceeded the seek event
(like if sync was FALSE on the sink).

https://bugzilla.gnome.org/show_bug.cgi?id=777780
2017-02-08 10:38:33 +00:00
Seungha Yang
15f2898e87 segment: Modifiy inside segment condition
There is a special case that segment_start == segment_stop == start.
It's inside of segment

https://bugzilla.gnome.org/show_bug.cgi?id=764707
2017-01-31 15:55:12 +01:00
Tim-Philipp Müller
0a1baf6d07 datetime: fix potential out-of-bound read on malformed datetime string
https://bugzilla.gnome.org/show_bug.cgi?id=777263
2017-01-15 11:53:41 +00:00
Nirbheek Chauhan
aefc8007c6 meson: Add several missing features from configure.ac
* -Wl,-Bsymbolic-functions
* HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID
* HAVE_POSIX_TIMERS
* HAVE_MONOTONIC_CLOCK
* HAVE_UINT128_T
* HAVE_LONG_LONG
* HAVE_PROCESS_H
* HAVE_GMP
* HAVE_GSL
* HAVE_DLADDR

Also, don't use prefix for checking functions, and only check msvc
functions on Windows.
2016-12-21 23:51:36 +05:30
Stefan Sauer
2cc2fd7b77 gststructure: simplify test
We can compare structures, that is what the caps fucntion that was used before
would call anyway.
2016-12-21 10:08:35 +01:00
Matthew Waters
ad40c5cd36 value: add structure intersect/union/is_subset/fixate implementations
Allows proper usage of structures in structures in caps.  Subtraction
is not implemented due to complications with empty fields representing
all possible values.

The only implementation that doesn't delegate to the already existing
GstStructure functions is the union function.

https://bugzilla.gnome.org/show_bug.cgi?id=775796
2016-12-15 13:39:57 +11:00
Matthew Waters
865247d32a tests/structure: add some more is_subset checks
Explicitly testing extra/missing fields and name differences
2016-12-15 13:07:08 +11:00
Tim-Philipp Müller
3d283665cc tests: meta: add test for gst_buffer_iterate_meta*()
https://bugzilla.gnome.org/show_bug.cgi?id=775727
2016-12-14 18:19:00 +00:00
Stefan Sauer
96304d613f gstvalue: add serialisation for GTypes
We need this in the GstTracerRecord. This will serialize GTypes to the typename
and vice versa.
2016-12-13 13:24:18 +01:00
Thibault Saunier
bd5d43e8f9 meson: Support building with Gst debug disabled 2016-12-09 17:57:10 -03:00
Seungha Yang
0494c173e0 uri: Add new uri API to get media fragments URI as table
As an usecase of URI fragment, it can indicate temporal or spatial
dimension of a media stream. To easily parse key-value pair,
newly added gst_uri_get_media_fragment_table () API will provide
the table of key-value pair likewise URI query.
See also https://www.w3.org/TR/media-frags/

https://bugzilla.gnome.org/show_bug.cgi?id=774830
2016-12-06 20:28:55 +00:00
Tim-Philipp Müller
8e4582946c meta: remove unnecessary padding for GstMetaInfo struct
This structure is always allocated by GStreamer, can't be
subclassed or extended, and is never allocated or used on
the stack, so we don't need any padding and can extend it
as we please.
2016-12-05 20:35:41 +00:00
Nirbheek Chauhan
ad592f86b6 meson: Add Autotools changes that weren't mirrored
commits:
a7d282d272
6fdb4df0f8
1aceebd67f
2016-11-28 19:28:27 +05:30
Edward Hervey
1b11ec676e check/pipeline: Make failure message more informative
This will provide maybe a bit more insight the next time it fails
2016-11-28 14:11:27 +01:00
Edward Hervey
170f77a669 check/memory: Don't leak the custom allocator 2016-11-28 14:02:23 +01:00
Edward Hervey
03cf764a00 check: Fix leak in queue2 test 2016-11-28 14:02:23 +01:00
Sebastian Dröge
a7d282d272 utils: Export linear regression calculation as public function
It is useful outside the GstClock code too.

https://bugzilla.gnome.org/show_bug.cgi?id=774916
2016-11-28 14:26:50 +02:00
Tim-Philipp Müller
0b6c1d1ddb tests: filesrc: init and clear GCond and mutex
Might otherwise leak on non-Linux systems.
2016-11-28 11:19:24 +00:00
Tim-Philipp Müller
6fdb4df0f8 tests: rewrite and enable dataurisrc test
Can't use playbin for core unit tests.

https://bugzilla.gnome.org/show_bug.cgi?id=774527
2016-11-28 11:19:15 +00:00
Tim-Philipp Müller
a837ff6581 Move dataurisrc element from -bad
https://bugzilla.gnome.org/show_bug.cgi?id=774527
2016-11-28 11:18:39 +00:00
Matthew Waters
3eb4896435 controllers: add new proxy control binding
Allows proxying the control interface from one property on one GstObject
to another property (of the same type) in another GstObject.

E.g. in a parent-child relationship, one may need to
gst_object_sync_values() on the child and have a binding (set elsewhere)
on the parent update the value.

Note: that this doesn't solve GObject property forwarding and must be
taken care of by the implementation manually or using GBinding.

https://bugzilla.gnome.org/show_bug.cgi?id=774657
2016-11-23 17:15:09 +11:00
Julien Isorce
47fd993d4d memory: log with GST_INFO instead GST_ERROR when subclass map failed.
Add unit test to ensure that.

It can be a normal execution path to do some map trials and there is
no need to worry the user in that case.

The application has to check the return value of gst_memory_map.

https://bugzilla.gnome.org/show_bug.cgi?id=765600
2016-11-21 21:06:31 +00:00
Nicolas Huet
9ae9a01fe2 tests: add unit test for gst_adapter_prev_pts_at_offset()
https://bugzilla.gnome.org/show_bug.cgi?id=765662
2016-11-11 18:18:23 +00:00
Victor Toso
cb9309f2a7 tests: Fix compile warning on mingw64
In file included from ../../libs/gst/net/gstntppacket.c:35:0,
                 from netclock-replay.c:25:
../../config.h:546:0: error: "__MSVCRT_VERSION__" redefined [-Werror]
 #define __MSVCRT_VERSION__ 0x0601

In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:9,
                 from netclock-replay.c:21:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/_mingw.h:220:0: note:
this is the location of the previous definition
 # define __MSVCRT_VERSION__ 0x0700

https://bugzilla.gnome.org/show_bug.cgi?id=774108
2016-11-09 19:44:07 +02:00
Jan Schmidt
5a5ae1be1f parse-launch: Support linking all pads with new operator
Introduce a new operator ':' - e.g. element1 ':' element2

For example, 'uridecodebin : encodebin' -
if the encodebin has multiple profiles compatible with the
decodebin, multiple links will be created.

With '!' , after one delayed link is successfully done, the
pad-added callback is disconnected.

https://bugzilla.gnome.org/show_bug.cgi?id=751450
2016-11-02 12:04:33 +11:00
Wonchul Lee
f80dfc9b06 element: Allow multiple conversion specifiers for request pads
This allows pad template names like "src_%u_%u", but it does not allow
multiple specifiers of string type %s as that would lead to ambiguities.

https://bugzilla.gnome.org/show_bug.cgi?id=761225
2016-11-01 20:29:03 +02:00
Tim-Philipp Müller
81a69d956d docs: remove app dev manual and plugin writer's guide
They have moved to gst-docs and will be maintained there in future.
2016-11-01 17:55:54 +00:00
Thibault Saunier
2be7e4758b meson: Make use of new environment object and set plugin path to builddir
- Properly set where to find gst-plugin-scanner
- Use GST_LOADING_WHITELIST so that only core plugins are used

Bump meson requirement to 0.35
2016-10-14 17:30:00 +02:00
Tim-Philipp Müller
65ed511c5e tests: remove unused valgrind stuff
Code was also checking the wrong define anyway.
2016-09-26 12:14:14 +01:00
Tim-Philipp Müller
accde6ea16 tests: parse-launch: looks clean nowadays, so re-enable for valgrind
Also, the valgrind bits weren't hooked up properly anyway,
checking the wrong define.
2016-09-26 12:12:12 +01:00
Carlos Rafael Giani
5de03542ea queue2: Fix watermark test
This carries over code for a similar test from multiqueue to ensure full
control over the dataflow while testing. (The previous attempt was racy
since the fill level changed without any thread sync with the test code.)

https://bugzilla.gnome.org/show_bug.cgi?id=771210
2016-09-17 10:00:34 +01:00