Using a ordered ring buffer and a thread pool, the color space
conversion is not multi-threaded based on frames. I tried
to implement slice based threading, but libswscale did produced
highly distorted pictures without obvious reason.
This approach introduces some more "lag" when decoding and skipping,
but shouldn't be affect the user negatively, since movie
watching is not lag sensitive, as long as the A/V is synchronized.
Change default to software decoding.
SW decoding is the most robust and fasted method of decoding right now.
Users should enable hw based decoding if their system requires it
and it's actually beneficial for them.
Fix deadlocks when seeking and decrease RAM usage.
Decrease memory allocation by reusing AVFrames.
Android WSI wants you to use preTransform, and if it is not used
correctly, Android 10 will return VK_SUBOPTIMAL_KHR, and we would create
a new swapchain every frame.
This workaround just ignores this error, since it's not really an error.
A more "proper" fix is to use prerotate and modify the MVP matrices,
which might help certain devices with crummy display processors.
I accidentally managed to reproduce an issue which has been plaguing
users for a while, where glslang throws an assert after closing a game
(and starting a new one).
pthread_setspecific was somehow failing with an EINVAL call, despite the
key never having been freed. I suspect some kind of corruption happening
when dynamic libraries are unloaded, but I doubt this is a bug in either
RetroArch or glslang per-se.
My workaround here is to tear down all TLS use in glslang after we're
done compiling. Somehow this works around the problem for me, and I
don't really see another viable fix. Valgrind does not say anything about the
issue, so doubt it's memory corruption either.
I had to fix a minor TLS leak in glslang as DetachProcess does not free
the PoolIndex TLS.
ANativeWindow getWidth/Height does not detect any changes when using
Vulkan, so use the old onContentRectChanged callback to get notified
when size changed. Use those values instead when figuring out how large
swapchain to create.
Tested trivially on Galaxy S9+ Exynos model.