34 #define WIN32_LEAN_AND_MEAN
38 #include <OpenGL/gl3.h>
45 #if HAVE_GLXGETPROCADDRESS
76 #define FF_GL_RED_COMPONENT GL_RED
77 #elif defined(GL_LUMINANCE)
78 #define FF_GL_RED_COMPONENT GL_LUMINANCE
80 #define FF_GL_RED_COMPONENT 0x1903; //GL_RED
84 #define FF_GL_UNSIGNED_BYTE_3_3_2 0x8032
85 #define FF_GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
86 #define FF_GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
87 #define FF_GL_UNPACK_ROW_LENGTH 0x0CF2
90 #define FF_GL_ARRAY_BUFFER 0x8892
91 #define FF_GL_ELEMENT_ARRAY_BUFFER 0x8893
92 #define FF_GL_STATIC_DRAW 0x88E4
93 #define FF_GL_FRAGMENT_SHADER 0x8B30
94 #define FF_GL_VERTEX_SHADER 0x8B31
95 #define FF_GL_COMPILE_STATUS 0x8B81
96 #define FF_GL_LINK_STATUS 0x8B82
97 #define FF_GL_INFO_LOG_LENGTH 0x8B84
98 typedef void (
APIENTRY *FF_PFNGLACTIVETEXTUREPROC) (GLenum texture);
152 #define OPENGL_ERROR_CHECK(ctx) \
155 if ((err_code = glGetError()) != GL_NO_ERROR) { \
156 av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __FUNCTION__, __LINE__, err_code); \
178 SDL_Surface *surface;
347 opengl->surface = SDL_SetVideoMode(width, height,
348 32, SDL_OPENGL | SDL_RESIZABLE);
349 if (!opengl->surface) {
353 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
354 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
355 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
356 SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
357 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
367 while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_ALLEVENTS) > 0) {
368 switch (event.type) {
372 switch (event.key.keysym.sym) {
378 case SDL_VIDEORESIZE: {
383 SDL_VideoDriverName(buffer,
sizeof(buffer));
388 if ((ret = opengl_sdl_recreate_window(opengl, event.resize.w, event.resize.h)) < 0)
392 message.
width = opengl->surface->w;
393 message.
height = opengl->surface->h;
407 if (SDL_Init(SDL_INIT_VIDEO)) {
411 if ((ret = opengl_sdl_recreate_window(opengl, opengl->
window_width,
414 av_log(opengl,
AV_LOG_INFO,
"SDL driver: '%s'.\n", SDL_VideoDriverName(buffer,
sizeof(buffer)));
415 message.
width = opengl->surface->w;
416 message.
height = opengl->surface->h;
426 #define LOAD_OPENGL_FUN(name, type) \
427 procs->name = (type)SDL_GL_GetProcAddress(#name); \
428 if (!procs->name) { \
429 av_log(opengl, AV_LOG_ERROR, "Cannot load OpenGL function: '%s'\n", #name); \
430 return AVERROR(ENOSYS); \
456 LOAD_OPENGL_FUN(glEnableVertexAttribArray, FF_PFNGLENABLEVERTEXATTRIBARRAYPROC)
457 LOAD_OPENGL_FUN(glVertexAttribPointer, FF_PFNGLVERTEXATTRIBPOINTERPROC)
461 #undef LOAD_OPENGL_FUN
465 #if defined(__APPLE__)
472 return opengl_sdl_load_procedures(opengl);
507 #if HAVE_GLXGETPROCADDRESS
508 #define SelectedGetProcAddress glXGetProcAddress
509 #elif HAVE_WGLGETPROCADDRESS
510 #define SelectedGetProcAddress wglGetProcAddress
513 #define LOAD_OPENGL_FUN(name, type) \
514 procs->name = (type)SelectedGetProcAddress(#name); \
515 if (!procs->name) { \
516 av_log(opengl, AV_LOG_ERROR, "Cannot load OpenGL function: '%s'\n", #name); \
517 return AVERROR(ENOSYS); \
522 return opengl_sdl_load_procedures(opengl);
548 LOAD_OPENGL_FUN(glEnableVertexAttribArray, FF_PFNGLENABLEVERTEXATTRIBARRAYPROC)
549 LOAD_OPENGL_FUN(glVertexAttribPointer, FF_PFNGLVERTEXATTRIBPOINTERPROC)
553 #undef SelectedGetProcAddress
554 #undef LOAD_OPENGL_FUN
560 memset(matrix, 0, 16 *
sizeof(
float));
561 matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.0f;
565 float bottom,
float top,
float nearZ,
float farZ)
567 float ral = right + left;
568 float rsl = right - left;
569 float tab = top + bottom;
570 float tsb = top - bottom;
571 float fan = farZ + nearZ;
572 float fsn = farZ - nearZ;
574 memset(matrix, 0, 16 *
sizeof(
float));
575 matrix[0] = 2.0f / rsl;
576 matrix[5] = 2.0f / tsb;
577 matrix[10] = -2.0f / fsn;
578 matrix[12] = -ral / rsl;
579 matrix[13] = -tab / tsb;
580 matrix[14] = -fan / fsn;
587 const char *extension;
590 } required_extensions[] = {
591 {
"GL_ARB_multitexture", 1, 3 },
592 {
"GL_ARB_vertex_buffer_object", 1, 5 },
593 {
"GL_ARB_vertex_shader", 2, 0 },
594 {
"GL_ARB_fragment_shader", 2, 0 },
595 {
"GL_ARB_shader_objects", 2, 0 },
599 const char *extensions, *
version;
601 version = glGetString(GL_VERSION);
602 extensions = glGetString(GL_EXTENSIONS);
605 sscanf(version,
"%d.%d", &major, &minor);
607 for (i = 0; required_extensions[i].extension; i++) {
608 if (major < required_extensions[i].major &&
609 (major == required_extensions[i].major && minor < required_extensions[i].minor) &&
610 !strstr(extensions, required_extensions[i].extension)) {
612 required_extensions[i].extension);
619 opengl->
non_pow_2_textures = major >= 2 || strstr(extensions,
"GL_ARB_texture_non_power_of_two");
620 #if defined(GL_ES_VERSION_2_0)
621 opengl->
unpack_subimage = !!strstr(extensions,
"GL_EXT_unpack_subimage");
651 case GL_UNSIGNED_SHORT:
653 case GL_UNSIGNED_SHORT_5_6_5:
655 case GL_UNSIGNED_BYTE:
701 int *out_width,
int *out_height)
704 *out_width = in_width;
705 *out_height = in_height;
708 unsigned power_of_2 = 1;
709 while (power_of_2 < max)
711 *out_height = power_of_2;
712 *out_width = power_of_2;
714 in_width, in_height, *out_width, *out_height);
735 #define FILL_COMPONENT(i) { \
736 shift = desc->comp[i].depth_minus1 >> 3; \
737 opengl->color_map[(i << 2) + ((desc->comp[i].offset_plus1 - 1) >> shift)] = 1.0; \
747 #undef FILL_COMPONENT
786 if (!fragment_shader_code) {
799 fragment_shader_code);
851 GLsizei width, GLsizei height)
856 glBindTexture(GL_TEXTURE_2D, texture);
857 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
858 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
859 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
860 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
861 glTexImage2D(GL_TEXTURE_2D, 0, opengl->
format, new_width, new_height, 0,
921 for (i = 0; i < 4; i++)
947 if ((ret = opengl_sdl_create_window(h)) < 0) {
952 av_log(opengl,
AV_LOG_ERROR,
"FFmpeg is compiled without SDL. Cannot create default window.\n");
957 message.
x = message.
y = 0;
961 &message ,
sizeof(message))) < 0) {
1032 for (i = 1; i < num_planes; i++)
1048 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1051 (
float)opengl->
background[2] / 255.0f, 1.0f);
1110 glClear(GL_COLOR_BUFFER_BIT);
1114 SDL_GL_SwapBuffers();
1146 data += opengl->
width * opengl->
height * wordsize;
1149 data += opengl->
width * opengl->
height * wordsize;
1150 data += width_chroma * height_chroma * wordsize;
1153 data += opengl->
width * opengl->
height * wordsize;
1154 data += 2 * width_chroma * height_chroma * wordsize;
1162 #define LOAD_TEXTURE_DATA(comp_index, sub) \
1164 int width = sub ? FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w) : opengl->width; \
1165 int height = sub ? FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h): opengl->height; \
1167 int plane = desc->comp[comp_index].plane; \
1169 glBindTexture(GL_TEXTURE_2D, opengl->texture_name[comp_index]); \
1171 GLint length = ((AVFrame *)input)->linesize[plane]; \
1172 int bytes_per_pixel = opengl_type_size(opengl->type); \
1173 if (!(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) \
1174 bytes_per_pixel *= desc->nb_components; \
1175 data = ((AVFrame *)input)->data[plane]; \
1176 if (!(length % bytes_per_pixel) && \
1177 (opengl->unpack_subimage || ((length / bytes_per_pixel) == width))) { \
1178 length /= bytes_per_pixel; \
1179 if (length != width) \
1180 glPixelStorei(FF_GL_UNPACK_ROW_LENGTH, length); \
1181 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, \
1182 opengl->format, opengl->type, data); \
1183 if (length != width) \
1184 glPixelStorei(FF_GL_UNPACK_ROW_LENGTH, 0); \
1187 for (h = 0; h < height; h++) { \
1188 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, h, width, 1, \
1189 opengl->format, opengl->type, data); \
1194 data = opengl_get_plane_pointer(opengl, input, comp_index, desc); \
1195 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, \
1196 opengl->format, opengl->type, data); \
1208 if (!opengl->
no_window && (ret = opengl_sdl_process_events(h)) < 0)
1217 glClear(GL_COLOR_BUFFER_BIT);
1221 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1250 SDL_GL_SwapBuffers();
1276 #define OFFSET(x) offsetof(OpenGLContext, x)
1277 #define ENC AV_OPT_FLAG_ENCODING_PARAM
1306 .priv_class = &opengl_class,
GLint max_texture_size
Maximum texture size.
GLfloat model_view_matrix[16]
Modev view matrix.
ptrdiff_t const GLvoid GLenum usage
#define AV_PIX_FMT_YUVA422P16
static const GLushort g_index[6]
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR
Fragment shader for planar RGBA formats.
static enum AVPixelFormat pix_fmt
int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, void *data, size_t data_size)
Send control message from device to application.
static int shift(int a, int b)
#define FF_GL_FRAGMENT_SHADER
FF_PFNGLDELETESHADERPROC glDeleteShader
static int opengl_prepare(OpenGLContext *opengl)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
GLfloat chroma_div_h
Chroma subsampling h ratio.
int x
x coordinate of top left corner
int picture_width
Rendered width.
ptrdiff_t const GLvoid * data
FF_PFNGLDELETEPROGRAMPROC glDeleteProgram
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
static int opengl_type_size(GLenum type)
#define LOAD_OPENGL_FUN(name, type)
#define LIBAVUTIL_VERSION_INT
packed RGB 8:8:8, 24bpp, RGBRGB...
#define FF_GL_LINK_STATUS
#define AV_PIX_FMT_RGBA64
GLint model_view_matrix_location
int inited
Set to 1 when write_header was successfully called.
int no_window
0 for create default window
Destroy window buffer message.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define AV_PIX_FMT_BGRA64
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define OPENGL_ERROR_CHECK(ctx)
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
AVS_VideoFrame int int int int new_height
static av_cold int opengl_write_trailer(AVFormatContext *h)
static const char *const FF_OPENGL_VERTEX_SHADER
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
FF_PFNGLATTACHSHADERPROC glAttachShader
GLint texture_location[4]
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
static void opengl_compute_display_area(AVFormatContext *s)
Window size change message.
FF_PFNGLUSEPROGRAMPROC glUseProgram
static av_cold int opengl_init_context(OpenGLContext *opengl)
GLsizei const char ** string
FF_PFNGLCOMPILESHADERPROC glCompileShader
GLint GLenum GLboolean normalized
static int opengl_write_packet(AVFormatContext *h, AVPacket *pkt)
FF_PFNGLSHADERSOURCEPROC glShaderSource
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static av_cold void opengl_fill_color_map(OpenGLContext *opengl)
#define FF_GL_ELEMENT_ARRAY_BUFFER
FF_PFNGLUNIFORM1FPROC glUniform1f
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
#define FF_GL_UNSIGNED_BYTE_3_3_2
FF_PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
GLint position_attrib
Attibutes' locations.
static av_cold int end(AVCodecContext *avctx)
FF_PFNGLGETSHADERIVPROC glGetShaderiv
FF_PFNGLBINDBUFFERPROC glBindBuffer
static int opengl_resize(AVFormatContext *h, int width, int height)
AVStream ** streams
A list of all streams in the file.
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
GLint GLenum GLboolean GLsizei uintptr_t pointer
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
FF_PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray
GLfloat chroma_div_w
Chroma subsampling w ratio.
#define AV_PIX_FMT_YUV444P16
static int opengl_draw(AVFormatContext *h, void *intput, int repaint, int is_pkt)
static int opengl_control_message(AVFormatContext *h, int type, void *data, size_t data_size)
Prepare window buffer message.
GLuint vertex_buffer
Vertex buffer.
#define AV_PIX_FMT_YUVA420P16
GLuint fragment_shader
Fragment shader for current pix_pmt.
GLuint texture_name[4]
Textures' IDs.
FF_PFNGLLINKPROGRAMPROC glLinkProgram
GLint texture_coords_attrib
Main libavdevice API header.
FFOpenGLFunctions glprocs
#define FF_GL_VERTEX_SHADER
Create window buffer message.
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
FF_PFNGLDELETEBUFFERSPROC glDeleteBuffers
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
AVOutputFormat ff_opengl_muxer
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_PIX_FMT_YUVA444P16
simple assert() macros that are a bit more flexible than ISO C assert().
static const char *const FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR
Fragment shader for planar YUVA formats.
int non_pow_2_textures
1 when non power of 2 textures are supported
GLint chroma_div_w_location
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR
Fragment shader for planar RGB formats.
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define AV_PIX_FMT_GBRAP16
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVCodecContext * codec
Codec context associated with this stream.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
uint8_t background[4]
Background color.
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET
Fragment shader for packet RGBA formats.
uint8_t nb_components
The number of components each pixel has, (1-4)
#define AV_PIX_FMT_GBRP16
char filename[1024]
input or output filename
#define AV_PIX_FMT_GRAY16
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static av_cold int opengl_write_header(AVFormatContext *h)
static av_cold void opengl_deinit_context(OpenGLContext *opengl)
int width
picture width / height.
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
GLsizei GLboolean const GLfloat * value
static int write_trailer(AVFormatContext *s1)
#define FF_CEIL_RSHIFT(a, b)
static const char * opengl_get_fragment_shader_code(enum AVPixelFormat format)
enum AVPixelFormat pix_fmt
Stream pixel format.
FF_PFNGLCREATEPROGRAMPROC glCreateProgram
static const AVOption options[]
#define FF_GL_RED_COMPONENT
static av_cold GLuint opengl_load_shader(OpenGLContext *opengl, GLenum type, const char *source)
packed RGB 8:8:8, 24bpp, BGRBGR...
OpenGLVertexInfo vertex[4]
VBO.
typedef GLint(APIENTRY *FF_PFNGLGETATTRIBLOCATIONPROC)(GLuint program
FF_PFNGLBUFFERDATAPROC glBufferData
#define FF_ARRAY_ELEMS(a)
#define FF_GL_STATIC_DRAW
#define FILL_COMPONENT(i)
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_BGR555
GLint chroma_div_h_location
static int opengl_release_window(AVFormatContext *h)
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
#define AV_LOG_INFO
Standard information.
FF_PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog
enum AVMediaType codec_type
static const struct OpenGLFormatDesc opengl_format_desc[]
char * av_strdup(const char *s)
Duplicate the string s.
GLfloat projection_matrix[16]
Projection matrix.
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
FF_PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv
static av_cold void opengl_get_texture_size(OpenGLContext *opengl, int in_width, int in_height, int *out_width, int *out_height)
static av_cold void opengl_get_texture_params(OpenGLContext *opengl)
static const char *const FF_OPENGL_FRAGMENT_SHADER_GRAY
static int opengl_create_window(AVFormatContext *h)
main external API structure.
#define FF_GL_INFO_LOG_LENGTH
static av_cold int opengl_read_limits(OpenGLContext *opengl)
typedef GLuint(APIENTRY *FF_PFNGLCREATEPROGRAMPROC)(void)
static const char * window_title
BYTE int const BYTE int int int height
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
static void opengl_make_ortho(float matrix[16], float left, float right, float bottom, float top, float nearZ, float farZ)
rational number numerator/denominator
FF_PFNGLGENBUFFERSPROC glGenBuffers
FF_PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog
#define FF_GL_ARRAY_BUFFER
static av_cold int opengl_prepare_vertex(AVFormatContext *s)
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
GLsizei GLsizei char * infoLog
GLsizei GLboolean transpose
GLuint vertex_shader
Vertex shader.
FF_PFNGLUNIFORM1IPROC glUniform1i
static int av_cold opengl_load_procedures(OpenGLContext *opengl)
offset must point to two consecutive integers
#define FF_GL_UNSIGNED_BYTE_2_3_3_REV
int picture_height
Rendered height.
#define AV_PIX_FMT_BGR565
FF_PFNGLGETPROGRAMIVPROC glGetProgramiv
static void reinit(Jpeg2000EncoderContext *s)
GLuint program
Shader program.
char * window_title
Title of the window.
#define FF_GL_UNSIGNED_SHORT_1_5_5_5_REV
int unpack_subimage
1 when GL_EXT_unpack_subimage is available
uint16_t plane
Which of the 4 planes contains the component.
static int opengl_write_frame(AVFormatContext *h, int stream_index, AVFrame **frame, unsigned flags)
GLint GLenum GLboolean GLsizei stride
FF_PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static av_cold int opengl_compile_shaders(OpenGLContext *opengl, enum AVPixelFormat pix_fmt)
FF_PFNGLACTIVETEXTUREPROC glActiveTexture
common internal and external API header
planar GBRA 4:4:4:4 32bpp
GLint max_viewport_height
Maximum viewport size.
FF_PFNGLCREATESHADERPROC glCreateShader
GLint max_viewport_width
Maximum viewport size.
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
#define AV_PIX_FMT_RGB555
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define FF_GL_COMPILE_STATUS
GLfloat color_map[16]
RGBA color map matrix.
static const char *const FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR
Fragment shader for planar YUV formats.
static const AVClass opengl_class
void * priv_data
Format private data.
GLuint index_buffer
Index buffer.
static void write_header(FFV1Context *f)
static uint8_t * opengl_get_plane_pointer(OpenGLContext *opengl, AVPacket *pkt, int comp_index, const AVPixFmtDescriptor *desc)
static const char *const FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET
Fragment shader for packet RGB formats.
static const struct twinvq_data tab
#define LOAD_TEXTURE_DATA(comp_index, sub)
#define AV_PIX_FMT_RGB565
static av_cold int opengl_configure_texture(OpenGLContext *opengl, GLuint texture, GLsizei width, GLsizei height)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
FF_PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation
int y
y coordinate of top left corner
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
static void opengl_make_identity(float matrix[16])
#define AVERROR_EXTERNAL
Generic error in an external library.
AVPixelFormat
Pixel format.
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
#define AV_PIX_FMT_YUV422P16
Display window buffer message.
GLint projection_matrix_location
Uniforms' locations.