Commit graph

1720 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
Sebastian Dröge
f7f8312812 segment: Convert function to macro in unit test to get proper line numbers on failures
https://bugzilla.gnome.org/show_bug.cgi?id=748316
2015-10-14 16:59:04 +03:00
Stefan Sauer
5b3cbbc494 tests: fix the tag test
The previous change (see bgo #756069) was causing us to free the same pointer
multiple times. If we actually get a sample back, the test fails, no need to
free anything in that case.
2015-10-05 21:29:49 +02:00
Vineeth TM
456ef2aa1d tests/gst-launch: Fix sample memory leak
When sample is got using gst_tag_list_get_sample_index, it should
be free'd.

https://bugzilla.gnome.org/show_bug.cgi?id=756069
2015-10-05 12:08:30 +01:00
Stefan Sauer
8487133114 controlpoint: change the padding to be of arch-independent size
The default padding I introduced in d4f81fb4e6 is
actually only 4 pointers and on 32bit platforms already smaller than the union.
Replace it with a fixed 64byte padding. Don't add the normal padding for now.

Fixes #755822
2015-09-30 17:31:58 +02:00
Stefan Sauer
d4f81fb4e6 controller: add the missing abi padding
While this technically is an abi break, we decided to do this:
1) the struct is documented to be internal
2) the struct is alloced and freed inside the library
3) there are no public methods that receive or return instances
4) the only code known to use this struct are classes containd here
2015-09-28 16:23:41 +02:00
Matthew Waters
d5ded15889 bin: implement context propagation when adding elements
When adding an element to a bin we need to propagate the GstContext's
to/from the element.

This moves the GstContext list from GstBin to GstElement and adds
convenience functions to get the currently set list of GstContext's.

This does not deal with the collection of GstContext's propagated
using GST_CONTEXT_QUERY.  Element subclasses are advised to call
gst_element_set_context if they need to propagate GstContext's
received from the context query.

https://bugzilla.gnome.org/show_bug.cgi?id=705579
2015-09-28 18:21:59 +10:00
Vivia Nikolaidou
44ba1565d9 segment: Replaced gst_segment_to_position with gst_segment_position_from_running_time
gst_segment_to_position might cause confusion, especially with the addition of
gst_segment_position_from_stream_time . Deprecated gst_segment_to_position
now, and replaced it with gst_segment_position_from_running_time.

Also added unit tests.
2015-09-26 00:00:08 +02:00
Vivia Nikolaidou
572c7c6b9a segment: Added unit tests for gst_segment_position_from_stream_time 2015-09-26 00:00:03 +02:00
Sebastian Dröge
697093c7d4 uri: Add test for correct absolute URI handling in gst_uri_from_string_with_base()
If the second parameter is an absolute URI, the base should have no effect and
the second parameter should be returned again.

https://bugzilla.gnome.org/show_bug.cgi?id=755134
2015-09-25 23:54:27 +02:00
Stian Selnes
2c60b7eb1f funnel: Fix racy state change
Iterator may need to be resynced, for instance if pads are released
during state change.

got_eos should be protected by the object lock of the element, not of
the pad, as is the case throughout the rest of the funnel code.

https://bugzilla.gnome.org/show_bug.cgi?id=755343
2015-09-24 12:14:57 +02:00
Havard Graff
64a152439c harness: don't crash when adding a sink-harness without h->sinkpad
https://bugzilla.gnome.org/show_bug.cgi?id=755511
2015-09-24 11:07:24 +01:00
Stian Selnes
ff9a78196c harness: Fix race for gst_harness_element_ref
In order for gst_harness_new_full to be MT-safe the increase and
decrease of HARNESS_REF must be MT-safe. This allows for creating
multiple harnesses from different threads wrapping the same element.

https://bugzilla.gnome.org/show_bug.cgi?id=754661
2015-09-07 11:31:33 +01:00
Thiago Santos
8a1f05865f tests: event: fix build failure
gst/gstevent.c:250:5: error: ‘for’ loop initial declarations are only
allowed in C99 or C11 mode
2015-08-26 09:29:05 -03:00
Vivia Nikolaidou
ee1bbe2f15 bin: Make sure we don't add/remove a bin to/from itself
Doing so would deadlock from trying to acquire the object lock twice

https://bugzilla.gnome.org/show_bug.cgi?id=754036
2015-08-25 10:19:44 +03:00
Nicolas Dufresne
900110c6dc basesrc-test: Fix race testing segment update
As this test is using a short sleep (GST_USECOND, which is 10ms
in microsecond), sometimes that EOS event is received before the
loop in basesrc have run _do_seek() and pushed the update segment.
To solve this issue, we wait for the initial segment (and flush it)
then we wait for the second segment before sending EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=753365
2015-08-20 07:49:02 -07:00
Edward Hervey
7f0e0ff3ca gstpad: Add a new GST_PROBE_HANDLED return value for probes
In some cases, probes might want to handle the buffer/event/query
themselves and stop the data from travelling further downstream.

While this was somewhat possible with buffer/events and using
GST_PROBE_DROP, it was not applicable to queries, and would result
in the query failing.

With this new GST_PROBE_HANDLED value, the buffer/event/query will
be considered as successfully handled, will not be pushed further
and the appropriate return value (TRUE or GST_FLOW_OK) will be returned

This also allows probes to return a non-default GstFlowReturn when dealing
with buffer push. This can be done by setting the
GST_PAD_PROBE_INFO_FLOW_RETURN() field accordingly

https://bugzilla.gnome.org/show_bug.cgi?id=748643
2015-08-15 17:00:12 +02:00
Thiago Santos
a1b9bb8eac tests: pad: tests for accept-caps default handling
Check if all the default 4 accept-caps possibilities are working:
subset or intersect check and query-caps or template caps comparisons.

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 08:56:53 -03:00
Edward Hervey
f2a26f2bd7 check: Rename states unit test
Makes it easier to differentiate from other modules states unit test
2015-08-14 11:10:37 +02:00
Tim-Philipp Müller
9b0287cfa4 tests: ignore new harness test binary 2015-08-11 11:09:24 +01:00
Vivia Nikolaidou
88f6334af6 datetime: accept just a time as ISO 8601 string and use today's date then
If no date and only a time is given in gst_date_time_new_from_iso8601_string(),
assume that it is "today" and try to parse the time-only string. "Today" is
assumed to be in the timezone provided by the user (if any), otherwise Z -
just like the behavior of the existing code.

https://bugzilla.gnome.org/show_bug.cgi?id=753455
2015-08-11 09:50:50 +01:00
Havard Graff
28100e0b6a harness: add _set_forwarding function
To be able to disable the slightly "magic" forwarding of the
necessary events between the harnesses.

Also introduce a new test-suite for GstHarness, that documents the
feature, and should hopefully expand into documenting most of the
features the harness possesses.

https://bugzilla.gnome.org/show_bug.cgi?id=752746
2015-08-09 16:02:37 +01:00
Tim-Philipp Müller
27fff1e0d6 tests: baseparse: fix buffer leak in unit test
Fixes make check-valgrind
2015-07-30 12:17:44 +01:00
Hyunjun Ko
9338f93494 adapter: unit test for new get_(buffer_)list 2015-07-08 18:58:52 +03:00
Hyunjun Ko
eaf4153668 meta: transform_func: return FALSE if not supported or failed
https://bugzilla.gnome.org/show_bug.cgi?id=751778
2015-07-07 13:40:17 +03:00
Havard Graff
ee63702d61 identity: refactor and add tests using GstHarness
Writing a test for unscheduling the gst_clock_id_wait inside the
identity element, found an invalid read, caused by removing the clock-id
when calling _unschedule instead of letting the code calling _wait remove
the clock-id after being unscheduled.

https://bugzilla.gnome.org/show_bug.cgi?id=752055
2015-07-07 13:05:34 +03:00