libgpac
Documentation of the core library of GPAC
gltools.c File Reference
#include <gpac/tools.h>
#include <gpac/filters.h>
#include "../compositor/gl_inc.h"
+ Include dependency graph for gltools.c:

Data Structures

struct  yuv_coefs
 

Functions

 GLDECL_FUNC (glActiveTexture)
 
 GLDECL_FUNC (glClientActiveTexture)
 
 GLDECL_FUNC (glBlendEquation)
 
 GLDECL_FUNC (glPointParameterf)
 
 GLDECL_FUNC (glPointParameterfv)
 
 GLDECL_FUNC (glGenBuffers)
 
 GLDECL_FUNC (glDeleteBuffers)
 
 GLDECL_FUNC (glBindBuffer)
 
 GLDECL_FUNC (glBufferData)
 
 GLDECL_FUNC (glBufferSubData)
 
 GLDECL_FUNC (glMapBuffer)
 
 GLDECL_FUNC (glUnmapBuffer)
 
 GLDECL_FUNC (glCreateProgram)
 
 GLDECL_FUNC (glDeleteProgram)
 
 GLDECL_FUNC (glLinkProgram)
 
 GLDECL_FUNC (glUseProgram)
 
 GLDECL_FUNC (glCreateShader)
 
 GLDECL_FUNC (glDeleteShader)
 
 GLDECL_FUNC (glShaderSource)
 
 GLDECL_FUNC (glCompileShader)
 
 GLDECL_FUNC (glAttachShader)
 
 GLDECL_FUNC (glDetachShader)
 
 GLDECL_FUNC (glGetShaderiv)
 
 GLDECL_FUNC (glGetInfoLogARB)
 
 GLDECL_FUNC (glGetUniformLocation)
 
 GLDECL_FUNC (glGetUniformfv)
 
 GLDECL_FUNC (glGetUniformiv)
 
 GLDECL_FUNC (glUniform1f)
 
 GLDECL_FUNC (glUniform2f)
 
 GLDECL_FUNC (glUniform3f)
 
 GLDECL_FUNC (glUniform4f)
 
 GLDECL_FUNC (glUniform1i)
 
 GLDECL_FUNC (glUniform2i)
 
 GLDECL_FUNC (glUniform3i)
 
 GLDECL_FUNC (glUniform4i)
 
 GLDECL_FUNC (glUniform1fv)
 
 GLDECL_FUNC (glUniform2fv)
 
 GLDECL_FUNC (glUniform3fv)
 
 GLDECL_FUNC (glUniform4fv)
 
 GLDECL_FUNC (glUniform1iv)
 
 GLDECL_FUNC (glUniform2iv)
 
 GLDECL_FUNC (glUniform3iv)
 
 GLDECL_FUNC (glUniform4iv)
 
 GLDECL_FUNC (glUniformMatrix2fv)
 
 GLDECL_FUNC (glUniformMatrix3fv)
 
 GLDECL_FUNC (glUniformMatrix4fv)
 
 GLDECL_FUNC (glUniformMatrix2x3fv)
 
 GLDECL_FUNC (glUniformMatrix3x2fv)
 
 GLDECL_FUNC (glUniformMatrix2x4fv)
 
 GLDECL_FUNC (glUniformMatrix4x2fv)
 
 GLDECL_FUNC (glUniformMatrix3x4fv)
 
 GLDECL_FUNC (glUniformMatrix4x3fv)
 
 GLDECL_FUNC (glGetProgramiv)
 
 GLDECL_FUNC (glGetProgramInfoLog)
 
 GLDECL_FUNC (glGetAttribLocation)
 
 GLDECL_FUNC (glBindFramebuffer)
 
 GLDECL_FUNC (glFramebufferTexture2D)
 
 GLDECL_FUNC (glGenFramebuffers)
 
 GLDECL_FUNC (glGenRenderbuffers)
 
 GLDECL_FUNC (glBindRenderbuffer)
 
 GLDECL_FUNC (glRenderbufferStorage)
 
 GLDECL_FUNC (glFramebufferRenderbuffer)
 
 GLDECL_FUNC (glDeleteFramebuffers)
 
 GLDECL_FUNC (glDeleteRenderbuffers)
 
 GLDECL_FUNC (glCheckFramebufferStatus)
 
 GLDECL_FUNC (glBlendColor)
 
 GLDECL_FUNC (glBlendEquationSeparate)
 
 GLDECL_FUNC (glBlendFuncSeparate)
 
 GLDECL_FUNC (glCompressedTexImage2D)
 
 GLDECL_FUNC (glCompressedTexSubImage2D)
 
 GLDECL_FUNC (glGenerateMipmap)
 
 GLDECL_FUNC (glGetShaderInfoLog)
 
 GLDECL_FUNC (glGetShaderSource)
 
 GLDECL_FUNC (glGetActiveAttrib)
 
 GLDECL_FUNC (glGetActiveUniform)
 
 GLDECL_FUNC (glGetAttachedShaders)
 
 GLDECL_FUNC (glBindAttribLocation)
 
 GLDECL_FUNC (glIsBuffer)
 
 GLDECL_FUNC (glIsFramebuffer)
 
 GLDECL_FUNC (glIsProgram)
 
 GLDECL_FUNC (glIsRenderbuffer)
 
 GLDECL_FUNC (glIsShader)
 
 GLDECL_FUNC (glSampleCoverage)
 
 GLDECL_FUNC (glStencilFuncSeparate)
 
 GLDECL_FUNC (glStencilOpSeparate)
 
 GLDECL_FUNC (glStencilMaskSeparate)
 
 GLDECL_FUNC (glValidateProgram)
 
 GLDECL_FUNC (glVertexAttrib1fv)
 
 GLDECL_FUNC (glVertexAttrib1f)
 
 GLDECL_FUNC (glVertexAttrib2f)
 
 GLDECL_FUNC (glVertexAttrib2fv)
 
 GLDECL_FUNC (glVertexAttrib3f)
 
 GLDECL_FUNC (glVertexAttrib3fv)
 
 GLDECL_FUNC (glVertexAttrib4f)
 
 GLDECL_FUNC (glVertexAttrib4fv)
 
 GLDECL_FUNC (glGetBufferParameteriv)
 
 GLDECL_FUNC (glGetFramebufferAttachmentParameteriv)
 
 GLDECL_FUNC (glGetVertexAttribiv)
 
 GLDECL_FUNC (glGetVertexAttribfv)
 
 GLDECL_FUNC (glGetVertexAttribPointerv)
 
 GLDECL_FUNC (glGetRenderbufferParameteriv)
 
 GLDECL_FUNC (glEnableVertexAttribArray)
 
 GLDECL_FUNC (glDisableVertexAttribArray)
 
 GLDECL_FUNC (glVertexAttribPointer)
 
 GLDECL_FUNC (glVertexAttribIPointer)
 
void gf_opengl_init ()
 
Bool gf_gl_txw_insert_fragment_shader (u32 pix_fmt, const char *tx_name, char **f_source, Bool y_flip)
 
Bool gf_gl_txw_setup (GF_GLTextureWrapper *tx, u32 pix_fmt, u32 width, u32 height, u32 stride, u32 uv_stride, Bool linear_interp, GF_FilterFrameInterface *frame_ifce, Bool full_range, s32 matrix_coef_or_neg)
 
Bool gf_gl_txw_upload (GF_GLTextureWrapper *tx, const u8 *data, GF_FilterFrameInterface *frame_ifce)
 
static void get_yuv_color_matrix (GF_GLTextureWrapper *tx, GF_Matrix *mx)
 
Bool gf_gl_txw_bind (GF_GLTextureWrapper *tx, const char *tx_name, u32 gl_program, u32 texture_unit)
 
void gf_gl_txw_reset (GF_GLTextureWrapper *tx)
 

Variables

static Bool gl_fun_loaded = GF_FALSE
 
static char * gl_shader_yuv_matrix
 
static char * gl_shader_vars_yuv
 
static char * gl_shader_fun_yuv
 
static char * gl_shader_fun_yvu
 
static char * gl_shader_vars_yuva
 
static char * gl_shader_fun_yuva
 
static char * gl_shader_vars_nv12
 
static char * gl_shader_fun_nv12
 
static char * gl_shader_vars_nv21
 
static char * gl_shader_fun_nv21
 
static char * gl_shader_vars_uyvu
 
static char * gl_shader_fun_uyvy
 
static char * gl_shader_fun_vyuy
 
static char * gl_shader_fun_yuyv
 
static char * gl_shader_fun_yvyu
 
static char * gl_shader_vars_yuv4_pack
 
static char * gl_shader_fun_yuv4_pack
 
static char * gl_shader_fun_vyu4_pack
 
static char * gl_shader_fun_yuv4a_pack
 
static char * gl_shader_fun_uyv4a_pack
 
static char * gl_shader_fun_yuv4_10_pack
 
static char * gl_shader_vars_v210
 
static char * gl_shader_fun_v210
 
static char * gl_shader_vars_rgb
 
static char * gl_shader_fun_alphagrey
 
static char * gl_shader_fun_rgb444
 
static char * gl_shader_fun_rgb555
 
static char * gl_shader_fun_rgb565
 
static char * gl_shader_fun_argb
 
static char * gl_shader_fun_abgr
 
static char * gl_shader_fun_bgra
 
static char * gl_shader_fun_rgb
 
static char * gl_shader_vars_externalOES
 
struct yuv_coefs YUVMatrices []
 

Data Structure Documentation

◆ yuv_coefs

struct yuv_coefs
Data Fields
u32 cicp
Double Kr
Double Kb

Function Documentation

◆ GLDECL_FUNC() [1/105]

GLDECL_FUNC ( glActiveTexture  )

! HORRIBLE HACK, but on my test devices, it seems that glClipPlanex is missing on the device but not in the SDK lib !!

◆ GLDECL_FUNC() [2/105]

GLDECL_FUNC ( glClientActiveTexture  )

◆ GLDECL_FUNC() [3/105]

GLDECL_FUNC ( glBlendEquation  )

◆ GLDECL_FUNC() [4/105]

GLDECL_FUNC ( glPointParameterf  )

◆ GLDECL_FUNC() [5/105]

GLDECL_FUNC ( glPointParameterfv  )

◆ GLDECL_FUNC() [6/105]

GLDECL_FUNC ( glGenBuffers  )

◆ GLDECL_FUNC() [7/105]

GLDECL_FUNC ( glDeleteBuffers  )

◆ GLDECL_FUNC() [8/105]

GLDECL_FUNC ( glBindBuffer  )

◆ GLDECL_FUNC() [9/105]

GLDECL_FUNC ( glBufferData  )

◆ GLDECL_FUNC() [10/105]

GLDECL_FUNC ( glBufferSubData  )

◆ GLDECL_FUNC() [11/105]

GLDECL_FUNC ( glMapBuffer  )

◆ GLDECL_FUNC() [12/105]

GLDECL_FUNC ( glUnmapBuffer  )

◆ GLDECL_FUNC() [13/105]

GLDECL_FUNC ( glCreateProgram  )

◆ GLDECL_FUNC() [14/105]

GLDECL_FUNC ( glDeleteProgram  )

◆ GLDECL_FUNC() [15/105]

GLDECL_FUNC ( glLinkProgram  )

◆ GLDECL_FUNC() [16/105]

GLDECL_FUNC ( glUseProgram  )

◆ GLDECL_FUNC() [17/105]

GLDECL_FUNC ( glCreateShader  )

◆ GLDECL_FUNC() [18/105]

GLDECL_FUNC ( glDeleteShader  )

◆ GLDECL_FUNC() [19/105]

GLDECL_FUNC ( glShaderSource  )

◆ GLDECL_FUNC() [20/105]

GLDECL_FUNC ( glCompileShader  )

◆ GLDECL_FUNC() [21/105]

GLDECL_FUNC ( glAttachShader  )

◆ GLDECL_FUNC() [22/105]

GLDECL_FUNC ( glDetachShader  )

◆ GLDECL_FUNC() [23/105]

GLDECL_FUNC ( glGetShaderiv  )

◆ GLDECL_FUNC() [24/105]

GLDECL_FUNC ( glGetInfoLogARB  )

◆ GLDECL_FUNC() [25/105]

GLDECL_FUNC ( glGetUniformLocation  )

◆ GLDECL_FUNC() [26/105]

GLDECL_FUNC ( glGetUniformfv  )

◆ GLDECL_FUNC() [27/105]

GLDECL_FUNC ( glGetUniformiv  )

◆ GLDECL_FUNC() [28/105]

GLDECL_FUNC ( glUniform1f  )

◆ GLDECL_FUNC() [29/105]

GLDECL_FUNC ( glUniform2f  )

◆ GLDECL_FUNC() [30/105]

GLDECL_FUNC ( glUniform3f  )

◆ GLDECL_FUNC() [31/105]

GLDECL_FUNC ( glUniform4f  )

◆ GLDECL_FUNC() [32/105]

GLDECL_FUNC ( glUniform1i  )

◆ GLDECL_FUNC() [33/105]

GLDECL_FUNC ( glUniform2i  )

◆ GLDECL_FUNC() [34/105]

GLDECL_FUNC ( glUniform3i  )

◆ GLDECL_FUNC() [35/105]

GLDECL_FUNC ( glUniform4i  )

◆ GLDECL_FUNC() [36/105]

GLDECL_FUNC ( glUniform1fv  )

◆ GLDECL_FUNC() [37/105]

GLDECL_FUNC ( glUniform2fv  )

◆ GLDECL_FUNC() [38/105]

GLDECL_FUNC ( glUniform3fv  )

◆ GLDECL_FUNC() [39/105]

GLDECL_FUNC ( glUniform4fv  )

◆ GLDECL_FUNC() [40/105]

GLDECL_FUNC ( glUniform1iv  )

◆ GLDECL_FUNC() [41/105]

GLDECL_FUNC ( glUniform2iv  )

◆ GLDECL_FUNC() [42/105]

GLDECL_FUNC ( glUniform3iv  )

◆ GLDECL_FUNC() [43/105]

GLDECL_FUNC ( glUniform4iv  )

◆ GLDECL_FUNC() [44/105]

GLDECL_FUNC ( glUniformMatrix2fv  )

◆ GLDECL_FUNC() [45/105]

GLDECL_FUNC ( glUniformMatrix3fv  )

◆ GLDECL_FUNC() [46/105]

GLDECL_FUNC ( glUniformMatrix4fv  )

◆ GLDECL_FUNC() [47/105]

GLDECL_FUNC ( glUniformMatrix2x3fv  )

◆ GLDECL_FUNC() [48/105]

GLDECL_FUNC ( glUniformMatrix3x2fv  )

◆ GLDECL_FUNC() [49/105]

GLDECL_FUNC ( glUniformMatrix2x4fv  )

◆ GLDECL_FUNC() [50/105]

GLDECL_FUNC ( glUniformMatrix4x2fv  )

◆ GLDECL_FUNC() [51/105]

GLDECL_FUNC ( glUniformMatrix3x4fv  )

◆ GLDECL_FUNC() [52/105]

GLDECL_FUNC ( glUniformMatrix4x3fv  )

◆ GLDECL_FUNC() [53/105]

GLDECL_FUNC ( glGetProgramiv  )

◆ GLDECL_FUNC() [54/105]

GLDECL_FUNC ( glGetProgramInfoLog  )

◆ GLDECL_FUNC() [55/105]

GLDECL_FUNC ( glGetAttribLocation  )

◆ GLDECL_FUNC() [56/105]

GLDECL_FUNC ( glBindFramebuffer  )

◆ GLDECL_FUNC() [57/105]

GLDECL_FUNC ( glFramebufferTexture2D  )

◆ GLDECL_FUNC() [58/105]

GLDECL_FUNC ( glGenFramebuffers  )

◆ GLDECL_FUNC() [59/105]

GLDECL_FUNC ( glGenRenderbuffers  )

◆ GLDECL_FUNC() [60/105]

GLDECL_FUNC ( glBindRenderbuffer  )

◆ GLDECL_FUNC() [61/105]

GLDECL_FUNC ( glRenderbufferStorage  )

◆ GLDECL_FUNC() [62/105]

GLDECL_FUNC ( glFramebufferRenderbuffer  )

◆ GLDECL_FUNC() [63/105]

GLDECL_FUNC ( glDeleteFramebuffers  )

◆ GLDECL_FUNC() [64/105]

GLDECL_FUNC ( glDeleteRenderbuffers  )

◆ GLDECL_FUNC() [65/105]

GLDECL_FUNC ( glCheckFramebufferStatus  )

◆ GLDECL_FUNC() [66/105]

GLDECL_FUNC ( glBlendColor  )

◆ GLDECL_FUNC() [67/105]

GLDECL_FUNC ( glBlendEquationSeparate  )

◆ GLDECL_FUNC() [68/105]

GLDECL_FUNC ( glBlendFuncSeparate  )

◆ GLDECL_FUNC() [69/105]

GLDECL_FUNC ( glCompressedTexImage2D  )

◆ GLDECL_FUNC() [70/105]

GLDECL_FUNC ( glCompressedTexSubImage2D  )

◆ GLDECL_FUNC() [71/105]

GLDECL_FUNC ( glGenerateMipmap  )

◆ GLDECL_FUNC() [72/105]

GLDECL_FUNC ( glGetShaderInfoLog  )

◆ GLDECL_FUNC() [73/105]

GLDECL_FUNC ( glGetShaderSource  )

◆ GLDECL_FUNC() [74/105]

GLDECL_FUNC ( glGetActiveAttrib  )

◆ GLDECL_FUNC() [75/105]

GLDECL_FUNC ( glGetActiveUniform  )

◆ GLDECL_FUNC() [76/105]

GLDECL_FUNC ( glGetAttachedShaders  )

◆ GLDECL_FUNC() [77/105]

GLDECL_FUNC ( glBindAttribLocation  )

◆ GLDECL_FUNC() [78/105]

GLDECL_FUNC ( glIsBuffer  )

◆ GLDECL_FUNC() [79/105]

GLDECL_FUNC ( glIsFramebuffer  )

◆ GLDECL_FUNC() [80/105]

GLDECL_FUNC ( glIsProgram  )

◆ GLDECL_FUNC() [81/105]

GLDECL_FUNC ( glIsRenderbuffer  )

◆ GLDECL_FUNC() [82/105]

GLDECL_FUNC ( glIsShader  )

◆ GLDECL_FUNC() [83/105]

GLDECL_FUNC ( glSampleCoverage  )

◆ GLDECL_FUNC() [84/105]

GLDECL_FUNC ( glStencilFuncSeparate  )

◆ GLDECL_FUNC() [85/105]

GLDECL_FUNC ( glStencilOpSeparate  )

◆ GLDECL_FUNC() [86/105]

GLDECL_FUNC ( glStencilMaskSeparate  )

◆ GLDECL_FUNC() [87/105]

GLDECL_FUNC ( glValidateProgram  )

◆ GLDECL_FUNC() [88/105]

GLDECL_FUNC ( glVertexAttrib1fv  )

◆ GLDECL_FUNC() [89/105]

GLDECL_FUNC ( glVertexAttrib1f  )

◆ GLDECL_FUNC() [90/105]

GLDECL_FUNC ( glVertexAttrib2f  )

◆ GLDECL_FUNC() [91/105]

GLDECL_FUNC ( glVertexAttrib2fv  )

◆ GLDECL_FUNC() [92/105]

GLDECL_FUNC ( glVertexAttrib3f  )

◆ GLDECL_FUNC() [93/105]

GLDECL_FUNC ( glVertexAttrib3fv  )

◆ GLDECL_FUNC() [94/105]

GLDECL_FUNC ( glVertexAttrib4f  )

◆ GLDECL_FUNC() [95/105]

GLDECL_FUNC ( glVertexAttrib4fv  )

◆ GLDECL_FUNC() [96/105]

GLDECL_FUNC ( glGetBufferParameteriv  )

◆ GLDECL_FUNC() [97/105]

GLDECL_FUNC ( glGetFramebufferAttachmentParameteriv  )

◆ GLDECL_FUNC() [98/105]

GLDECL_FUNC ( glGetVertexAttribiv  )

◆ GLDECL_FUNC() [99/105]

GLDECL_FUNC ( glGetVertexAttribfv  )

◆ GLDECL_FUNC() [100/105]

GLDECL_FUNC ( glGetVertexAttribPointerv  )

◆ GLDECL_FUNC() [101/105]

GLDECL_FUNC ( glGetRenderbufferParameteriv  )

◆ GLDECL_FUNC() [102/105]

GLDECL_FUNC ( glEnableVertexAttribArray  )

◆ GLDECL_FUNC() [103/105]

GLDECL_FUNC ( glDisableVertexAttribArray  )

◆ GLDECL_FUNC() [104/105]

GLDECL_FUNC ( glVertexAttribPointer  )

◆ GLDECL_FUNC() [105/105]

GLDECL_FUNC ( glVertexAttribIPointer  )

◆ gf_opengl_init()

void gf_opengl_init ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_gl_txw_insert_fragment_shader()

Bool gf_gl_txw_insert_fragment_shader ( u32  pix_fmt,
const char *  tx_name,
char **  f_source,
Bool  y_flip 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_gl_txw_setup()

Bool gf_gl_txw_setup ( GF_GLTextureWrapper *  tx,
u32  pix_fmt,
u32  width,
u32  height,
u32  stride,
u32  uv_stride,
Bool  linear_interp,
GF_FilterFrameInterface frame_ifce,
Bool  full_range,
s32  matrix_coef_or_neg 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_gl_txw_upload()

Bool gf_gl_txw_upload ( GF_GLTextureWrapper *  tx,
const u8 data,
GF_FilterFrameInterface frame_ifce 
)
+ Here is the caller graph for this function:

◆ get_yuv_color_matrix()

static void get_yuv_color_matrix ( GF_GLTextureWrapper *  tx,
GF_Matrix mx 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_gl_txw_bind()

Bool gf_gl_txw_bind ( GF_GLTextureWrapper *  tx,
const char *  tx_name,
u32  gl_program,
u32  texture_unit 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_gl_txw_reset()

void gf_gl_txw_reset ( GF_GLTextureWrapper *  tx)
+ Here is the caller graph for this function:

Variable Documentation

◆ gl_fun_loaded

Bool gl_fun_loaded = GF_FALSE
static

◆ gl_shader_yuv_matrix

char* gl_shader_yuv_matrix
static
Initial value:
=
"uniform mat4 _gf_%s_mx;\n\
"

◆ gl_shader_vars_yuv

char* gl_shader_vars_yuv
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\n\
uniform sampler2D _gf_%s_2;\n\
uniform sampler2D _gf_%s_3;\n\
"

◆ gl_shader_fun_yuv

char* gl_shader_fun_yuv
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv.x = texture2D(_gf_%s_1, texc).r;\n\
yuv.y = texture2D(_gf_%s_2, texc).r;\n\
yuv.z = texture2D(_gf_%s_3, texc).r;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_fun_yvu

char* gl_shader_fun_yvu
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv.x = texture2D(_gf_%s_1, texc).r;\n\
yuv.y = texture2D(_gf_%s_3, texc).r;\n\
yuv.z = texture2D(_gf_%s_2, texc).r;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_vars_yuva

char* gl_shader_vars_yuva
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\n\
uniform sampler2D _gf_%s_2;\n\
uniform sampler2D _gf_%s_3;\n\
uniform sampler2D _gf_%s_4;\n\
"

◆ gl_shader_fun_yuva

char* gl_shader_fun_yuva
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv.x = texture2D(_gf_%s_1, texc).r;\n\
yuv.y = texture2D(_gf_%s_2, texc).r;\n\
yuv.z = texture2D(_gf_%s_3, texc).r;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = texture2D(_gf_%s_4, texc).r;\n\
return yuv;\n\
"

◆ gl_shader_vars_nv12

char* gl_shader_vars_nv12
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\n\
uniform sampler2D _gf_%s_2;\n\
"

◆ gl_shader_fun_nv12

char* gl_shader_fun_nv12
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv.x = texture2D(_gf_%s_1, texc).r;\n\
yuv.yz = texture2D(_gf_%s_2, texc).ra;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_vars_nv21

char* gl_shader_vars_nv21
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\n\
uniform sampler2D _gf_%s_2;\n\
"

◆ gl_shader_fun_nv21

char* gl_shader_fun_nv21
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv.x = texture2D(_gf_%s_1, texc).r;\n\
yuv.yz = texture2D(_gf_%s_2, texc).ar;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_vars_uyvu

char* gl_shader_vars_uyvu
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\
uniform float _gf_%s_width;\
"

◆ gl_shader_fun_uyvy

char* gl_shader_fun_uyvy
static
Initial value:
=
"vec2 texc, t_texc;\
vec4 yuv;\
vec4 uyvy;\
float tex_s;\
texc = _gpacTexCoord.st;\
t_texc = texc * vec2(1, 1);\
uyvy = texture2D(_gf_%s_1, t_texc); \
tex_s = texc.x*_gf_%s_width;\
if (tex_s - (2.0 * floor(tex_s/2.0)) == 1.0) {\
uyvy.g = uyvy.a; \
}\
yuv.r = uyvy.g;\
yuv.g = uyvy.r;\
yuv.b = uyvy.b;\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_fun_vyuy

char* gl_shader_fun_vyuy
static
Initial value:
=
"vec2 texc, t_texc;\
vec4 yuv;\
vec4 vyuy;\
float tex_s;\
texc = _gpacTexCoord.st;\
t_texc = texc * vec2(1, 1);\
vyuy = texture2D(_gf_%s_1, t_texc); \
tex_s = texc.x*_gf_%s_width;\
if (tex_s - (2.0 * floor(tex_s/2.0)) == 1.0) {\
vyuy.g = vyuy.a; \
}\
yuv.r = vyuy.g;\
yuv.g = vyuy.b;\
yuv.b = vyuy.r;\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_fun_yuyv

char* gl_shader_fun_yuyv
static
Initial value:
=
"vec2 texc, t_texc;\
vec4 yuv;\
vec4 yvyu;\
float tex_s;\
texc = _gpacTexCoord.st;\
t_texc = texc * vec2(1, 1);\
yvyu = texture2D(_gf_%s_1, t_texc); \
tex_s = texc.x*_gf_%s_width;\
if (tex_s - (2.0 * floor(tex_s/2.0)) == 1.0) {\
yvyu.r = yvyu.b; \
}\
yuv.r = yvyu.r;\
yuv.g = yvyu.g;\
yuv.b = yvyu.a;\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_fun_yvyu

char* gl_shader_fun_yvyu
static
Initial value:
=
"vec2 texc, t_texc;\
vec4 yuv;\
vec4 yuyv;\
float tex_s;\
texc = _gpacTexCoord.st;\
t_texc = texc * vec2(1, 1);\
yuyv = texture2D(_gf_%s_1, t_texc); \
tex_s = texc.x*_gf_%s_width;\
if (tex_s - (2.0 * floor(tex_s/2.0)) == 1.0) {\
yuyv.r = yuyv.b; \
}\
yuv.r = yuyv.r;\
yuv.g = yuyv.a;\
yuv.b = yuyv.g;\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_vars_yuv4_pack

char* gl_shader_vars_yuv4_pack
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\n\
"

◆ gl_shader_fun_yuv4_pack

char* gl_shader_fun_yuv4_pack
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv = texture2D(_gf_%s_1, texc);\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_fun_vyu4_pack

char* gl_shader_fun_vyu4_pack
static
Initial value:
=
"vec2 texc;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
yuv.rgb = texture2D(_gf_%s_1, texc).gbr;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_fun_yuv4a_pack

char* gl_shader_fun_yuv4a_pack
static
Initial value:
=
"vec2 texc;\n\
vec4 tex;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
tex = texture2D(_gf_%s_1, texc);\n\
yuv.rgb = tex.rgb;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = tex.a;\n\
return yuv;\n\
"

◆ gl_shader_fun_uyv4a_pack

char* gl_shader_fun_uyv4a_pack
static
Initial value:
=
"vec2 texc;\n\
vec4 tex;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
tex = texture2D(_gf_%s_1, texc);\n\
yuv.rgb = tex.grb;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = tex.a;\n\
return yuv;\n\
"

◆ gl_shader_fun_yuv4_10_pack

char* gl_shader_fun_yuv4_10_pack
static
Initial value:
=
"vec2 texc;\n\
vec4 val;\n\
int valr, valg, valb, vala, interm1, interm2;\n\
vec4 yuv;\n\
texc = _gpacTexCoord.st;\n\
val = texture2D(_gf_%s_1, texc).rgba;\n\
vala = int(val.a*255.0);\n\
valb = int(val.b*255.0);\n\
valg = int(val.g*255.0);\n\
valr = int(val.r*255.0 / 64.0);\n\
interm1 = valb / 64;\n\
yuv.b = float( (vala * 4) + (interm1) ) / 1023.0;\n\
interm1 *= 64;\n\
interm2 = valg / 16;\n\
yuv.r = float( ((valb - interm1) * 16) + (interm2) ) / 1023.0;\n\
interm2 *= 16;\n\
yuv.g = float( ((valg - interm2) * 64) + valr ) / 1023.0;\n\
yuv.w = 1.0;\n\
yuv = _gf_%s_mx * yuv;\n\
yuv.w = 1.0;\n\
return yuv;\n\
"

◆ gl_shader_vars_v210

char* gl_shader_vars_v210
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\
uniform float _gf_%s_width;\
uniform float _gf_%s_gpu_width;\
"

◆ gl_shader_fun_v210

char* gl_shader_fun_v210
static

◆ gl_shader_vars_rgb

char* gl_shader_vars_rgb
static
Initial value:
=
"uniform sampler2D _gf_%s_1;\n\
"

◆ gl_shader_fun_alphagrey

char* gl_shader_fun_alphagrey
static
Initial value:
=
"vec4 col, ocol;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
ocol.r = ocol.g = ocol.b = col.a;\n\
ocol.a = col.r;\n\
return ocol;\n\
"

◆ gl_shader_fun_rgb444

char* gl_shader_fun_rgb444
static
Initial value:
=
"vec4 col, ocol;\n\
float res, col_g, col_b;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
res = floor( 255.0 * col.a );\n\
col_g = floor(res / 16.0);\n\
col_b = floor(res - col_g*16.0);\n\
ocol.r = col.r * 17.0;\n\
ocol.g = col_g / 15.0;\n\
ocol.b = col_b / 15.0;\n\
ocol.a = 1.0;\n\
return ocol;\
"

◆ gl_shader_fun_rgb555

char* gl_shader_fun_rgb555
static
Initial value:
=
"vec4 col, ocol;\n\
float res, col_r, col_g1, col_g, col_b;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
res = floor(255.0 * col.r);\n\
col_r = floor(res / 4.0);\n\
col_g1 = floor(res - col_r*4.0);\n\
res = floor(255.0 * col.a);\n\
col_g = floor(res / 32);\n\
col_b = floor(res - col_g*32.0);\n\
col_g += col_g1 * 8;\n\
ocol.r = col_r / 31.0;\n\
ocol.g = col_g / 31.0;\n\
ocol.b = col_b / 31.0;\n\
ocol.a = 1.0;\n\
return ocol;\
"

◆ gl_shader_fun_rgb565

char* gl_shader_fun_rgb565
static
Initial value:
=
"vec4 col, ocol;\n\
float res, col_r, col_g1, col_g, col_b;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
res = floor(255.0 * col.r);\n\
col_r = floor(res / 8.0);\n\
col_g1 = floor(res - col_r*8.0);\n\
res = floor(255.0 * col.a);\n\
col_g = floor(res / 32);\n\
col_b = floor(res - col_g*32.0);\n\
col_g += col_g1 * 8;\n\
ocol.r = col_r / 31.0;\n\
ocol.g = col_g / 63.0;\n\
ocol.b = col_b / 31.0;\n\
ocol.a = 1.0;\n\
return ocol;\
"

◆ gl_shader_fun_argb

char* gl_shader_fun_argb
static
Initial value:
=
"vec4 col, ocol;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
ocol.r = col.g;\n\
ocol.g = col.b;\n\
ocol.b = col.a;\n\
ocol.a = col.r;\n\
return ocol;\
"

◆ gl_shader_fun_abgr

char* gl_shader_fun_abgr
static
Initial value:
=
"vec4 col, ocol;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
ocol.r = col.a;\n\
ocol.g = col.b;\n\
ocol.b = col.g;\n\
ocol.a = col.r;\n\
return ocol;\
"

◆ gl_shader_fun_bgra

char* gl_shader_fun_bgra
static
Initial value:
=
"vec4 col, ocol;\n\
col = texture2D(_gf_%s_1, _gpacTexCoord.st);\n\
ocol.r = col.b;\n\
ocol.g = col.g;\n\
ocol.b = col.r;\n\
ocol.a = col.a;\n\
return ocol;\
"

◆ gl_shader_fun_rgb

char* gl_shader_fun_rgb
static
Initial value:
=
"return texture2D(_gf_%s_1, _gpacTexCoord.st);\
"

◆ gl_shader_vars_externalOES

char* gl_shader_vars_externalOES
static
Initial value:
=
"uniform samplerExternalOES _gf_%s_1;\n\
"

◆ YUVMatrices

struct yuv_coefs YUVMatrices[]
Initial value:
= {
{GF_CICP_MX_BT709, 0.2126, 0.0722},
{GF_CICP_MX_FCC47, 0.3, 0.11},
{GF_CICP_MX_BT601_625, 0.299, 0.114},
{GF_CICP_MX_SMPTE170, 0.299, 0.114},
{GF_CICP_MX_SMPTE240, 0.212, 0.087},
{GF_CICP_MX_BT2020, 0.2627, 0.0593},
{GF_CICP_MX_BT2020_CL, 0.2627, 0.0593}
}
@ GF_CICP_MX_SMPTE240
Definition: constants.h:1645
@ GF_CICP_MX_BT709
Definition: constants.h:1639
@ GF_CICP_MX_BT2020_CL
Definition: constants.h:1648
@ GF_CICP_MX_BT601_625
Definition: constants.h:1643
@ GF_CICP_MX_SMPTE170
Definition: constants.h:1644
@ GF_CICP_MX_BT2020
Definition: constants.h:1647
@ GF_CICP_MX_FCC47
Definition: constants.h:1642