Commit graph

891 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Tim-Philipp Müller
14ae3cf56c tests: don't use post-GLib 2.32 API in bufferlist test
g_ptr_array_insert() is GLib >= 2.40
2014-07-02 08:41:44 +01:00
Tim-Philipp Müller
0e0e78e8af devicemonitor: don't fail when started without any filters
Just show all devices then.
2014-06-27 10:47:50 +01:00
Olivier Crête
fc87c5df5e device: Add unit tests 2014-06-26 21:01:38 -04:00
Tim-Philipp Müller
ddd5e30726 tests: add another buffer list test case 2014-06-26 14:16:20 +01:00
Tim-Philipp Müller
9823a5f7b4 tests: port and re-enable buffer list tests
And remove some which don't apply any more.
2014-06-26 14:16:16 +01:00
George Kiagiadakis
4376ba4e3c tests: enhance the gstcaps test_features to also test gst_caps_set_features()
Compliments my previous patch for gst_caps_set_features, which would
previously assert and leak the old GstCapsFeatures if the caps already
had a GstCapsFeatures and you were trying to replace it with a new one.
2014-06-26 11:58:04 +03:00
Tim-Philipp Müller
39b69d27da tests: add unit test for gst_caps_is_any() and _is_empty()
https://bugzilla.gnome.org//show_bug.cgi?id=731704
2014-06-22 12:52:01 +01:00
Tim-Philipp Müller
4043fc3a44 tests: fix compiler warnings in gstvalue tests
Calling GST_VALUE_HOLDS_*(&v) now results in a compiler
warning about value!=NULL always being false, so check
type directly in those cases.
2014-06-21 01:10:22 +01:00
Sebastian Dröge
9b7da39b68 value: Make sure to cast int range values to guints before storing them
Otherwise negative values will sets all of the 64 bits due to two's
complement's definition of negative values.

Also add a test for negative int ranges.
2014-06-19 09:33:54 +02:00
Tim-Philipp Müller
5c62bce85c tests: remove some cruft from the bufferlist test
Buffers no longer carry caps, and bufferlists don't have
groups where buffers may need to be merged into one any more.
2014-06-17 14:39:00 +01:00
Tim-Philipp Müller
b314ac8291 tests: add test for gst_buffer_list_remove() 2014-06-16 20:30:32 +01:00
Thiago Santos
1911554cff element: set pads need-parent flag to false when removing
When a pad is added the need-parent flag is set to true, so when
they are removed the flag should be set back to false

This was preventing GstPads to be reused in elements (removed and
later re-added). A unit tests was added to verify that this is
working now.

The use case is tsdemux that has a program-number property and
allows the user to switch programs. In order to do that tsdemux
will remove the pads of the current program and add from the new
ones. The removed pads are kept in the demuxer for later if the
user selects the old program again.
2014-05-29 17:01:20 -03:00
Thiago Santos
c6f92562b6 pad: store last flow return and provide acessor function
Stores the last result of a gst_pad_push or a pull on the GstPad and provides
a getter and a macro to access this field.

Whenever the pad is inactive it is set to FLUSHING

API: gst_pad_get_last_flow_return

https://bugzilla.gnome.org/show_bug.cgi?id=709224
2014-05-26 15:29:53 -03:00