Commit graph

2496 commits

Author SHA1 Message Date
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
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
Vineeth TM
215cfcf993 gstreamer: Fix memory leaks when context parse fails
When g_option_context_parse fails, context and error variables are not getting free'd
which results in memory leaks. Free'ing the same.

And replacing g_error_free with g_clear_error, which checks if the error being passed
is not NULL and sets the variable to NULL on free'ing.

https://bugzilla.gnome.org/show_bug.cgi?id=753851
2015-10-02 17:31:11 +03: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
3037172f48 tests: fix the manual tests by setting the right env-vars 2015-09-28 16:46:14 +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
Stefan Sauer
6e7915d5cd tests/examples: add a demo for the interpolation control source modes
This is in preparation for new modes to be added. In particullar it demonstrates
how the cubic splines overshoot the range.
2015-09-27 11:45:29 +02: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
Vineeth TM
fcdfcbd618 downloadbuffer, benchmarks: fix error leaks in failure code paths
https://bugzilla.gnome.org/show_bug.cgi?id=755019
2015-09-15 18:21:58 +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
Sebastian Dröge
8d77759834 ptp: Initial implementation of a PTP clock
GstPtpClock implements a PTP (IEEE1588:2008) ordinary clock in
slave-only mode, that allows a GStreamer pipeline to synchronize
to a PTP network clock in some specific domain.

The PTP subsystem can be initialized with gst_ptp_init(), which then
starts a helper process to do the actual communication via the PTP
ports. This is required as PTP listens on ports < 1024 and thus
requires special privileges. Once this helper process is started, the
main process will synchronize to all PTP domains that are detected on
the selected interfaces.

gst_ptp_clock_new() then allows to create a GstClock that provides the
PTP time from a master clock inside a specific PTP domain. This clock
will only return valid timestamps once the timestamps in the PTP domain
are known. To check this, the GstPtpClock::internal-clock property and
the related notify::clock signal can be used. Once the internal clock
is not NULL, the PTP domain's time is known. Alternatively you can wait
for this with gst_ptp_clock_wait_ready().

To gather statistics about the PTP clock synchronization,
gst_ptp_statistics_callback_add() can be used. This gives the
application the possibility to collect all kinds of statistics
from the clock synchronization.

https://bugzilla.gnome.org/show_bug.cgi?id=749391
2015-06-03 13:55:28 +02: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
Jan Schmidt
58e5cd2695 gstvalue: Implement gst_value_is_subset() for flagsets 2015-06-03 00:48:17 +10:00
Edward Hervey
c5a3e8db37 check: Use GST_CHECK_MAIN macro 2015-06-02 16:33:48 +02:00
Tim-Philipp Müller
c991c64fb2 tests: fix some leaks in new flagset checks 2015-05-30 13:02:36 +01:00
Jan Schmidt
f9e5178dd1 gstvalue: Add GstFlagSet type
GstFlagSet is a new type designed for negotiating sets
of boolean capabilities flags, consisting of a 32-bit
flags bitfield and 32-bit mask field. The mask field
indicates which of the flags bits an element needs to have
as specific values, and which it doesn't care about.

This allows efficient negotiation of arrays of boolean
capabilities.

The standard serialisation format is FLAGS:MASK, with
flags and mask fields expressed in hexadecimal, however
GstFlagSet has a gst_register_flagset() function, which
associates a new GstFlagSet derived type with an existing
GFlags gtype. When serializing a GstFlagSet with an
associated set of GFlags, it also serializes a human-readable
form of the flags for easier debugging.

It is possible to parse a GFlags style serialisation of a
flagset, without the hex portion on the front. ie,
+flag1/flag2/flag3+flag4, to indicate that
flag1 & flag4 must be set, and flag2/flag3 must be unset,
and any other flags are don't-care.

https://bugzilla.gnome.org/show_bug.cgi?id=746373
2015-05-25 16:23:33 +10:00
Stefan Sauer
b8c6ebd0f2 gstobject: add gst_object_has_as_ancestor and deprecate previous function
The old gst_object_has_ancestor will call the new code. This establishes the
symetry with the new gst_object_has_as_parent.

API: gst_object_has_as_ancestor()
2015-05-15 13:55:19 +02:00
Stefan Sauer
3492105a06 gstobject: rename gst_object_has_parent to gst_object_has_as_parent
This avoid confusion with a potential punction that check if a gstobject has-a
parent.

API: gst_object_has_as_parent()
2015-05-15 13:45:18 +02:00
Tim-Philipp Müller
6386934b3f tests: remove some pointless ancient code examples 2015-04-28 20:07:40 +01:00
Tim-Philipp Müller
8e6561be91 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 17:49:44 +01:00
Tim-Philipp Müller
a0f2e9ec2a tests: printf: add unit test for %%
https://bugzilla.gnome.org/show_bug.cgi?id=748414
2015-04-24 15:19:26 +01:00
Tim-Philipp Müller
cde5a6fea3 tests: define GST_CHECK_TEST_ENVIRONMENT_BEACON 2015-04-23 15:55:44 +01:00
Prashant Gotarne
6237314ee0 test: memory: Added test to verify the allocation params
New test added to verify the allocation params for the memory

https://bugzilla.gnome.org/show_bug.cgi?id=748277
2015-04-23 13:41:27 +01:00
Jason Litzinger
6aee4af034 tests: info: add test case to reproduce infinite loop
gst_debug_unset_threshold_for_name() used to go into an
infinite loop when there was more than one category in
the list.  This test captures the problem by failing
via timeout.

https://bugzilla.gnome.org/show_bug.cgi?id=748321
2015-04-23 11:21:22 +01:00
Tim-Philipp Müller
41a1d1a416 tests: error out if test environment is not actually set up properly
https://bugzilla.gnome.org//show_bug.cgi?id=747624
2015-04-22 10:11:51 +01:00
Tim-Philipp Müller
ff71bed31c tests: protection: fix leak in unit test 2015-04-18 12:28:15 +01:00
Alex Ashley
abdafb0d64 protection: add GstProtectionMeta to support protected content
In order to support some types of protected streams (such as those
protected using DASH Common Encryption) some per-buffer information
needs to be passed between elements.

This commit adds a GstMeta type called GstProtectionMeta that allows
protection specific information to be added to a GstBuffer. An example
of its usage is qtdemux providing information to each output sample
that enables a downstream element to decrypt it.

This commit adds a utility function to select a supported protection
system from the installed Decryption elements found in the registry.
The gst_protection_select_system function that takes an array of
identifiers and searches the registry for a element of klass Decryptor that
supports one or more of the supplied identifiers. If multiple elements
are found, the one with the highest rank is selected.

This commit adds a unit test for the gst_protection_select_system
function that adds a fake Decryptor element to the registry and then
checks that it can correctly be selected by the utility function.

This commit adds a unit test for GstProtectionMeta that creates
GstProtectionMeta and adds & removes it from a buffer and performs some
simple reference count checks.

API: gst_buffer_add_protection_meta()
API: gst_buffer_get_protection_meta()
API: gst_protection_select_system()
API: gst_protection_meta_api_get_type()
API: gst_protection_meta_get_info()

https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-18 12:24:06 +01:00
Alex Ashley
0f36b16a29 event: add new GST_EVENT_PROTECTION
In order for a decrypter element to decrypt media protected using a
specific protection system, it first needs all the protection system
specific  information necessary (E.g. information on how to acquire
the decryption keys) for that stream.

The GST_EVENT_PROTECTION defined in this commit enables this information
to be passed from elements that extract it (e.g. qtdemux, dashdemux) to
elements that use it (E.g. a decrypter element).

API: GST_EVENT_PROTECTION
API: gst_event_new_protection()
API: gst_event_parse_protection()

https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-18 12:04:29 +01:00
Tim-Philipp Müller
7fa81b5352 tests: info: fix unit test when run with GST_DEBUG=*:9
Only save the messages we're interested in and expecting.
When run with *:9 we might get additional TRACE level
messages from other categories and then we don't end up
with the number of messages we expect.
2015-04-18 12:01:54 +01:00
Tim-Philipp Müller
072b1c6aba tests: pad: fix buffer leak in new blocking_with_probe_type_idle test 2015-04-18 12:01:54 +01:00
Tim-Philipp Müller
0759058896 tests: pad: fix invalid memory access in debug log message
The string we put in the buffer is not NUL-terminated, so
don't try to print that via %s in a debug log message.
2015-04-18 12:01:54 +01:00
Thiago Santos
d4d161a282 tests: pad: test that idle probe will block
This tests add an idle probe on an idle pad from a separate thread
so that the callback is called immediatelly. This callback will sit
still and then we try to push a buffer on this same pad. It verifies
that the idle probe blocks data passing

https://bugzilla.gnome.org/show_bug.cgi?id=747852
2015-04-16 11:45:24 -03:00
Vincent Penquerc'h
a3b42ec42a bin: undo upward state changes on children when a child fails
When a bin changes states upwards, and a child fails to change,
any child that was already switched will not be reset to its
original state, leaving its state inconsistent with the bin,
which does not change state due to the failure.

If the state change was from NULL to READY, it means that deleting
this bin will cause those children to be deleted while not in
NULL state, which is a Bad Thing. For other upward changes, it
is less of a problem, as a subsequent switch back to NULL will
cause an actual downwards change on those inconsistent elements,
albeit from the "wrong" state.

We now reset state to the original one when a child fails.

Includes unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=747610
2015-04-15 16:00:21 +01:00
Suhwang Kim
be6d3e9255 tests: clock: fix test clock name
Don't call the slave test clock "Master".

https://bugzilla.gnome.org/show_bug.cgi?id=746430
2015-04-15 09:31:11 +01:00
Edward Hervey
0865bc02ea tests: Use AM_TESTS_ENVIRONMENT
Needed by the new automake test runner
2015-04-08 16:08:24 +02:00
Tim-Philipp Müller
fd67f40e4d tests: multiqueue: add test to make sure initial events go through without buffers 2015-04-05 16:47:26 +01:00
Tim-Philipp Müller
fe455d1330 tests: queue: check that the initial events are sent on immediately
Add a check that makes sure stream-start, caps, and segment events
are passed on by queue without delay, i.e. even if no buffer is
sent.
2015-04-05 16:11:03 +01:00
Tim-Philipp Müller
5deb4f658e pad: allow probes to remove the data item whilst returning PROBE_OK
Use case: we want to block the source pad of a leaky queue and
drop the buffer that causes the block. If we return PROBE_DROP
then the buffer gets dropped, but we get called again. If we
return PROBE_OK we can't easily drop the buffer. If we just
replace the item into the GstPadProbeInfo structure with NULL,
GStreamer will push a NULL buffer to the next element when we
unblock the pad probe. This patch ensures it doesn't do that.

https://bugzilla.gnome.org/show_bug.cgi?id=734342
2015-04-03 00:07:26 +01:00
Prashant Gotarne
b1c59a17cc test: filesink: add tests for buffers with multiple memory blocks
Update test_seeking testcase to verify the render and render_list
virtual method handle buffers and buffer list containing multiple
memory blocks correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=747223
2015-04-02 09:54:08 +01:00
Prashant Gotarne
714d8e58e3 tests: filesink: add check for render_list virtual method
GstFileSink implements the render_list virtual method to render
a list of buffers. Update the test_seeking test case to also
check the render_list method implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=747100
2015-04-01 12:31:15 +01:00
Luis de Bethencourt
ae0b2ec46b tests: check location isn't truncated
Test covering the recent commit where location='".abc' won't get truncated
to '.ab' anymore

https://bugzilla.gnome.org/show_bug.cgi?id=688625
2015-03-27 17:19:02 +00:00
Luis de Bethencourt
555e0211c8 gstvalue: only unwrap string delimited with "
Don't unwrap strings that start but don't finish with a double quote. If a
string is delimited by two quotes we unescape them and any special characters
in the middle (like \" or \\). If the first character or the last character
aren't a quote we assume it's part of an unescaped string.

Moved some deserialize_string unit tests because we don't try to unwrap strings
missing that second quote anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=688625
2015-03-27 17:18:23 +00:00
Thiago Santos
a041d8862d baseparse: only post 'no valid frames' error if buffers were received
Otherwise baseparse will consider empty streams to be an error while
an empty stream is a valid scenario. With this patch, errors would
only be emitted if the parser received data but wasn't able to
produce any output from it.

This change is only for push-mode operation as in pull mode an
empty file can be considered an error for the one driving the
pipeline

Includes a unit test for it

https://bugzilla.gnome.org/show_bug.cgi?id=733171
2015-03-26 12:25:57 -03:00
Jose Antonio Santos Cadenas
3e8e0a7065 tee: Add allow-not-linked property
This property avoids not linked error when all the pads are unlinked
or when there are no source pads. This is useful in dynamic pipelines
where it can happen that for a short time there are no pads at all or
all downstream pads are not linked yet.

https://bugzilla.gnome.org/show_bug.cgi?id=746436
2015-03-26 10:46:26 +01:00
Thiago Santos
150e8a5c97 tests: input-selector: new tests for EOS handling
3 new tests:

1) Tests that a stream that is empty (just an EOS event)
   on inactive pad doesn't get through and tamper
   with the active pad that still has data

2) Tests that a stream that is shorter than the active one
   (pushes EOS earlier) doesn't has its EOS pushed

3) Tests that switching to an inactive stream that has received
   EOS will make input-selector push EOS

https://bugzilla.gnome.org/show_bug.cgi?id=746518
2015-03-24 09:13:57 -03:00
Thiago Santos
92d2351b2e tests: selector: remove weird semicolons at the end of test functions
Even though it works, it is not needed and seems more natural
to not have semicolons at the end of function declarations

https://bugzilla.gnome.org/show_bug.cgi?id=746518
2015-03-24 08:22:26 -03:00
Wim Taymans
bc282da83c segment: remove the bounds check from _to_running_time_full()
Do not do any checks for the start/stop in the new
gst_segment_to_running_time_full() method, we can let this be done by
the more capable gst_segment_clip() method. This allows us to remove the
enum of results and only return the sign of the calculated running-time.
We need to put the old clipping checks in the old
gst_segment_to_running_time() still because they work slightly
differently than the _clip methods.

See https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-20 09:00:47 +01:00
Wim Taymans
edf484ab6b segment: add option to disable clipping
Add a clip argument to gst_segment_to_running_time_full() to disable
the checks against the segment boundaries. This makes it possible to
generate an extrapolated running-time for timestamps outside of the
segment.

See https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-19 17:36:36 +01:00
Mathieu Duponchelle
5d96658874 tools: remove outdated completion script
+ Remove the associated test

https://bugzilla.gnome.org/show_bug.cgi?id=744877#c21
2015-03-18 14:16:48 +01:00
Wim Taymans
8c8b3818e4 segment: add helper to get negative running-time
Add a helper method to get a running-time with a little more features
such as detecting if the value was before or after the segment and
negative running-time.

API: gst_segment_to_running_time_full()

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-18 11:35:42 +01:00
Wim Taymans
6e67ad7675 segment: fix offset handling with non 0 start
The position in the segment is relative to the start but the offset
isn't, so subtract the start from the position when setting the offset.
Add unit test for this as well.
2015-03-18 11:35:42 +01:00
Tim-Philipp Müller
b1b718c6d0 tests: add unit test for gst_adapter_take_buffer_list() 2015-03-14 17:23:03 +00:00
Tim-Philipp Müller
f7eeed3447 Add new streamiddemux binaries to .gitignore 2015-03-14 16:05:57 +00:00
Nicolas Dufresne
c740bad1a0 bufferpool: Don't stop the pool in set_config()
Don't stop the pool in set_config(). Instead, let the controlling
element manage it. Most of the time, when an active pool is being
configured is because the caps didn't change.

https://bugzilla.gnome.org/show_bug.cgi?id=745377
2015-03-14 12:00:53 +00:00
Thiago Santos
96eaeadc0f gstbuffer: add gst_buffer_copy_deep
A variant of gst_buffer_copy that forces the underlying memory
to be copied.

This is added to avoid adding an extra reference to a GstMemory
that might belong to a bufferpool that is trying to be drained.
The use case is when the buffer copying is done to release the
old buffer and all its resources.

https://bugzilla.gnome.org/show_bug.cgi?id=745287
2015-03-13 18:37:04 +00:00
HoonHee Lee
fadabe8b78 streamiddemux: Add streamiddemux element
Demultiplex a stream to multiple source pads based on the stream ids from the
stream-start events. This basically reverses the behaviour of funnel.

https://bugzilla.gnome.org/show_bug.cgi?id=707605
2015-03-12 14:42:18 +00:00
Tim-Philipp Müller
0c3f1850be tests: add some basic unit tests for our printf stuff
To test new %I32 support.

https://bugzilla.gnome.org/show_bug.cgi?id=744281
2015-03-12 13:29:05 +00:00
hoonhee.lee
8ce1f4d470 funnel: handle GAP event to forwards sticky events into downstream
If no data is coming and funnel receive GAP event, need to forwards sticky events
into downstream if it needs.

https://bugzilla.gnome.org/show_bug.cgi?id=738202
2015-03-10 16:15:35 -04:00
Tim-Philipp Müller
bd7d1c8b61 Fix double semicolons 2015-03-10 09:24:28 +00:00
Edward Hervey
075def0f97 gstvalue: Make sure GST_FOURCC_ARGS produces printable characters
Some systems will crash if we use non-printable characters in print/debug
statements.

Make sure that GST_FOURCC_ARGS never does that

https://bugzilla.gnome.org/show_bug.cgi?id=745144
2015-02-26 07:49:05 +01:00
Olivier Crête
f9baff11c8 Revert "element: set pads need-parent flag to false when removing"
This reverts commit 1911554cff.

This breaks the functionality of GST_PAD_FLAG_NEED_PARENT, the reason for this
flag is that if a pad is removed from a running element, you don't want
functions (such as chain or event) to be called on the pad without a parent set.
This can happen if you remove a request or sometimes pad from a running element.

I don't see the code that caused this in tsdemux, but if it needs to unset
the flag on remove, it should do it itself and then make sure that the parent
exists in any pad function.
2015-02-20 16:22:23 -05:00
Sebastian Dröge
c102d02bd0 queue: Add unit test for buffer list and time level handling 2015-02-18 11:03:08 +02:00
Tim-Philipp Müller
4a757e651a tests: bus: add unit test for async message delivery 2015-02-17 09:52:14 +00:00
Jan Schmidt
bbae71133d tests: Fix clock regression test
Fix up the values the test is checking for now that
the clock regression returns parameters starting from
the end of the regression range.
2015-02-07 05:16:23 +11:00
Sebastian Dröge
40a0275298 uri: Fix indention 2015-01-22 23:10:06 +02:00
David Waring
d20fa132c1 uri: Fix new URI parsing tests based on GNet's
https://bugzilla.gnome.org/show_bug.cgi?id=743195
2015-01-22 22:08:12 +01:00
Sebastian Dröge
0637703fe7 uri: Add parsing unit test based on GNet's
Plus some new URIs to parse.

https://git.gnome.org/browse/archive/gnet/plain/tests/check/gnet/gneturi.c

https://bugzilla.gnome.org/show_bug.cgi?id=743195
2015-01-22 22:07:46 +01:00
Jan Schmidt
81d613694c clock: Improve slaving regression.
Add domain checks for the input values, and a variable precision
calculation that loops if necessary to ensure we never overflow
accumulators and then silently produce garbage results.

Make the (non-public) linear regression function available for
unit testing by putting it in a separate source file the test
can include. Add a unit test that the new regression function
produces sensible results for several inputs taken from real-world
captures.
2015-01-21 22:27:18 +11:00
Jan Schmidt
f9f45834e7 netclock: Add simple network clock server and client examples 2015-01-21 22:27:18 +11:00
Sebastian Dröge
1f6d5d3ff5 structure/caps: Add gst_{structure,caps}_filter_and_map_in_place()
https://bugzilla.gnome.org/show_bug.cgi?id=739765
2014-12-16 18:22:46 +01:00
Sebastian Dröge
6925fa1b7c structure: Add simple unit test for foreach() and map_in_place() 2014-12-16 18:22:46 +01:00
Sebastian Dröge
bc11a1b79d caps: Add gst_caps_foreach() and gst_caps_map_in_place()
https://bugzilla.gnome.org/show_bug.cgi?id=739765
2014-12-16 18:22:46 +01:00
Nicolas Dufresne
a8d6653037 bufferpool: Don't check size in config validation
Pools are allowed to change the size in order to adapt padding. So
don't check the size. Normally pool will change the size without
failing set_config(), but it they endup changing the size before
the validate method may fail on a false positive.

https://bugzilla.gnome.org/show_bug.cgi?id=741420
2014-12-16 10:20:37 -05:00
Wim Taymans
5cf630697c structure: don't overread input when searching for "
When searching for the string terminator don't read past the ending
0-byte when escaping characters.
Add unit test for various escaping cases.
2014-11-20 13:37:08 +01:00
Haakon Sporsheim
6c079367f1 task: Fix pause/stop race condition
If a task thread is calling pause on it self and the
controlling/"main" thread stops the task, it could end in a race
where gst_task_func loops and then checks for paused after the
controlling thread just changed the task state to stopped.
Hence the task would actually call func again even though it was
both paused and stopped.

https://bugzilla.gnome.org/show_bug.cgi?id=740001
2014-11-12 12:00:48 +01:00
Sebastian Dröge
d600fc48f8 gstobject: Don't check booleans for equality in the unit test
Every value other than 0/FALSE is TRUE, == TRUE will only check for 1.
2014-11-10 10:03:57 +01:00
Jan Alexander Steffens (heftig)
5a930aa642 gstobject: Add gst_object_has_parent()
Adds gst_object_has_parent, which works like gst_object_has_ancestor
but does not ascend further.

API: gst_object_has_parent()
2014-11-10 10:03:57 +01:00
Sebastian Dröge
9606e04895 capsfilter: Add an optional delayed caps change mode
In this mode we accept previously set filter caps until
upstream renegotiates to something that is compatible
to the current filter caps.

This allows dynamic caps changes in the pipeline even
if there is a queue between any conversion element
and the capsfilter. Without this we would get not-negotiated
errors if timing is bad.

https://bugzilla.gnome.org/show_bug.cgi?id=739002
2014-11-03 08:09:21 +01:00
Tim-Philipp Müller
5b17a69079 tests: refactor tools check a little
Use an array of constant strings so if arguments get
removed from it they are not considered leaked, and
valgrind is happy. Still some stuff leaking in GLib
though.
2014-10-31 16:10:01 +00:00
Tim-Philipp Müller
34abd91e90 tests: fix out-of-bounds memory access in bytereader unit test
Caught by -fsanitize=address / libasan.

https://bugzilla.gnome.org/show_bug.cgi?id=739431
2014-10-30 23:16:54 +00:00
Tim-Philipp Müller
82abf56e8e tests: fdsrc: don't ignore return value of write()
Causes compiler warnings on some systems.
2014-10-28 09:28:28 +00:00
Tim-Philipp Müller
caed34f45f tests: fix fdsrc test corner case
Make pipe socket non-blocking, so we don't
end up being blocked in a write on the pipe
while the src is eos and not reading data
any more, and thus we never unblock and never
notice that we're done. This would happen
quite reliably on the rpi.
2014-10-28 00:10:26 +00:00
Linus Svensson
bf8e36a768 tests: Add a test for removing a bus watch
https://bugzilla.gnome.org/show_bug.cgi?id=735195
2014-10-14 10:31:27 +02:00
Linus Svensson
c8b512d2f0 bus: Add a function to remove a bus watch
If a bus watch is added to the non default main context it's not
possible to remove it using g_source_remove().

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=735195
2014-10-14 10:31:18 +02:00
Matej Knopp
c497f629bc tests: baseparse: set_sink_caps vfunc should't take ownership of the caps
https://bugzilla.gnome.org/show_bug.cgi?id=737762
2014-10-03 12:35:40 +01:00
David Waring
54c5f1855c GstUri: Add GstUri miniobject to handle URIs in an RFC 3986 compliant fashion
https://bugzilla.gnome.org/show_bug.cgi?id=725221
2014-09-29 12:19:05 +03:00
Stefan Sauer
d5518edf12 fixme: bump leftover 0.11 fixme comments 2014-09-25 21:27:03 +02:00
Tim-Philipp Müller
26be9f0581 tests: fix caps leak in baseparse unit test 2014-09-25 16:21:51 +01:00
Jonas Holmberg
4a304a7774 flowcombiner: add a gst_flow_combiner_clear() method
https://bugzilla.gnome.org/show_bug.cgi?id=737359

API: gst_flow_combiner_clear()
2014-09-25 15:40:42 +01:00
Wim Taymans
7e33f52961 tests: add flush-stop on inactive pad test
Check that pushing flush-stop on an inactive pad does not clear the
flushing flag.
2014-09-02 12:04:15 +02:00
Linus Svensson
ae74a1a83a tests: add test that triggers deadlock in state change of queue
When receiving FLASH_STOP in a state transition to READY, a queue
element can end up with an active task that will never end.

https://bugzilla.gnome.org/show_bug.cgi?id=734688
2014-08-23 12:03:38 +01:00
Tim-Philipp Müller
86d7a597f0 bytereader: add gst_byte_reader_peek_sub_reader() and _get_sub_reader()
Adds API to get or peek a sub-reader of a certain size from
a given byte reader. This is useful when parsing nested chunks,
one can easily get a byte reader for a sub-chunk and make
sure one never reads beyond the sub-chunk boundary.

API: gst_byte_reader_peek_sub_reader()
API: gst_byte_reader_get_sub_reader()
2014-08-15 10:03:26 +01:00
Sebastian Dröge
96f0544cbd concat: Add unit tests for concat element 2014-08-12 15:39:09 +03:00
Thiago Santos
f7ec33009a tests: caps: add check for caps with features intersection
Checks that a caps without features doesn't intersect with
one that has features
2014-08-09 11:03:01 -03:00
Tim-Philipp Müller
afffd9497f examples: controller: fix typo in comments 2014-08-07 14:54:37 +01:00
Sebastian Rasmussen
4cf6a6e086 tests: Add missing unrefs of objects after use
Unreffing the objects returned by gst_bin_get_by_name() and
gst_pipeline_get_use() were missing in several tests, so add these.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734345
2014-08-06 13:47:11 +02:00
Sebastian Dröge
fd14754921 utils: Fix unititialized variable compiler warning 2014-08-06 12:55:57 +02:00
Sebastian Rasmussen
2e4ce5caf6 tests: Add test verifying gst_element_link_pads_full()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=733119
2014-08-06 09:58:37 +02:00
Thiago Santos
f8323b17fb bytereader: add gst_byte_reader_masked_scan_uint32_peek
Adds gst_byte_reader_masked_scan_uint32_peek just like
GstAdapter has a _peek and non _peek version

Upgraded tests to check that the returned value is correct in the
_peek version

API: gst_byte_reader_masked_scan_uint32_peek

https://bugzilla.gnome.org/show_bug.cgi?id=728356
2014-07-24 17:00:09 -03:00
Thiago Santos
0d5ddc96f2 Revert "tests: taglist: add basic test for taglists serialization"
This reverts commit 85d23d19b7.

There was already a gsttag.c tests file, this test has been merged
in it in the previous commit
2014-07-21 12:44:40 -03:00
Thiago Santos
4f32a74daf tests: tag: add the empty taglist serialization test
Adds the test to the appropriate and already existing file.
2014-07-21 12:40:47 -03:00
Thiago Santos
85d23d19b7 tests: taglist: add basic test for taglists serialization
Make sure it works with empty taglists
2014-07-21 11:42:05 -03:00
Thiago Santos
b0b8908159 tests: gststructure: serialization of tag event structure
Adds a test that checks that the serialization of a tag event structure
works without problems

https://bugzilla.gnome.org/show_bug.cgi?id=733131
2014-07-21 11:42:05 -03:00
Sebastian Dröge
4f29ce3cb7 pipeline: Add unit test for resetting of the start time
Also check if this properly affects basesink elements to not
report the old start time but the real current position when
setting to PAUSED again.
2014-07-21 09:33:54 +02:00
Tim-Philipp Müller
e10d54b8e2 tests: fix locking in gstpoll unit test
The mutex needs to be locked when g_cond_wait*() is
called.
2014-07-06 12:10:09 +01:00