Commit graph

17127 commits

Author SHA1 Message Date
Tim-Philipp Müller
c7bb52934e query: fix compiler warning
C4146: unary minus operator applied to unsigned type, result still unsigned
2016-05-02 10:53:04 +01: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
Tim-Philipp Müller
12a1418f7f Fix some nonsensical g-i annotations 2016-04-30 14:15:08 +01:00
Matej Knopp
efb1955ffb multiqueue: Ignore time when determining whether sparse stream limits have been reached
Basically, sq->max_size.visible is never increased for sparse streams in
overruncb when empty queue has been found;

If the queue is sparse it just skip the entire logic determining whether
max_size.visible should be increased, deadlocking the demuxer.

What should be done instead is that when determining if limits have been
reached, to ignore time for sparse streams, as the buffer may be far in the
future.

https://bugzilla.gnome.org/show_bug.cgi?id=765736
2016-04-29 16:09:23 +03:00
Sebastian Dröge
8177173db0 element: Add gst_element_call_async()
This calls a function from another thread, asynchronously. This is to be
used for cases when a state change has to be performed from a streaming
thread, directly via gst_element_set_state() or indirectly e.g. via SEEK
events.

Calling those functions directly from the streaming thread will cause
deadlocks in many situations, as they might involve waiting for the
streaming thread to shut down from this very streaming thread.

This is mostly a convenience function around a GThreadPool and is for example
used by GstBin to continue asynchronous state changes.

https://bugzilla.gnome.org/show_bug.cgi?id=760532
2016-04-27 18:51:33 +03:00
Sebastian Dröge
a4db38ab05 manual: Fix buffer memory leak in appsrc example
g_signal_emit_by_name() is not like gst_app_src_push_buffer() due to reference
counting limitations of signals, it does *not* take ownership of the buffer.
2016-04-27 09:22:27 +03:00
Guillaume Desmottes
8daad351a4 caps: add cleanup priv function
Those are allocated in _priv_gst_caps_initialize() so it makes
sense to have a symetric cleanup functions called by gst_deinit().

https://bugzilla.gnome.org/show_bug.cgi?id=765606
2016-04-26 14:29:08 +01:00
Guillaume Desmottes
21a2b26bb2 capsfeature: add cleanup priv function
Those are allocated in _priv_gst_caps_features_initialize() so it makes
sense to have a symetric cleanup functions called by gst_deinit().

https://bugzilla.gnome.org/show_bug.cgi?id=765606
2016-04-26 14:29:01 +01:00
Alex Ashley
57a9919eb1 testclock: add clock-type property
To allow the GstTestClock to be used as a GstSystemClock, it is
useful to implement the clock-type property that GstSystemClock
provides. This allows GstTestClock to be used as the system clock
with code that expects a GstSystemClock.

    https://bugzilla.gnome.org/show_bug.cgi?id=762147
2016-04-21 15:21:53 -03:00
Sebastian Dröge
2076be19ed datetime: Sanity check year, month and day when parsing ISO-8601 strings
Passing years > 9999, months > 12 or days > 31 to gst_date_time_new() will
cause an assertion and generally does not make much sense. Instead consider it
as a parsing error like hours > 24 and return NULL.
2016-04-21 13:49:32 +03:00
Sebastian Dröge
5294065985 baseparse: Remember if we interpolated DTS from PTS and refresh it whenever we update the PTS
Otherwise PTS and DTS will come out of sync if upstream continues to provide
PTS and not DTS, and we have to skip some data from the stream or PTS are not
exactly increasing with the duration of each packet.

https://bugzilla.gnome.org/show_bug.cgi?id=765260
2016-04-20 11:49:24 +03:00
Sebastian Dröge
c434b6486d typefindhelper: Fix gobject-introspection warning about invalid transfer annotation
gsttypefindhelper.c:485: Warning: GstBase: invalid "transfer" annotation for gsize: only valid for array, struct, union, boxed, object and interface types
2016-04-20 11:45:28 +03:00
Guillaume Desmottes
1ea831bd6c allocator: add cleanup method
Make tracking memory leaks easier.

https://bugzilla.gnome.org/show_bug.cgi?id=765212
2016-04-18 11:33:32 -04: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
Sebastian Dröge
895332e056 baseparse: When initializing DTS from PTS, remember that we did so
If we don't store the value in prev_dts, we would over and over again
initialize the DTS from the last known upstream PTS. If upstream only provides
PTS every now and then, then this causes DTS to be rather static.

For example in adaptive streaming scenarios this means that all buffers in a
fragment will have exactly the same DTS while the PTS is properly updated. As
our queues are now preferring to do buffer fill level calculations on DTS,
this is causing huge problems there.

See https://bugzilla.gnome.org/show_bug.cgi?id=691481#c27 where this part of
the code was introduced.

https://bugzilla.gnome.org/show_bug.cgi?id=765096
2016-04-15 16:02:29 +03:00
Julien Isorce
428de28c9b Automatic update of common submodule
From 6f2d209 to ac2f647
2016-04-14 09:58:04 +01:00
Vincent Penquerc'h
53a7a991e2 multiqueue: catch errors and flushing case after lock
This ensures we can not get into an indefinite wait on the
following cond var wait.

https://bugzilla.gnome.org/show_bug.cgi?id=764999
2016-04-14 09:12:27 +01:00
Tim-Philipp Müller
939a7fee6c tools: gst-launch: fix up caps printing in verbose mode
Add missing 'else' and print caps and taglists without the
annoying duplicate string escaping, making both nicer to read.

Fixes string leak and coverity CID 1358492.
2016-04-13 16:42:31 +01:00
Guillaume Desmottes
e0757e1d80 rusage: properly free the queue memory
The queue is allocated as part of the tracer struct so we should not
use g_queue_free() to free it.

https://bugzilla.gnome.org/show_bug.cgi?id=764985
2016-04-13 12:40:41 +03:00
Sebastian Dröge
3f3af84a8f meta: Warn if a meta implementation is registered without init function
This previously caused uninitialized memory unless something else was
initializing all the fields explicitly to something.

To be on the safe side, we also allocate metas without init function to all
zeroes now as it was relatively common.

https://bugzilla.gnome.org/show_bug.cgi?id=764902
2016-04-13 10:21:15 +03:00
Sebastian Dröge
00e4499b15 Revert "basesink: Take PREROLL_LOCK in wait_event()"
This reverts commit 828a4627db.

The lock was already taken elsewhere, in gst_base_sink_event().
2016-04-12 15:17:36 +03:00
Sebastian Dröge
828a4627db basesink: Take PREROLL_LOCK in wait_event()
It is calling do_sync(), which requires the STREAM_LOCK and PREROLL_LOCK to be
taken. The STREAM_LOCK is already taken in all callers, the PREROLL_LOCK not.

https://bugzilla.gnome.org/show_bug.cgi?id=764939
2016-04-12 15:11:30 +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
fbcfa38236 docs: pwg: remove broken references to example code
We point to gst-template at the beginning that shoul be
enough.

https://bugzilla.gnome.org/show_bug.cgi?id=623575
2016-04-10 18:38:43 +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
d09dc8cbc0 tools: gst-launch: use new async property change notification API
https://bugzilla.gnome.org/show_bug.cgi?id=763142
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
Tim-Philipp Müller
e3cc67a133 memory: fix C++ compiler warnings with GST_MAP_INFO_INIT 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
Matthew Waters
f876306638 utils: expose pad_link_maybe_ghosting
This is a useful function to automatically add ghost pads when linking
two elements across bin boundaries without know their exact parentage.

e.g. when using gst_parse_bin_from_description (with or without it ghosting pads),
one can simply retreive the src/sink pads from the bin to link to another pad.

Similar functionality is provided by gst_element_link_pads{_full}() however only
by pad name rather than by actual pads.

API: gst_pad_link_maybe_ghosting_full

https://bugzilla.gnome.org/show_bug.cgi?id=764176
2016-04-06 23:26:41 +10:00
Reynaldo H. Verdejo Pinochet
4503232f83 docs/design/part-states.txt: spelling fix 2016-04-03 23:38:34 -07:00
Mark Combellack
b8f2929dac GST_REFCOUNTING: Add logging of pointer address for dispose, finalize, etc messages
Updated the GST_REFCOUNTING logging so that it includes the pointer
address of the object that is being disposed or finalized.

With this change is is then possible to match up GST_REFCOUNTING log messages
for object allocation/disposal/finalization. This can help with diagnosing
"memory leaks" in applications that have not correctly disposed of all the
GStreamer objects it creates.

https://bugzilla.gnome.org/show_bug.cgi?id=749427
2016-04-02 18:18:10 +01:00
Luis de Bethencourt
1bb699446a info: only open log file when adding it to the log function
This avoids the leak of opening it and then not passing it or closing it
before it goes out of scope.
2016-04-02 10:47:57 +01:00
Sebastian Dröge
c32ea3cb58 clock: Return FALSE in all paths that don't set out parameters in gst_clock_add_observation_unapplied()
It returned TRUE when regression failed, while not setting any of the out
parameters. This caused uninitialized data from the stack to be used for
setting the clock calibration.
2016-04-02 01:34:46 +03:00
Thiago Santos
368ee8a336 pad: rework probe's hook_marshall function
PUSH and PULL mode have opposite scenarios for IDLE and BLOCK
probes.

For PUSH it will BLOCK with some data type and IDLE won't have a type.
For PULL it will BLOCK before getting some data and will be IDLE when
some data is obtained.

The check in hook_marshall was specific for PUSH mode and would cause
PULL probes to fail to be called. Adding different checks for the mode
to fix this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=761211
2016-03-28 11:14:41 -03: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
Thiago Santos
45b0e7aa16 pad: consider PROBE_TYPE_EVENT_FLUSH when using PROBE_TYPE_ALL_BOTH
When GST_PAD_PROBE_EVENT_FLUSH is used, the probes already have
a data type and it is not needed to automatically add the default
types.

https://bugzilla.gnome.org/show_bug.cgi?id=762330
2016-03-28 10:54:11 -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