FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Variables
opengl_enc_shaders.h File Reference
#include "libavutil/pixfmt.h"

Go to the source code of this file.

Variables

static const char *const FF_OPENGL_VERTEX_SHADER
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET
 Fragment shader for packet RGBA formats. More...
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET
 Fragment shader for packet RGB formats. More...
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR
 Fragment shader for planar RGBA formats. More...
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR
 Fragment shader for planar RGB formats. More...
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR
 Fragment shader for planar YUV formats. More...
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR
 Fragment shader for planar YUVA formats. More...
 
static const char *const FF_OPENGL_FRAGMENT_SHADER_GRAY
 

Variable Documentation

const char* const FF_OPENGL_VERTEX_SHADER
static
Initial value:
=
"uniform mat4 u_projectionMatrix;"
"uniform mat4 u_modelViewMatrix;"
"attribute vec4 a_position;"
"attribute vec2 a_textureCoords;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"gl_Position = u_projectionMatrix * (a_position * u_modelViewMatrix);"
"texture_coordinate = a_textureCoords;"
"}"

Definition at line 26 of file opengl_enc_shaders.h.

Referenced by opengl_compile_shaders().

const char* const FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET
static
Initial value:
=
"uniform sampler2D u_texture0;"
"uniform mat4 u_colorMap;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"gl_FragColor = texture2D(u_texture0, texture_coordinate) * u_colorMap;"
"}"

Fragment shader for packet RGBA formats.

Definition at line 44 of file opengl_enc_shaders.h.

const char* const FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET
static
Initial value:
=
"uniform sampler2D u_texture0;"
"uniform mat4 u_colorMap;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"gl_FragColor = vec4((texture2D(u_texture0, texture_coordinate) * u_colorMap).rgb, 1.0);"
"}"

Fragment shader for packet RGB formats.

Definition at line 61 of file opengl_enc_shaders.h.

const char* const FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR
static
Initial value:
=
"uniform sampler2D u_texture0;"
"uniform sampler2D u_texture1;"
"uniform sampler2D u_texture2;"
"uniform sampler2D u_texture3;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"gl_FragColor = vec4(texture2D(u_texture0, texture_coordinate).r,"
"texture2D(u_texture1, texture_coordinate).r,"
"texture2D(u_texture2, texture_coordinate).r,"
"texture2D(u_texture3, texture_coordinate).r);"
"}"

Fragment shader for planar RGBA formats.

Definition at line 78 of file opengl_enc_shaders.h.

const char* const FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR
static
Initial value:
=
"uniform sampler2D u_texture0;"
"uniform sampler2D u_texture1;"
"uniform sampler2D u_texture2;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"gl_FragColor = vec4(texture2D(u_texture0, texture_coordinate).r,"
"texture2D(u_texture1, texture_coordinate).r,"
"texture2D(u_texture2, texture_coordinate).r,"
"1.0);"
"}"

Fragment shader for planar RGB formats.

Definition at line 100 of file opengl_enc_shaders.h.

const char* const FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR
static
Initial value:
=
"uniform sampler2D u_texture0;"
"uniform sampler2D u_texture1;"
"uniform sampler2D u_texture2;"
"uniform float u_chroma_div_w;"
"uniform float u_chroma_div_h;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"vec3 yuv;"
"yuv.r = texture2D(u_texture0, texture_coordinate).r - 0.0625;"
"yuv.g = texture2D(u_texture1, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
"yuv.b = texture2D(u_texture2, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
"gl_FragColor = clamp(vec4(mat3(1.1643, 1.16430, 1.1643,"
"0.0, -0.39173, 2.0170,"
"1.5958, -0.81290, 0.0) * yuv, 1.0), 0.0, 1.0);"
"}"

Fragment shader for planar YUV formats.

Definition at line 121 of file opengl_enc_shaders.h.

const char* const FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR
static
Initial value:
=
"uniform sampler2D u_texture0;"
"uniform sampler2D u_texture1;"
"uniform sampler2D u_texture2;"
"uniform sampler2D u_texture3;"
"uniform float u_chroma_div_w;"
"uniform float u_chroma_div_h;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"vec3 yuv;"
"yuv.r = texture2D(u_texture0, texture_coordinate).r - 0.0625;"
"yuv.g = texture2D(u_texture1, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
"yuv.b = texture2D(u_texture2, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;"
"gl_FragColor = clamp(vec4(mat3(1.1643, 1.16430, 1.1643,"
"0.0, -0.39173, 2.0170,"
"1.5958, -0.81290, 0.0) * yuv, texture2D(u_texture3, texture_coordinate).r), 0.0, 1.0);"
"}"

Fragment shader for planar YUVA formats.

Definition at line 150 of file opengl_enc_shaders.h.

const char* const FF_OPENGL_FRAGMENT_SHADER_GRAY
static
Initial value:
=
"uniform sampler2D u_texture0;"
"varying vec2 texture_coordinate;"
"void main()"
"{"
"float c = texture2D(u_texture0, texture_coordinate).r;"
"gl_FragColor = vec4(c, c, c, 1.0);"
"}"

Definition at line 176 of file opengl_enc_shaders.h.