Commit graph

2622 commits

Author SHA1 Message Date
Jan Schmidt 0a479c3cdc tests: Use a different rate in a segment test.
Using a rate of 1.1 in the test is causing the test to
fail on 32-bit because ceil(1.1 * 10) can round to 12.

Instead use a rate 2.0 that can be expressed as floating
point number and doesn't trigger the problem.

https://bugzilla.gnome.org/show_bug.cgi?id=797154
2018-09-17 22:22:48 +10:00
Jan Schmidt 769ceac199 gstsegment: Add check for gst_segment_offset_running_time()
Add a check for gst_segment_offset_running_time() that values
are taken directly from the segment base if possible.
2018-09-11 22:21:09 +10:00
Jan Schmidt 5978e3b958 gstsegment: Handle positions before the segment properly
Fixes for gst_segment_position_from_running_time_full() when
converting running_times that precede the segment start (or
stop in a negative rate segment)

The return value was incorrectly negated in those cases.

Add some more unit test checks for those cases, and especially
for segments with offsets.
2018-09-11 22:21:02 +10:00
Tim-Philipp Müller f887db4ab1 bufferlist: fix abort due to underflow when creating 0-sized list
gst_buffer_list_new_sized(0) will cause an underflow in a calculation
which then makes it try to allocate huge amounts of memory, which
may lead to aborts.

https://bugzilla.gnome.org/show_bug.cgi?id=795758
2018-05-05 16:28:04 +02:00
Jan Alexander Steffens (heftig) 0b293cad89 gstinfo: fix debug levels being applied in the wrong order
Remove unneeded reapplication of patterns. Besides being
superfluous (gst_debug_reset_threshold already applies
patterns) it was also wrong and didn't stop checking patterns
after the first match (broken in 67e9d139).

Also fix up unit test which checked for the wrong order.

https://bugzilla.gnome.org/show_bug.cgi?id=794717
2018-04-05 20:01:16 +01:00
Olivier Crête 23b32d5600 queue: Ignore thresholds if a query is queued
The queue gets filled by the tail, so a query will always be the tail
object, not the head object. Also add a _peek_tail_struct() method to the
GstQueueArray to enable looking at the tail.

With unit test to prevent future regression.

https://bugzilla.gnome.org/show_bug.cgi?id=762875
2018-03-01 16:31:57 -05:00
Mathieu Duponchelle 8c10f1e2b4 gstaggregator: pads must inherit from #GstAggregatorPad
Document this, and take advantage of that fact to use
GstAggregator.srcpad.segment instead of GstAggregator.segment

https://bugzilla.gnome.org/show_bug.cgi?id=793942
2018-03-01 15:25:53 +01:00
Mathieu Duponchelle a567cc13a5 Revert "gstaggregator: pads must inherit from #GstAggregatorPad"
This reverts commit 9774b3775d.

Pushed by mistake
2018-03-01 01:15:34 +01:00
Mathieu Duponchelle 9774b3775d gstaggregator: pads must inherit from #GstAggregatorPad
Document this, and take advantage of that fact to use
GstAggregator.srcpad.segment instead of GstAggregator.segment

https://bugzilla.gnome.org/show_bug.cgi?id=793942
2018-03-01 00:39:50 +01:00
Tim-Philipp Müller bbf8f50cde queuearray: add _peek_tail() and _pop_tail()
API: gst_queue_array_pop_tail()
API: gst_queue_array_peek_tail()

These will be needed later for appsrc.
2018-02-19 15:44:04 +00:00
Alicia Boya García 65dcb2adbf gstbasesink: Include segment.offset in the computation of position
Position queries with GST_FORMAT_TIME are supposed to return stream
time.

gst_base_sink_get_position() estimates the current stream time on its
own instead of using gst_segment_to_stream_time(), but the algorithm
used was not taking segment.offset into account, resulting in invalid
values when this field was set to a non-zero value.

https://bugzilla.gnome.org/show_bug.cgi?id=792434
2018-02-16 10:35:14 -03:00
Tim-Philipp Müller f6b1533e7a tests: pipeline: try to make test_pipeline_reset_start_time more reliable
Occasionally this test would fail, especially if the system is under load,
because the position query would pick up the last position from the
last buffer timestamp which has a lower timestamp than what we're
looking for. The sleep is long enough, however. It's unclear to me why
exactly this happens but there seems to be some kind of scheduling
issue going on as the streaming thread floods the sink with buffers.

Let's throttle the fakesrc to 100 buffers per second and make the sink
sync to the clock to restore some sanity. It should be totally sufficient
to test what we want to test, and seems to make things reliable here.
2018-02-15 13:40:22 +00:00
Tim-Philipp Müller dd78aa27a4 tests: uri: fix build without -DGST_DISABLE_DEPRECATED
Must undefine it before including gst headers, since the test
tests deprecated API.
2018-02-15 12:11:55 +00:00
François Laignel 46b1a6e505 message: Add gst_message_writable_structure()
Add gst_message_writable_structure() to be able to add extra fields to
messages (and be on par with GstEvent).

https://bugzilla.gnome.org/show_bug.cgi?id=792928
2018-01-26 16:09:10 +02:00
Tim-Philipp Müller bce246f39f aggregator: rename _get_buffer() -> _peek_buffer() and _steal -> _pop
https://bugzilla.gnome.org/show_bug.cgi?id=791204
2018-01-23 09:44:44 +00:00
Tim-Philipp Müller c33e1224a7 tests: fakesink: make notify stress test work better on Windows
Set up all ten pipelines and preroll them first, and only set
them to playing to run wild after they're all set up. If we set
them to PLAYING directly and let those threads run wild, then
it might take ages (many seconds) for the other pipelines to
even get up and running, especially on machines with only one
or two cores, and operating systems that suck at scheduling.

Now the fakesink test takes 19 secs instead of 71 secs on a
single-cpu windows machine.
2018-01-11 19:57:13 +00:00
Tim-Philipp Müller a69dc71f79 tests: filesrc: more Windows fixes
Fix typo in newly-added windows uri test.
2018-01-11 19:32:08 +00:00
Tim-Philipp Müller db0c54c5c8 tests: systemclock: scale stress test threads according to number of cpus
Scale the number of threads used in the stress tests according to
the number of cores/cpus. We want some contention, but we also
don't want too much contention, as some operating systems are
better at handling 100 threads running wild on a single core
than others.
2018-01-11 18:39:50 +00:00
Tim-Philipp Müller 4a5aa8dba0 tests: filesrc: fix for windows
Location paths have backslashes on windows when converted from URI.
2018-01-11 14:56:42 +00:00
Tim-Philipp Müller c5e1dc4ee6 tests: abi: fix abi test on 64-bit Windows
Add header with structure sizes for 64-bit windows as well.
They're almost the same as on Linux, but it looks like things
like padding unions get aligned slightly differently so there
are a handful of differences:

 sizeof(GstGhostPad) is 528, expected 536
 sizeof(GstPad) is 512, expected 520
 sizeof(GstPadProbeInfo) is 64, expected 72
 sizeof(GstProxyPad) is 520, expected 528
2018-01-11 12:04:31 +00:00
Tim-Philipp Müller 361fbc3fdd tests: info: fix post init cat reg test on windows and with CK_FORK=no
The test checks that categories not covered by the pattern in the
GST_DEBUG string have debug level GST_LEVEL_DEFAULT set, but previous
tests mess with the default threshold, which made this test fail on
Windows or when run with CK_FORK=no. Fix this by resetting everything
at the beginning, and then also do a sanity check afterwards.
2018-01-11 11:38:53 +00:00
Håvard Graff fbbe6c646e meson: make check and tests build on Windows with msvc 2018-01-11 09:50:24 +00:00
Tim-Philipp Müller 252ce5a093 Skip gst_deinit() if gstreamer was not initialized properly
Can happen if an error occurs during option parsing, for example.

https://bugzilla.gnome.org/show_bug.cgi?id=781914
2017-12-24 16:21:38 +01:00
Jan Alexander Steffens (heftig) 1b02b76137 tests: multiqueue: Replace large test macro with function
Just a bit of cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:13 +01:00
Jan Alexander Steffens (heftig) 67a9ec6878 tests: multiqueue: Check we get CREATE+ENTER stream-statuses when adding pads
https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:06 +01:00
Tim-Philipp Müller 18fe36a286 basesrc: add buffer list support
Add a gst_base_src_submit_buffer_list() function that allows subclasses
to produce a bufferlist containing multiple buffers in the ::create()
function. The buffers in the buffer list will then also be pushed out
in one go as a GstBufferList. This can reduce push overhead
significantly for sources with packetised inputs (such as udpsrc)
in high-throughput scenarios.

The _submit_buffer_list() approach was chosen because it is fairly
straight-forward, backwards-compatible, bindings-friendly (as opposed
to e.g. making the create function return a mini object instead),
and it allows the subclass maximum control: the subclass can decide
dynamically at runtime whether to return a list or a single buffer
(which would be messier if we added a create_list virtual method).

https://bugzilla.gnome.org/show_bug.cgi?id=750241
2017-12-07 12:17:09 +00:00
Tim-Philipp Müller c26a802f5a tests: aggregator: fix caps leak in unit test 2017-12-06 20:58:42 +00:00
Tim-Philipp Müller d8e7fc40b1 harness: add gst_harness_take_all_data() + _take_all_data_as_{bytes,buffer}()
Convenience function to just grab all pending data
from the harness, e.g. if we just want to check if
it matches what we expect and we don't care about
the chunking or buffer metadata.

Based on patch by: Havard Graff <havard.graff@gmail.com>
2017-12-05 15:37:00 +00:00
Nirbheek Chauhan 7d1dabe020 meson: Use array syntax instead of .get() in tests 2017-12-05 12:27:18 +05:30
Tim-Philipp Müller cea9641fa9 aggregator: hook up to build system
https://bugzilla.gnome.org/show_bug.cgi?id=739010
2017-12-02 15:44:40 +00:00
Tim-Philipp Müller 39664da1f0 Move GstAggregator from -bad to core
Merge branch 'aggregator-move'

https://bugzilla.gnome.org/show_bug.cgi?id=739010
2017-12-02 15:27:22 +00:00
Stefan Sauer 917214ed91 tests: comment and logging cleanups for audiomixer and aggregator
Remove some references to 'collectpads'. Logs pads through the object variants.
Add some more comments. Remove a left over comment.
2017-12-02 15:10:27 +00:00
Stefan Sauer 00d6f46ff8 aggregator: add two more tests for a sequence of data
This verifies that we handle events and queries at the head of the queue and
then buffers.
2017-12-02 15:10:27 +00:00
Stefan Sauer fbe82b7fa1 aggregator: refactor the test helper
Make the test helpers use a queue. This lets us also test sequences of events,
queries and data.
2017-12-02 15:10:27 +00:00
Stefan Sauer 9efffd05e2 aggregator: test cleanup
Remove gst_init() from a few tests. Use _OBJECT variants in logging. Remove
arbitrary extra blank lines. Make push_event() more like push_buffer() - set
the event to NULL and add cleanup to _chain_data_clear().
2017-12-02 15:10:27 +00:00
Edward Hervey ab4dd3f577 check: Fix usage of dual probes
Using two (or more) probes on the same pad where one of the probe
returns HANDLED or DROP is tricky since the other probes might
not be called.

Instead use regular probes and a proper pad (the sinkpad already existed,
it only required to be activated and have a dummy chain function for
the events/buffers to be received/handled properly)
2017-12-02 15:10:27 +00:00
Sebastian Dröge 6bbd5b8dc5 aggregator: Fix leak in unit test
GST_PAD_PROBE_HANDLED means that we should've unreffed the probe data,
it was handled by us in one way or another.
2017-12-02 15:10:26 +00:00
Vineeth TM f42b7042d7 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2017-12-02 15:10:26 +00:00
Hyunjun Ko f6ec0f705e tests:aggregator: fix tc failure and correct check value
Failure by this commit 2dfa548f36, which is
to append hooks instead of prepend.
Because of this change, aggretated_cb is not called and leads to failure.

And correct to check flush stop value instead of flush start value

https://bugzilla.gnome.org/show_bug.cgi?id=757801
2017-12-02 15:10:26 +00:00
Olivier Crête 5be540eeae tests: Add test for seeking live pipelines
https://bugzilla.gnome.org/show_bug.cgi?id=745768
2017-12-02 15:10:26 +00:00
Olivier Crête 54556d81e3 tests: Make source live to re-enable aggregator timeout tests
The live mode is only enabled if one of the sources if live.

https://bugzilla.gnome.org/show_bug.cgi?id=745768
2017-12-02 15:10:26 +00:00
Reynaldo H. Verdejo Pinochet 53cb334281 aggregator: fix typo in test suite 2017-12-02 15:10:26 +00:00
Reynaldo H. Verdejo Pinochet 1bd000fb2b aggregator: add gap event handling unit test
https://bugzilla.gnome.org/show_bug.cgi?id=746249
2017-12-02 15:10:26 +00:00
Tim-Philipp Müller 1fe5f9db71 aggregator: use new gst_aggregator_pad_drop_buffer() 2017-12-02 15:10:26 +00:00
Thibault Saunier 5f176b724b aggregator: Hide GstAggregatorPad buffer and EOS fileds
And add a getter for the EOS.

The user should always use the various getters to access
those fields

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2017-12-02 15:10:26 +00:00
Sebastian Dröge 435a477f63 aggregator: Add a timeout parameter to ::aggregate()
When this is TRUE, we really have to produce output. This happens
in live mixing mode when we have to output something for the current
time, no matter if we have enough input or not.
2017-12-02 15:10:26 +00:00
Tim-Philipp Müller 344c85da76 tests: fix aggregator unit test after property renaming 2017-12-02 15:10:26 +00:00
Sebastian Rasmussen d391c9cfed tests/aggregator: Use correct type when setting property
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741495
2017-12-02 15:10:26 +00:00
Matthew Waters b890bff2fa tests/aggregator: add timeout handling test for the timeout parameter 2017-12-02 15:10:26 +00:00
Thibault Saunier 481476c439 aggregator: Avoid destroying sources we do not own
+ Unref the maincontext in a new dispose function
+ Make sure to remove all sources on dispose

https://bugzilla.gnome.org/show_bug.cgi?id=732445
2017-12-02 15:10:25 +00:00