Commit 65693927 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

opengl: refactor

fetch vlc_chroma_description_t only one time.
parent d20c08ec
...@@ -96,13 +96,10 @@ static int GetTexFormatSize(opengl_tex_converter_t *tc, int target, ...@@ -96,13 +96,10 @@ static int GetTexFormatSize(opengl_tex_converter_t *tc, int target,
static int static int
tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target, tc_yuv_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
vlc_fourcc_t chroma, video_color_space_t yuv_space, vlc_fourcc_t chroma, const vlc_chroma_description_t *desc,
video_color_space_t yuv_space,
bool *swap_uv, const char *swizzle_per_tex[]) bool *swap_uv, const char *swizzle_per_tex[])
{ {
const vlc_chroma_description_t *desc = vlc_fourcc_GetChromaDescription(chroma);
if (desc == NULL)
return VLC_EGENERIC;
GLint oneplane_texfmt, oneplane16_texfmt, GLint oneplane_texfmt, oneplane16_texfmt,
twoplanes_texfmt, twoplanes16_texfmt; twoplanes_texfmt, twoplanes16_texfmt;
...@@ -560,11 +557,15 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target, ...@@ -560,11 +557,15 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
bool yuv_swap_uv = false; bool yuv_swap_uv = false;
int ret; int ret;
const vlc_chroma_description_t *desc = vlc_fourcc_GetChromaDescription(chroma);
if (desc == NULL)
return VLC_EGENERIC;
if (chroma == VLC_CODEC_XYZ12) if (chroma == VLC_CODEC_XYZ12)
return xyz12_shader_init(tc); return xyz12_shader_init(tc);
if (is_yuv) if (is_yuv)
ret = tc_yuv_base_init(tc, tex_target, chroma, yuv_space, ret = tc_yuv_base_init(tc, tex_target, chroma, desc, yuv_space,
&yuv_swap_uv, swizzle_per_tex); &yuv_swap_uv, swizzle_per_tex);
else else
ret = tc_rgb_base_init(tc, tex_target, chroma); ret = tc_rgb_base_init(tc, tex_target, chroma);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment