In some corner cases, the error 'code' part passed to
GST_ELEMENT_ERROR() is a valid define as well, in which
case it won't survive two levels of macro expansion, but
only one. Fixes:
oss4-sink.c: In function ‘gst_oss4_sink_open’:
error: ‘GST_RESOURCE_ERROR_0x00000002’ undeclared (first use in this function)
GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,
which is from GST_ELEMENT_ERROR(el,RESOURCE,OPEN_WRITE,..)
and OPEN_WRITE happens to be defined to 2 here.
https://bugzilla.gnome.org/show_bug.cgi?id=756806https://bugzilla.gnome.org/show_bug.cgi?id=769117
gst_structure_id_get() returns a new reference so the returned object is
actually (transfer full).
The unit tests was already unreffing the objects.
https://bugzilla.gnome.org/show_bug.cgi?id=768776
gst_structure_id_get() returns a new reference so the returned device is
actually (transfer full).
The code using this API was already correct but the code example in
comments was not.
https://bugzilla.gnome.org/show_bug.cgi?id=768776
We don't free this from gst_deinit() but from gst_task_cleanup_all(),
so more GStreamer API may be called. In particular makes unit tests
work again with CK_FORK=no.
https://bugzilla.gnome.org/show_bug.cgi?id=768577
This ensures that all async operations (started from gst_element_call_async())
have been completed and so there is no extra thread running.
Fix races when checking for leaks on unit tests as some of those
operations were still running when the leaks tracer was checking for
leaked objects.
https://bugzilla.gnome.org/show_bug.cgi?id=768577
gcc 6 has problems detecting and avoiding throwing
a warning for tautological compares in macros (they
should only trigger for compares outside macros).
Avoid them with a nasty cast of one parameter to void *
https://bugzilla.gnome.org/show_bug.cgi?id=764526
Especially if multiple threads are waiting for buffers to be available again,
the current code was wrong. Fix this and document clearly how the GstPoll is
supposed to be used.
Also fix some potential races with reading from the GstPoll before writing
actually happened.
https://bugzilla.gnome.org/show_bug.cgi?id=767979
It might happen that we popped the message before writing of the control
happened. In this case we just have to retry again a bit later, and failure to
do so will cause an additional byte in the control and the GSource /
gst_poll_wait() to always wake up again immediately.
https://bugzilla.gnome.org/show_bug.cgi?id=750397
And also mention what the expected values of errno are going to be.
write_control() will only ever return FALSE if there was a critical error. It
will never return because of EINTR, EAGAIN or EWOULDBLOCK.
read_control() will return FALSE if there was no byte to read, in which case
errno would be EWOULDBLOCK.
In all other cases there was a critical error.
https://bugzilla.gnome.org/show_bug.cgi?id=750397
On timer GstPolls it will cause the control socket state to become
inconsistent as now one less read_control() than write_control() be would
needed.
Similarly, read_control() and write_control() are only valid on timer
GstPolls.
https://bugzilla.gnome.org/show_bug.cgi?id=750397
This might fail even under correct usage, e.g. if read_control() is called
from another thread before write_control() finished in another. It has to be
retried then, or other measures have to be taken, depending on how it is used
by the surrounding code.
https://bugzilla.gnome.org/show_bug.cgi?id=750397
This addresses slightly different race conditions on Linux and Windows, and
fixes gst_poll_read_control() when control_pending == 0.
On Linux, the socketpair() used for control should not be made O_NONBLOCK.
If there's any propagation delay between set->control_write_fd.fd and
set->control_read_fd.fd, even the mutex now held will not be sufficient to
prevent a race condition. There's no benefit to using O_NONBLOCK, here.
Only liabilities.
For Windows, it's necessary to fix the race condition between testing
set->control_pending and performing WAKE_EVENT()/RELEASE_EVENT(). This is
accomplished by acquiring and holding set->lock, for both of these operations.
We could optimize the Linux version by making this Windows-specific.
For consistency with the Linux implementation, Windows' RELEASE_EVENT()
has also been made to block, although it should never happen.
Also, changed release_wakeup() to return TRUE and decrement control_pending
only when > 0. Furthermore, RELEASE_EVENT() is called only when
control_pending == 1.
Finally, changed control_pending to use normal, non-atomic arithmetic
operations, since it's now protected by set->lock.
Note: even though the underlying signaling mechanisms are blocking,
release_wakeup() is effectively non-blocking, as it will only attempt to read
from control_read_fd.fd after a byte has been written to control_write_fd.fd
or WaitForSingleObject() after it's been signaled.
https://bugzilla.gnome.org/show_bug.cgi?id=750397
GCC emits an error for this with -Werror:
plugin.c:22:1: error: 'gst_plugin_desc' initialized and declared 'extern' [-Werror]
This matches how glib does symbol exporting.
https://bugzilla.gnome.org/show_bug.cgi?id=767463
If the prototypes in the public API have dllimport in them when building
statically on Windows, the compiler will look for symbols with symbol
mangling and indirection corresponding to a DLL. This will cause a build
failure when trying to link tests/examples/etc.
External users of GStreamer also need to define -DGST_STATIC_COMPILATION
if they want to link to static gstreamer libraries on Windows.
A similar version of this patch has been committed to all gstreamer
repositories.
https://bugzilla.gnome.org/show_bug.cgi?id=767463
We already had a _full() version, but having that alone seems inconsistent.
Add a non-full version that mirrors the behaviour of gst_pad_link() vs
gst_pad_link_full().
For GST_EXPORT define and also things like GST_DISABLE_REGISTRY.
Hopefully fixes the following build failure on cerbero-cross-mingw32:
helpers/gst-plugin-scanner.c:50: undefined reference to `_imp___gst_disable_registry_cache'
This static library gets included directly into libgstreamer-1.0.so, so it needs
the same GST_EXPORTS definition as the rest of the code that's compiled into
that otherwise it will try to find the constants it uses from gstinfo via DLL
importing (__declspec(dllimport)).
Fixes https://ci.gstreamer.net/job/cerbero-cross-mingw32/4393/
__declspec(dllexport/import) are supported by GCC and are needed for
properly generating code that fetches the values of constants from DLLs
built with __declspec(dllexport) which happens when anything using
GST_EXPORT is built with MSVC.
See: https://msdn.microsoft.com/en-us/library/619w14ds.aspx
Essentially, if you built gstreamer with MSVC and then tried to use
constants from it (such as GST_TYPE_CAPS) in a plugin, GCC would
retrieve the address of the value instead of the value itself.
This means applications and bin sub-classes can easily track when
a new child element is added to the pipeline sub-hierarchy or
removed.
Currently doesn't signal deep added/removed for elements inside
a bin if a bin is added/removed.
https://bugzilla.gnome.org/show_bug.cgi?id=578933
Make it explicit that the pad is only blocked while the callback is running,
and the pad will be unblocked again once the callback returned.
If BLOCK and IDLE behaviour is needed, both need to be used.
https://bugzilla.gnome.org/show_bug.cgi?id=766002