Commit graph

1499 commits

Author SHA1 Message Date
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
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
Vineeth T M
9d57165c33 baseparse: add reverse playback test in pull mode
add test for reverse playback in pull mode and compare
the buffers being received in sink chain to make sure
the playback is allright

https://bugzilla.gnome.org/show_bug.cgi?id=750783
2015-07-06 09:56:27 -04:00
Olivier Crête
f126094dce pad: Enforce NEED_PARENT flag also for chain
The check for the presence of the parent in the presence of
the NEED_PARENT flag was missing for the chain function. Also keep
a ref on the parent in case the pad is removed mid-chain.
2015-07-03 12:56:01 -04:00
Vineeth TM
1730038953 tests: caps: fix test_intersect_flagset failure
test_intersect_flagset fails because when caps is being
created, flags and mask are being cast to uint64 while
they should be uint. This results in invalid memory access
or a segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=751628
2015-06-29 13:47:31 +01:00
Thiago Santos
4dd8ad5561 tests: gstutils: fix wrong description of test element
It is a fakesink with request pads, not a source
2015-06-24 12:05:47 -03:00
Hyunjun Ko
7ecef53dbb bufferlist: add new api gst_buffer_list_copy_deep
https://bugzilla.gnome.org/show_bug.cgi?id=751420
2015-06-24 10:52:56 +02:00
Jonas Holmberg
fabe966b0a gstcheck: Print newline in message handler
The message handler is supposed to print a newline after the message
just like the default message handler.
2015-06-23 16:17:56 +01:00
Thiago Santos
c1a9a3424d tests: gstutils: add tests for gst_element_get_compatible_pad
Adds tests for gst_element_get_compatible_pad for when it has to
request pads.

Note that these tests don't cover the case when it has to request
a pad that already exists.

https://bugzilla.gnome.org/show_bug.cgi?id=751235
2015-06-22 17:18:43 -03:00
Nicolas Dufresne
a65cea7c69 gstprotection: Add missing namespace to macro
GST_PROTECTION_SYSTEM_ID_CAPS_FIELD was missing the GST_ namespace.
Add it before its too late.
2015-06-13 12:25:19 -04:00
Nicolas Dufresne
b5e4f7bd9d collectpads: Add negative DTS support
Make gst_collect_pads_clip_running_time() function also store the
signed DTS in the CollectData. This signed DTS value can be used by
muxers to properly handle streams where DTS can be negative initially.

https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-06-12 17:20:16 -04:00
Lazar Claudiu
cb2c141eac controller: Added absolute direct control binding, example and test
Fixes: 740502
API: gst_direct_control_binding_new_absolute
2015-06-12 10:07:24 +02:00
Tim-Philipp Müller
201b013fac tests: fakesink: fix string leak in unit test 2015-06-08 20:00:47 +01:00
Jan Schmidt
a198803bd6 basetransform: Split input buffer processing from output generation
Allow for sub-classes which want to collate incoming buffers or
split them into multiple output buffers by separating the input
buffer submission from output buffer generation and allowing
for looping of one of the phases depending on pull or push mode
operation.

https://bugzilla.gnome.org/show_bug.cgi?id=750033
2015-06-08 19:17:57 +10:00
Sebastian Dröge
c1393aff5c memory: Fix compiler warnings in unit test
gst/gstmemory.c:570:38: error: implicit conversion from enumeration type 'GstMapFlags' to different enumeration
      type 'GstLockFlags' [-Werror,-Wenum-conversion]
  fail_unless (gst_memory_lock (mem, GST_MAP_WRITE));
               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
2015-06-07 09:08:35 +02:00
Tim-Philipp Müller
0c80c41ade tests: fakesink: test notify::last-message and deep-notify::last-message
deep-notify::last-message seems to cause some problems, so disable for now.

https://bugzilla.gnome.org/show_bug.cgi?id=681642
2015-06-05 19:38:36 +01:00
Matthew Waters
e9c15d5321 memory: gst_memory_share may fail to exclusively lock the parent memory
Now that locking exclusively dows not always succeed, we need to signal
the failure case from gst_memory_init.

Rather than introducing an API or funcionality change to gst_memory_init,
workaround by checking exclusivity in the calling code.

https://bugzilla.gnome.org/show_bug.cgi?id=750172
2015-06-03 20:41:44 +10:00
Matthew Waters
eb71ee4040 buffer: locking memory exclusively may fail
Attempt to return a copy of the memory instead.

https://bugzilla.gnome.org/show_bug.cgi?id=750172
2015-06-03 20:41:44 +10:00
Matthew Waters
ad4569c893 miniobject: disallow a double write/exclusive lock
gst_memory_lock (mem, WRITE | EXCLUSIVE);
gst_memory_lock (mem, WRITE | EXCLUSIVE);

Succeeds when the part-miniobject.txt design doc suggests that this should fail:

  "A gst_mini_object_lock() can fail when a WRITE lock is requested and
  the exclusive counter is > 1. Indeed a GstMiniObject object with an
  exclusive counter 1 is locked EXCLUSIVELY by at least 2 objects and is
  therefore not writable."

https://bugzilla.gnome.org/show_bug.cgi?id=750172
2015-06-03 20:41:44 +10:00