Skip the ES explicitely from the beginning of the loop instead of
skipping implicitely with branching, removing an indentation level and
making the skip condition clearer.
Use the early return on the !b_record path where it cannot fail (release
of resources) and which is much simpler than the b_record path which
needs to handle errors.
As done in multiple places for deallocation, prefer exiting the release
function in case of non-null reference count instead of branching the
whole function to reduce indentation level and complexity.
Like the previous commit, handle the case when clock settings need to be
changed with an early return instead of branching in the case where the
parameters need to be changed, in order to remove the whole indentation
level and specify exit conditions at the beginning.
Like the previous commit, handle the case when buffering is enabled with
an early return instead of branching in the case where it's disabled, in
order to remove the whole indentation level and specify exit conditions
at the beginning of the case.
The if else block is followed by a single return, but the else block is
much more complex than the if block. To simplify, we can add the early
return to the first branch as an early success, ie. there is no other
handling necessary for PCR if buffering is still enabled.
The first if branch is already terminating with a return, so there is no
need for an else branch and we can keep only the if. The return in the
branch is also superfluous given that the success path is the same.
The first if branch is already terminating with a return, so there is no
need for an else branch. It makes the early return path more readable by
listing the condition where the clock is not ready among the other
condition where buffering is not ready.
The comment from b89b01bb6d is bogus,
filter_chain_AppendInner() is not public, but filter_chain_AppendConverter()
and filter_chain_AppendFilter() are.
Metal device is mandatory to handle P010 chroma on mobile/tv devices.
The Metal device API can only be used in ObjC context hence a new ObjC source file had to be created to handle the device detection.
Only OpenGLES isn’t compatible with `x420` formats. Other renderer
implementation using Metal or AVSampleBufferDisplayLayer can display
this chroma just fine.
There’s no possible interoperability between VLC_CODEC_CVPX_P010 and the native
Darwin OpenGLES backend given it can’t allocate more than 8bit-per-pixel textures. Hence we can reject this chroma to prevent the display from opening in this
case.
The RGB chromas that need mask fixing left are RGB16 and RGB15.
The only chroma that vlc_fourcc_GetRGBFallback() may provide is RGB16.
But fixing RGB16 ends up being equivalent to VLC_CODEC_RGB565LE, which
is listed before RGB16 in all the RGB fallback lists. So if RGB565LE is
not supported RGB16 + default mask won't be either. And in fact neither
are referenced by any OpenGL code, so it will never happen.
It would have been used only if interop_rgb_base_init() supported them
as that's what is called to try to support the tested chromas. But only
chromas without a mask are supported since eaf149b7f8.
Partial revert of remaining bits from 3b4d89ac00.
The GLSL version was chosen at compile time, but the sub_renderer is
built for both OpenGL and GL ES, and linux can have both implementations
at the same time, so ensure the correct version will be picked at
runtime.
Fixes the following error in test:
test_opengl gl error: program: error: vertex shader lacks `main'