android: add a new file in order to refactor common code between Android vout modules.

Implement a function to load the Native Window API from the Android
library.  This API is needed by current vouts nativewindow and surface
and will also be needed by the opaque vout.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
android: use common function LoadNativeWindowAPI instead of duplicating code in vout modules.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
package/macosx: remove legacy code
demux: ogg: fix PCR from opus granule.

Can't use granule 0 as it means there's still no valid first sample
after processing packet.
Fix start gap on opus webradios.
demux: ogg: add PCR gap handling warning
demux: oggseek: fix timestamp computation for opus
encoder: dirac: fix heap overflow
encoder: dirac: match source geometry

refs #10386
Still junk on bottom due to invalid plane->i_visible_lines
mux: ogg: uninitialized value

1st header write can contain random values but that
triggers false positive on valgrind.
encoders: shroedinger: fix invalid write
mux: ogg: compute correct dt/pt/delay/distance for dirac.

refs #9648
(no fix as codec sends bad pts sequence)
demux: asf: don't warn on stop.

Can still have unsent blocks.
Remove dirac.c

Comment says:
"NB, this is a temporary encoder only module until schroedinger
offers superior encoding quality than dirac-research"

http://diracvideo.org/2012/01/schroedinger-1-0-11/ says:
"Schrödinger outperforms dirac-research in most encoding situations,
both in terms of encoding speed and visual quality."
Qt4: add h265 transcoding profile
Mention dirac removal
Use str_format_meta for snapshots

Fixes: #9938
vout_Request: cosmetics
alsa: set spdif options also if device was specified

On my laptop I need to specify --alsa-audio-device hdmi
mediacodec: Set the dequeue timeout in the right unit

The timeout parameter is in microseconds, while the previous wait
value (30) was supposed to be milliseconds.

Signed-off-by: Martin Storsjö <martin@martin.st>
mediacodec: implementation of MediaCodec GPU direct rendering

Based on the work by Martin Storsjö.

The decoder stores opaque buffers in the p_sys member of the picture
and the vout uses a callback from the decoder to render these
buffers. When the decoder flushes or closes, all the currently in
flight pictures (filled by the decoder but not displayed yet) need to
be invalidated. A mutex is required in order to prevent the vout from using
destroyed MediaCodec buffers.

In order to avoid a deadlock when exiting the decoder, a maximum number of polling
attempts was added in order to avoid blocking the decoder indefinitely if the vout
is not releasing output buffers anymore.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>