Commit 39f1c15a authored by Thomas Guillem's avatar Thomas Guillem

opengl: converter: move code up

To avoid forward declaration with next commits.
parent 34ea88d4
......@@ -83,6 +83,35 @@ struct yuv_priv
GLfloat local_value[16];
};
#if !defined(USE_OPENGL_ES2)
static int GetTexFormatSize(int target, int tex_format, int tex_internal,
int tex_type)
{
GLint tex_param_size;
switch (tex_format)
{
case GL_RED:
tex_param_size = GL_TEXTURE_RED_SIZE;
break;
case GL_LUMINANCE:
tex_param_size = GL_TEXTURE_LUMINANCE_SIZE;
break;
default:
return -1;
}
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(target, texture);
glTexImage2D(target, 0, tex_internal, 64, 64, 0, tex_format, tex_type, NULL);
GLint size = 0;
glGetTexLevelParameteriv(target, 0, tex_param_size, &size);
glDeleteTextures(1, &texture);
return size;
}
#endif
#ifdef VLCGL_HAS_PBO
static int
pbo_map(const opengl_tex_converter_t *tc, picture_t *pic)
......@@ -543,35 +572,6 @@ opengl_tex_converter_rgba_init(const video_format_t *fmt,
return fragment_shader;
}
#if !defined(USE_OPENGL_ES2)
static int GetTexFormatSize(int target, int tex_format, int tex_internal,
int tex_type)
{
GLint tex_param_size;
switch (tex_format)
{
case GL_RED:
tex_param_size = GL_TEXTURE_RED_SIZE;
break;
case GL_LUMINANCE:
tex_param_size = GL_TEXTURE_LUMINANCE_SIZE;
break;
default:
return -1;
}
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(target, texture);
glTexImage2D(target, 0, tex_internal, 64, 64, 0, tex_format, tex_type, NULL);
GLint size = 0;
glGetTexLevelParameteriv(target, 0, tex_param_size, &size);
glDeleteTextures(1, &texture);
return size;
}
#endif
static int
tc_yuv_fetch_locations(const opengl_tex_converter_t *tc, GLuint program)
{
......
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