c400eef377 introduced some defines to handle
older kernel headers. However, the check is done before the corresponding
kernel header (dvb/frontend.h) is included. As a result the macros are
always defined with results in 'redefined' errors with newer kernel
headers.
Move the check after the include to fix this.
https://bugzilla.gnome.org/show_bug.cgi?id=730570
We need to sleep a bit before destroying the player object
because of a bug in Android in versions < 4.2.
OpenSLES is using AudioTrack for rendering the sound. AudioTrack
has a thread that pulls raw audio from the buffer queue and then
passes it forward to AudioFlinger (AudioTrack::processAudioBuffer()).
This thread is calling various callbacks on events, e.g. when
an underrun happens or to request data. OpenSLES sets this callback
on AudioTrack (audioTrack_callBack_pullFromBuffQueue() from
android_AudioPlayer.cpp). Among other things this is taking a lock
on the player interface.
Now if we destroy the player interface object, it will first of all
take the player interface lock (IObject_Destroy()). Then it destroys
the audio player instance (android_audioPlayer_destroy()) which then
calls stop() on the AudioTrack and deletes it. Now the destructor of
AudioTrack will wait until the rendering thread (AudioTrack::processAudioBuffer())
has finished.
If all this happens with bad timing it can happen that the rendering
thread is currently e.g. handling underrun but did not lock the player
interface object yet. Then destroying happens and takes the lock and waits
for the thread to finish. Then the thread tries to take the lock and waits
forever.
We wait a bit before destroying the player object to make sure that
the rendering thread finished whatever it was doing, and then stops
(note: we called gst_opensles_ringbuffer_stop() before this already).
Handle stride alignment through the use of the video meta API. The
code is based on the corevideobuffer implementation.
If the video meta API is not supported and the underlying buffer
contains padding, the core media buffer is copied to a system memory
buffer.
https://bugzilla.gnome.org/show_bug.cgi?id=727885
Devices suitable for decklinksrc may not have any output, hence querying
the input returns NULL. Add support for all cases where
input/output/config may be missing.
https://bugzilla.gnome.org/show_bug.cgi?id=727306
usecount is unsigned, so too many "unuse" will wrap the counter
around and the >= 0 check will always be fine.
It would be much simpler to just make the counter signed, but
moving the checks where the decrements happen allow a mistake
to be detected earlier, and thus easier to debug.
Coverity 1139791
While the code that creates the object sets priv to some existing
pointer after new, this ensures any future new not doing this will
hit the various priv!=NULL asserts in the code.
Coverity 1139935