Commit graph

2640 commits

Author SHA1 Message Date
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
Thiago Santos
29c3b8b4d5 tests: gstbin: add tests for suppressed flags
Some simple tests to make sure it keeps working
2016-09-10 13:28:25 -03:00
Thibault Saunier
006add672e meson:tests: Bump timeout to 3 minutes
Basically we already have each test with a 20sec timeout,
and testsuite can last more than the default 30secs from
meson. 3 minutes is another arbitrary timeout but should
be good enough.
2016-09-09 09:38:21 -03:00
Tim-Philipp Müller
1b1459b0a6 tests: don't build misc subdir if both examples and benchmarks have been disabled
https://bugzilla.gnome.org/show_bug.cgi?id=770740
2016-09-02 23:22:17 +01:00
Carlos Rafael Giani
5988095f90 multiqueue: Add higher-resolution low/high-watermark properties
low/high-watermark are of type double, and given in range 0.0-1.0. This
makes it possible to set low/high watermarks with greater resolution,
which is useful with large multiqueue max sizes and watermarks like 0.5%.

Also adding a test to check the fill and watermark level behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=770628
2016-08-31 12:56:19 +03:00
Jan Schmidt
a95645eaba value: Implement can_intersect for GstFlagSet types
Make sure that gst_value_can_intersect returns TRUE
for GstFlagSet combinations that can successfully
intersect
2016-08-26 03:23:40 +10:00
Carlos Rafael Giani
db66cb51b3 queue2: Add higher-resolution low/high-watermark properties
low/high-watermark are of type double, and given in range 0.0-1.0. This
makes it possible to set low/high watermarks with greater resolution,
which is useful with large queue2 max sizes and watermarks like 0.5%.

Also adding a test to check the fill and watermark level behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=769449
2016-08-25 11:54:33 +03:00
Nirbheek Chauhan
b2f9808722 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-19 21:26:14 +01:00
Tim-Philipp Müller
e2cd6ffafc Remove old alloc tracing code now that we have a GstTracer-based replacement
It's been internal API only in 1.x.
2016-08-13 10:10:30 +01:00
Jan Schmidt
9fd2101b36 events: Implement the stream-group-done event
A new event which precedes EOS in situations where we
need downstream to unblock any pads waiting on a stream
before we can send EOS. E.g, decodebin draining a chain
so it can switch pads.

https://bugzilla.gnome.org/show_bug.cgi?id=768995
2016-07-25 20:22:20 +10:00
Carlos Rafael Giani
eead9cf827 message: Add redirect message
Redirection messages are already used in fragmented sources and in
uridecodebin, so it makes sense to introduce these as an official message
type.

https://bugzilla.gnome.org/show_bug.cgi?id=631673
2016-07-25 12:59:21 +03:00
Vincent Penquerc'h
1105caa805 message: new API for additional custom data to error messages
https://bugzilla.gnome.org/show_bug.cgi?id=756806
2016-07-22 14:16:34 +01:00
Jan Schmidt
b08b97c99a tests: Use gst_clock_wait_for_sync () for net client clock
Instead of looping, use the gst_clock_wait_for_sync() function
to give clocks up to 1 second to synchronise
2016-07-19 23:28:32 +10:00
Nirbheek Chauhan
6e01d03d90 benchmarks: Fix potential stack corruption in capsnego test
flavour_str is a non-const pointer that will be written to if the -f
option is passed
2016-07-11 14:18:21 +01:00
Edward Hervey
63f6f05d66 gst: New Stream listing/selection system
* GstStream
* GstStreamCollection
* GST_EVENT_SELECT_STREAMS
* GST_MESSAGE_STREAM_COLLECTION
2016-06-30 12:31:06 +02:00
Vincent Penquerc'h
08d30b05c6 tests: add a test for small ring buffer sizes
https://bugzilla.gnome.org/show_bug.cgi?id=767688
2016-06-21 10:20:21 +01:00
Tim-Philipp Müller
e452acb634 tests: gstobject: fix typo in test name 2016-06-20 11:34:49 +01:00
Sebastian Dröge
da46fe236b pad: Also check the number of segment events and if other serialized events and queries trigger segment updating too
https://bugzilla.gnome.org/show_bug.cgi?id=765049
2016-06-11 21:57:00 +03:00
Sebastian Dröge
c8cae6a94b pad: Add unit test for pad offset handling on src pads
https://bugzilla.gnome.org/show_bug.cgi?id=765049
2016-06-11 21:40:15 +03:00
Sebastian Dröge
8c7da1d426 adapter: Rename functions and implement new functions, update test
We don't do calculations with different units (buffer offsets and bytes)
anymore but have functions for:
1) getting the number of bytes since the last discont
2) getting the offset (and pts/dts) at the last discont

and the previously added function to get the last offset and its distance from
the current adapter position.

https://bugzilla.gnome.org/show_bug.cgi?id=766647
2016-06-10 09:49:33 +03:00
Edward Hervey
67ae0ad225 adapter: Add methods to query current offset
API: gst_buffer_prev_offset
API: gst_buffer_get_offset_from_discont

The gst_buffer_get_offset_from_discont() method allows retrieving the current
offset based on the GST_BUFFER_OFFSET of the buffers that were pushed in.

The offset will be set initially by the GST_BUFFER_OFFSET of
DISCONT buffers, and then incremented by the sizes of the following
buffers.

The gst_buffer_prev_offset() method allows retrievent the previous
GST_BUFFER_OFFSET regardless of flags. It works in the same way as
the other gst_buffer_prev_*() methods.

https://bugzilla.gnome.org/show_bug.cgi?id=766647
2016-06-10 09:49:33 +03:00
Guillaume Desmottes
d479eefde0 tests: plugin: remove feature refcount assert
This check fails if one, or more, tracers are loaded while running the
test. The new "leaks" tracer will be able to check for leaks anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=765052
2016-06-02 23:05:34 +01:00
Stefan Sauer
f2fd3bda2b gstobject: split up name tests
It is better to have separate tests:
1) the test name will tell what is broekn when the test fails
2) we still run the other tests when one assert fails
3) the tests are easier to understand
4) we don't rely on sie effect of previous actions
5) ...

Also ix the assertion message for the name checks (Gst -> fakeobject).
2016-05-30 13:45:02 +02:00
Nicolas Dufresne
850510f9e8 object: Add _set_name() test on parented object
This is not allowed, and set_name() should fail.

https://bugzilla.gnome.org/show_bug.cgi?id=766923
2016-05-26 15:36:52 -04:00
Nicolas Dufresne
1a5f79981c object: Check that name change are notified once
GObject allow calling g_object_notify() within set_property() and
won't notify it twice. As it was raised during review, add a unit test to
make sure.

https://bugzilla.gnome.org/show_bug.cgi?id=766923
2016-05-26 15:36:21 -04:00
Tim-Philipp Müller
ef1444cfe4 bin: emit deep-element-{added,removed} for children of newly-added/removed bin
https://bugzilla.gnome.org/show_bug.cgi?id=578933
2016-05-16 09:10:09 +01:00
Tim-Philipp Müller
81dec8cc4d bin: add "deep-element-added" and "deep-element-removed" signals
This means applications and bin sub-classes can easily track when
a new child element is added to the pipeline sub-hierarchy or
removed.

Currently doesn't signal deep added/removed for elements inside
a bin if a bin is added/removed.

https://bugzilla.gnome.org/show_bug.cgi?id=578933
2016-05-16 09:10:09 +01:00
Guillaume Desmottes
6deefac851 parse-launch: fix factory leak in test
We get 2 references one from gst_element_factory_find() and the other
from gst_plugin_feature_load().

https://bugzilla.gnome.org/show_bug.cgi?id=765976
2016-05-05 10:01:25 +03:00
Guillaume Desmottes
784ebb045e miniobject: fix ref count leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=765978
2016-05-05 10:00:23 +03:00
Guillaume Desmottes
30ee36e630 utils: fix element leak in find_common_root()
The root element was not unreffed when iterating over ancestors.

https://bugzilla.gnome.org/show_bug.cgi?id=765961
2016-05-04 12:03:53 +03:00
Guillaume Desmottes
8af52df23b pipeline: fix bus leak in seek test
gst_bus_add_signal_watch_full() keeps a ref on the bus which should
be released using gst_bus_remove_signal_watch().

https://bugzilla.gnome.org/show_bug.cgi?id=765903
2016-05-03 11:02:47 +03:00
Guillaume Desmottes
0e42f92a76 streamiddemux: fix list and event leaks in test
https://bugzilla.gnome.org/show_bug.cgi?id=765903
2016-05-03 11:02:47 +03:00
Guillaume Desmottes
d456f8e8d2 selector: fix pad leaks in tests
setup_input_pad() creates a new pad so we should unref it once we're
done.

https://bugzilla.gnome.org/show_bug.cgi?id=765903
2016-05-03 11:02:47 +03:00
Guillaume Desmottes
7c1a091404 filesrc: fix buffer leaks in tests
gst_check_setup_sink_pad() internally uses gst_check_chain_func() so we
should call gst_check_drop_buffers() when tearing down tests to free the
buffers which have been exchanged through the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=765903
2016-05-03 11:02:47 +03:00
Guillaume Desmottes
1064bdb06e fakesink: fix pipeline leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=765903
2016-05-03 11:02:47 +03:00
Guillaume Desmottes
1e297d7423 elementfactory: fix factory leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=765903
2016-05-03 11:02:47 +03:00
Guillaume Desmottes
391f767098 bin: fix leaks in unit tests
The test rely on bus being flushed when setting the bin to the NULL state which
is not the case. This apply only when setting the pipeline state to
NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=765720
2016-05-02 09:55:31 +03:00
Guillaume Desmottes
3146c12a67 pad: fix buffer leaks in tests
The buffer received through the pad have to be unreffed using
gst_check_drop_buffers().

https://bugzilla.gnome.org/show_bug.cgi?id=765719
2016-05-02 09:54:16 +03:00
Francisco Velazquez
57596ad48f tests: plugin: improve debug message
https://bugzilla.gnome.org/show_bug.cgi?id=764199
2016-04-17 18:40:53 +01:00
Carlos Rafael Giani
3bd5aeac52 multiqueue: Recheck buffering status after changing low threshold
https://bugzilla.gnome.org/show_bug.cgi?id=763757
2016-04-15 16:04:54 +03:00
Carlos Rafael Giani
a1d2f387c6 multiqueue: Recalculate fill level after changing high-threshold
This ensures the following special case is handled properly:

1. Queue is empty
2. Data is pushed, fill level is below the current high-threshold
3. high-threshold is set to a level that is below the current fill level

Since mq->percent wasn't being recalculated in step #3 properly, this
caused the multiqueue to switch off its buffering state when new data is
pushed in, and never post a 100% buffering message. The application will
have received a <100% buffering message from step #2, but will never see
100%.

Fix this by recalculating the current fill level percentage during
high-threshold property changes in the same manner as it is done when
use-buffering is modified.

https://bugzilla.gnome.org/show_bug.cgi?id=763757
2016-04-15 16:04:54 +03:00
Julien Isorce
7d0abcc032 tests: add PTHREAD_CFLAGS for make check to pass on OS X
Currently "make check" fails with:
"error: argument unused during compilation: '-pthread'"

PTHREAD_CFLAGS now contains -Qunused-arguments to fix that.
Explanation here: http://savannah.gnu.org/patch/?8186#comment21

https://bugzilla.gnome.org/show_bug.cgi?id=747954
2016-04-11 18:03:49 +01:00
Tim-Philipp Müller
86c0058ae5 tests: baseparse: make work with CK_FORK=no
https://bugzilla.gnome.org/show_bug.cgi?id=623469
2016-04-11 10:44:22 +01:00
Tim-Philipp Müller
1fa64722d0 tests: transform1: make test work with CK_FORK=no
We need to clear some global state and register a new test
basetransform subclass for each test because we do things
in class_init base on global state.

https://bugzilla.gnome.org/show_bug.cgi?id=623469
2016-04-11 10:36:44 +01:00
Tim-Philipp Müller
f9eb3b98f1 tests: collectpads: fix for CK_FORK=no
Reset global state when done, and unref sink pads too
in teardown function to make it valgrind clean.

https://bugzilla.gnome.org/show_bug.cgi?id=623469
2016-04-10 20:57:55 +01:00
Tim-Philipp Müller
71f554009d tests: streamiddemux: fix with CK_FORK=no
Clear global state when done.

https://bugzilla.gnome.org/show_bug.cgi?id=623469
2016-04-10 20:26:11 +01:00
Tim-Philipp Müller
4b9f2966fb tests: bufferpool: fix wrong assumptions about pointers and object lifecycles
The test assumed that if a buffer has the same pointer address as
before it is in fact the same mini object and has been re-used by
the pool. This seems to be mostly true, but not always. The buffer
might be destroyed and when a new buffer is created the allocator
might return the same memory that we just freed.

Instead attach a qdata with destroy notify function to buffer
instances we want to track to make sure the buffer actually
gets finalized rather than resurrected and put back into the pool.
2016-04-10 20:11:00 +01:00
Tim-Philipp Müller
636aa20f28 tests: don't run tracerrecord in valgrind for now
Because of the way we implement logging and adding/removing
log functions currently (we leak a GList on purpose) this
test leaks.
2016-04-08 13:28:06 +01:00
Tim-Philipp Müller
6e3fb7af52 element: add API to get property change notifications via messages
Be notified in the application thread via bus messages about
notify::* and deep-notify::* property changes, instead of
having to deal with it in a non-application thread.

API: gst_element_add_property_notify_watch()
API: gst_element_add_property_deep_notify_watch()
API: gst_element_remove_property_notify_watch()
API: gst_message_new_property_notify()
API: gst_message_parse_property_notify()
API: GST_MESSAGE_PROPERTY_NOTIFY

https://bugzilla.gnome.org/show_bug.cgi?id=763142
2016-04-08 13:27:59 +01:00
Sebastian Dröge
c78ff47a87 tests: Add C++ tests for the other INIT macros we have 2016-04-07 20:29:10 +03:00
Tim-Philipp Müller
e1f4c2ce61 tests: gstcpp: flesh out C++ test so we can add more bits
Like a check for GST_MAP_INFO_INIT.
2016-04-06 17:46:31 +01:00
Tim-Philipp Müller
40d89a6b4c tests: use catch-all includes for c++ gst libs include test
So we get any new header files as well as they're added.
2016-04-06 17:46:31 +01:00
Matthew Waters
e8c8c27ae8 utils: check the correct element's state on ghosting pads
Checking the current element's state when we're adding pads to
the parent element is checking the wrong thing.

Silences a 'attempting to add an inactive pad to a running element'
warning when adding a ghost pad to a running parent bin of the parent
bin of the element.

https://bugzilla.gnome.org/show_bug.cgi?id=764176
2016-04-06 23:26:41 +10:00
Thiago Santos
1967d56aea tests: pad: extra tests for pad pull probes
For BUFFER and IDLE probes

https://bugzilla.gnome.org/show_bug.cgi?id=761211
2016-03-28 10:59:12 -03:00
Matej Knopp
a7813adb1d pad: Add test for blocking pull probe
https://bugzilla.gnome.org/show_bug.cgi?id=761211
2016-03-28 10:55:54 -03:00
Linus Svensson
8db72e7df7 gstpad tests: Add a test for flush event only probes
https://bugzilla.gnome.org/show_bug.cgi?id=762330
2016-03-28 00:51:37 -03:00
Sebastian Dröge
d9a1cb21e4 valve: Fix unit test by sending caps before buffers
Unexpected critical/warning: gstpad.c:4400:gst_pad_push_data:<'':src> Got data flow before segment event

https://bugzilla.gnome.org/show_bug.cgi?id=763753
2016-03-25 12:05:41 +02:00
Sebastian Dröge
e8f58f5ba5 netclock: Link the replay example to GIO 2016-03-25 10:23:46 +02:00
Arun Raghavan
77b4bc44ba tests: Add some code to replay and analyse netclientclock
This takes readings in the form of ...

<local_1> <remote_1> <remote_2> <local_2>

... with one observation per line, and then replays it using the
netclientclock code.

The output is the statistics structure emitted by the netclientclock,
which can then be analysed and tuned once we get those readings for
potential edge-cases.

It should be possible to find some inputs with "bad" data and convert
this into a unit test for future tweaks to run against.
2016-03-25 12:58:57 +05:30
Havard Graff
1bc8d9f2ea valve: don't send sticky events as a direct response to upstream events
Also refactor the existing valve test to actually test the valve,
and not just test the EOS mechanism of a pad.

https://bugzilla.gnome.org/show_bug.cgi?id=763753
2016-03-24 14:50:50 +02:00
Vineeth TM
8cc3e908c3 gstreamer: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763020
2016-03-24 14:43:41 +02:00
Jan Schmidt
146e219d83 tests: Check multiqueue not-linked EOS handling
Add a test which checks that not-linked pads continue
to output data after linked pads have gone EOS

https://bugzilla.gnome.org/show_bug.cgi?id=763770
2016-03-18 21:21:44 +11:00
Víctor Manuel Jáquez Leal
c1f2775dcb gstbuffer: fix GstParentBufferMeta GType name
The alias define GST_TYPE_PARENT_BUFFER_META_API_TYPE is wrong and
breaks the usage of gst_buffer_get_parent_buffer_meta().

This patch fixes the GType alias and make another alias to keep the API
compatibility guarded by GST_DISABLE_DEPRECATED.

Also added a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=763112
2016-03-07 12:02:00 +01:00
Sebastian Dröge
82e529cea5 Revert "bus: change GstBusSource to hold a weak ref to GstBus"
This reverts commit 894c67e642.
2016-02-29 23:33:03 +02:00
Vineeth TM
15e0f6315f tests: ghostpad: Fix memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=762845
2016-02-29 09:48:36 +02:00
Thiago Santos
894c67e642 bus: change GstBusSource to hold a weak ref to GstBus
When holding a regular ref it will cause the GstBus to never
reach 0 references and it won't be destroyed unless the application
explicitly calls gst_bus_remove_signal_watch().

Switching to weakref will allow the GstBus to be destroyed.
The application is still responsible for destroying the
GSource.

https://bugzilla.gnome.org/show_bug.cgi?id=762552
2016-02-25 14:08:50 -03:00
Tim-Philipp Müller
93e006bd66 tests: fix indentation 2016-02-19 14:41:55 +00:00
Sebastian Dröge
0ba615848a Revert "pad: Add test for blocking pull probe"
This reverts commit 17d30e944b.

The PULL probe changes break various tests.
2016-02-18 11:43:04 +02:00
Matej Knopp
17d30e944b pad: Add test for blocking pull probe
https://bugzilla.gnome.org/show_bug.cgi?id=761211
2016-02-18 09:44:00 +02:00
Edward Hervey
8ae671cf1d check: Add test for checking scheduling reconfiguration with ghostpads
Showcases the regression introduced by this commit:
Commit: ab55ad7eaa

Author: Stian Selnes <stian@pexip.com>
Date:   Wed Jan 27 13:20:23 2016 +0100

ghostpad: Do nothing in _internal_activate_push_default
2016-02-17 15:26:41 +01:00
Havard Graff
87c2254b1d ghostpad: add some tests for activation
https://bugzilla.gnome.org/show_bug.cgi?id=761913
2016-02-17 12:26:12 +02:00
Sebastian Dröge
fd253ab1ab Revert "queue2: add overrun signal"
This reverts commit 8ae8b2723d.

It's not used anymore by anything and was considered a bad idea in general.
2016-02-16 19:11:59 +02:00
Thiago Santos
ac12ad076f benchmark: tracerserialize: add missing return statement
tracerserialize.c:117:1: error: control reaches end of
non-void function [-Werror=return-type]
2016-02-15 12:34:17 -03:00
Thiago Santos
5b64123c54 protection/harness/systemclock: move declaration out of for loop initialization
C90 compilers complain about it
error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode

Also run gst-indent on systemclock tests.
2016-02-15 12:33:46 -03:00
Stian Selnes
336c7bb69c harness: Fix MT issues when forwarding event/query to sink harness
https://bugzilla.gnome.org/show_bug.cgi?id=761910
2016-02-13 15:36:03 +00:00
Havard Graff
668b3215b8 testclock: add crank method
And use it inside GstHarness

API: gst_test_clock_crank()

https://bugzilla.gnome.org/show_bug.cgi?id=761906
2016-02-12 17:08:32 +00:00
Stian Selnes
2b0ff13d07 systemclock: Fix wait/unschedule race
Fixes a race where an entry is set to BUSY in
gst_system_clock_id_wait_jitter() and is UNSCHEDULED before
gst_system_clock_id_wait_jitter_unlocked() starts processing it. The
wakeup added by gst_system_clock_id_unschedule() must be cleaned up.

Two stress tests are added. One test that triggers the specific issue
described above. The second stresses the code path where a wait is
rescheduled because the poll returned early.

https://bugzilla.gnome.org/show_bug.cgi?id=761586
2016-02-10 08:59:33 -03:00
Thiago Santos
682516402d tests: extend the AM_TESTS_ENVIRONMENT from check.mak
To get the CK_DEFAULT_TIMEOUT defined for all tests

https://bugzilla.gnome.org/show_bug.cgi?id=761472
2016-02-05 19:11:10 -03:00
Vineeth TM
ca97a9882f tests:gstinfo: Fix string memory leak
info_fourcc test leaks string.

https://bugzilla.gnome.org/show_bug.cgi?id=761071
2016-01-25 09:41:41 -03:00
Tim-Philipp Müller
afaeec665a tests: info: make work without registry 2016-01-23 16:00:48 +00:00
Tim-Philipp Müller
63421675b1 tracer: rename GST_TRACER_PLUGINS env var to GST_TRACERS 2016-01-22 12:50:08 +00:00
Stefan Sauer
ec75b68984 tracerrecord: don't leak the spec structures
Change the gst_tracer_record_new() api to take the parameters the make the
spec structure directly. This allows us to own the top-level structure and
also collect the args so that we can take ownership of the sub-structures.

https://bugzilla.gnome.org/show_bug.cgi?id=760821
2016-01-22 10:07:26 +01:00
Stefan Sauer
a72368ebb3 test/tracerrecord: unref objects and free string 2016-01-21 08:25:24 +01:00
Florin Apostol
077db508a8 systemclock: tests: added stress test for async order
Keep inserting alarms at the beginning of the list. Due to
https://bugzilla.gnome.org/show_bug.cgi?id=760757
alarm thread will get confused and not serve them in order.
2016-01-20 13:47:20 +02:00
Stefan Sauer
bdc34bd61a tests/gst/info: Fix messages glist memory leak 2016-01-20 09:18:01 +01:00
Vineeth TM
78ab2b530b tests: tracerrecord: Fix messages glist memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=760821
2016-01-20 09:17:15 +01:00
Edward Hervey
71f39aa2ef benchmarks: Disable tracerserialize benchmark on GST_DISABLE_GST_DEBUG
no gst-debugging => no tracer logging (and no pony either)
2016-01-19 11:12:27 +01:00
Tim-Philipp Müller
eb4c5498b5 value: fail flag deserialization on invalid flag names 2016-01-18 19:39:11 +00:00
Tim-Philipp Müller
fb4b673c76 tests: structure: fix wrong flag name in deserialization test
There is no GST_SEEK_FLAGS_NONE only GST_SEEK_FLAG_NONE (but
the deserializer silently skips bad flag names currently).
2016-01-18 19:39:05 +00:00
Stefan Sauer
83d7dbb393 benchmark: improve script
Use a temp file for the log and fix one env-var.
2016-01-16 21:24:19 +01:00
Tim-Philipp Müller
8b88fc487f gst.h: Don't spew warnings if GST_USE_UNSTABLE_API is not defined
Only hide GstTracer and GstTracerRecord API behind GST_USE_UNSTABLE_API,
but don't spew any warnings, otherwise everyone has to define this
to avoid compiler warnings.

This reverts parts of commit 89ee5d948d.
2016-01-16 16:00:16 +00:00
Stefan Sauer
7801a46e5f benchmarks: update the tracer benchmark and add a shell benchmark 2016-01-16 13:31:51 +01:00
Stefan Sauer
89ee5d948d tracer: add a GFlag for the tracer scope
Port all tracers. Add the GST_USE_UNSTABLE_API flag to the internal CFLAGS so
that we don't have to specify this for gir, docs, mkenum, ...
2016-01-16 13:31:51 +01:00
Stefan Sauer
10b78d872b tracerrecord: add a log record class
We use this class to register tracer log entry metadata and build a log
template. With the log template we can serialize log data very efficiently.
This also simplifies the logging code, since that is now a simple varargs
function that is not exposing the implementation details.

Add docs for the new class and basic tests.

Remove the previous log handler.

Fixes #760267
2016-01-15 21:54:01 +01:00
Stefan Sauer
fff9680c93 benchmark: fix copy'n'past of the file-description comment 2016-01-08 23:35:53 +01:00
Stefan Sauer
bb40a18413 benchmark: add a benchmark for bgo/760267
Big suprise - GstStructure is faster than GVariant.
2016-01-08 23:13:29 +01:00
Tim-Philipp Müller
4febebb962 info: add buffer list support to GST_PTR_FORMAT 2016-01-08 19:25:24 +00:00
Aleksander Wabik
90318900a1 tests: queue2: add test for fill level arithmetic overflow
https://bugzilla.gnome.org/show_bug.cgi?id=755971
2016-01-06 20:00:46 +00:00
Tim-Philipp Müller
4e437a564d tests: value: test buffer serialisation/deserialisation more thoroughly
Tests data/strings as well, not just that we received
something non-NULL back.
2015-12-31 12:21:12 +00:00
Thiago Santos
1751835838 tests: funnel: remove state change from stress tests
Changing states up and down while buffers are being pushed is not
a valid use case. If a pad is deactivated and reactivated during
a buffer push it is racy with the check of pushed sticky events
and the actual chainfunction call. As it might call the chain
without noticing the peer pad lost its previous sticky events.

https://bugzilla.gnome.org/show_bug.cgi?id=758340
2015-12-04 17:26:02 -03:00
Luis de Bethencourt
d0624eb945 docs: update gst-launch-0.10 lines
Update references to gst-launch-0.10 to gst-launch-1.0
2015-11-19 17:25:01 +00:00
Heinrich Fink
87691d0280 systemclock: Add test for gst_clock_get_resolution
In a series of time measurements, the diff between now and previous
timestamps is either 0 or at least as long as get_resolution returned.

https://bugzilla.gnome.org/show_bug.cgi?id=758012
2015-11-13 09:23:44 +01:00
Miguel París Díaz
b09e9592ec pad: test for checking the order of the probe calls
https://bugzilla.gnome.org/show_bug.cgi?id=757197
2015-11-11 14:45:19 +01:00
Philippe Normand
8ae8b2723d queue2: add overrun signal
Notifies that the queue2 is full, same as queue does

https://bugzilla.gnome.org/show_bug.cgi?id=733959
2015-11-06 12:32:10 -03:00
Thiago Santos
533d0ac7f1 pad: tests for accept-caps handling with proxy pads
Adds 3 new tests for testing accept-caps behavior with
proxy-caps pads.

1) A scenario where there is no proxy. The caps should be compared to the
template caps of the pad

2) A scenario where there is a compatible pad. The caps should be compared
to the proxied pad caps (and also with the template)

3) A scenario where there is an incompatible proxy pad. No caps should be
possible at all.

https://bugzilla.gnome.org/show_bug.cgi?id=754112
2015-11-06 11:11:11 -03:00
Florin Apostol
63fa09fc4d uri: tests: added unit test for streams ending in .. without following /
https://bugzilla.gnome.org/show_bug.cgi?id=757065
2015-10-24 20:32:53 +03:00
Vivia Nikolaidou
6ff8fdfc47 segment: Add _full variants of all stream/running_time from/to segment position functions
See formula clarifications in design docs for calculation details.

https://bugzilla.gnome.org/show_bug.cgi?id=756564
2015-10-23 15:50:38 +03:00
Vivia Nikolaidou
45f0f354ac segment: Correct stream_time calc for negative applied rate
Updated gst_segment_position_from_stream_time and gst_segment_to_stream_time to reflect correct calculations for the case when the applied rate is negative.

Pasting from design docs:

===============================
Stream time is calculated using the buffer times and the preceding SEGMENT
event as follows:

    stream_time = (B.timestamp - S.start) * ABS (S.applied_rate) + S.time

For negative rates, B.timestamp will go backwards from S.stop to S.start,
making the stream time go backwards.
===============================

Therefore, the calculation for applied_rate < 0 should be:

    stream_time = (S.stop - B.timestamp) * ABS (S.applied_rate) + S.time

and the reverse:

    B.timestamp = S.stop - (stream_time - S.time) / ABS (S.applied_rate)

https://bugzilla.gnome.org/show_bug.cgi?id=756810
2015-10-20 10:43:07 +03:00