FFmpeg
Data Structures | Macros | Typedefs | Functions | Variables
opengl_enc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include "config.h"
#include <GL/gl.h>
#include <GL/glext.h>
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavdevice/avdevice.h"
#include "opengl_enc_shaders.h"

Go to the source code of this file.

Data Structures

struct  FFOpenGLFunctions
 
struct  OpenGLVertexInfo
 
struct  OpenGLContext
 
struct  OpenGLFormatDesc
 

Macros

#define APIENTRY
 
#define FF_GL_RED_COMPONENT   0x1903;
 
#define FF_GL_UNSIGNED_BYTE_3_3_2   0x8032
 
#define FF_GL_UNSIGNED_BYTE_2_3_3_REV   0x8362
 
#define FF_GL_UNSIGNED_SHORT_1_5_5_5_REV   0x8366
 
#define FF_GL_UNPACK_ROW_LENGTH   0x0CF2
 
#define FF_GL_ARRAY_BUFFER   0x8892
 
#define FF_GL_ELEMENT_ARRAY_BUFFER   0x8893
 
#define FF_GL_STATIC_DRAW   0x88E4
 
#define FF_GL_FRAGMENT_SHADER   0x8B30
 
#define FF_GL_VERTEX_SHADER   0x8B31
 
#define FF_GL_COMPILE_STATUS   0x8B81
 
#define FF_GL_LINK_STATUS   0x8B82
 
#define FF_GL_INFO_LOG_LENGTH   0x8B84
 
#define OPENGL_ERROR_CHECK(ctx)
 
#define LOAD_OPENGL_FUN(name, type)
 
#define FILL_COMPONENT(i)
 
#define LOAD_TEXTURE_DATA(comp_index, sub)
 
#define OFFSET(x)   offsetof(OpenGLContext, x)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Typedefs

typedef void(APIENTRYFF_PFNGLACTIVETEXTUREPROC) (GLenum texture)
 
typedef void(APIENTRYFF_PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers)
 
typedef void(APIENTRYFF_PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers)
 
typedef void(APIENTRYFF_PFNGLBUFFERDATAPROC) (GLenum target, ptrdiff_t size, const GLvoid *data, GLenum usage)
 
typedef void(APIENTRYFF_PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer)
 
typedef GLint(APIENTRYFF_PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const char *name)
 
typedef void(APIENTRYFF_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index)
 
typedef void(APIENTRYFF_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t pointer)
 
typedef GLint(APIENTRYFF_PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const char *name)
 
typedef void(APIENTRYFF_PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0)
 
typedef void(APIENTRYFF_PFNGLUNIFORM1IPROC) (GLint location, GLint v0)
 
typedef void(APIENTRYFF_PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
 
typedef GLuint(APIENTRYFF_PFNGLCREATEPROGRAMPROC) (void)
 
typedef void(APIENTRYFF_PFNGLDELETEPROGRAMPROC) (GLuint program)
 
typedef void(APIENTRYFF_PFNGLUSEPROGRAMPROC) (GLuint program)
 
typedef void(APIENTRYFF_PFNGLLINKPROGRAMPROC) (GLuint program)
 
typedef void(APIENTRYFF_PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params)
 
typedef void(APIENTRYFF_PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, char *infoLog)
 
typedef void(APIENTRYFF_PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader)
 
typedef GLuint(APIENTRYFF_PFNGLCREATESHADERPROC) (GLenum type)
 
typedef void(APIENTRYFF_PFNGLDELETESHADERPROC) (GLuint shader)
 
typedef void(APIENTRYFF_PFNGLCOMPILESHADERPROC) (GLuint shader)
 
typedef void(APIENTRYFF_PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const char **string, const GLint *length)
 
typedef void(APIENTRYFF_PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params)
 
typedef void(APIENTRYFF_PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, char *infoLog)
 

Functions

static av_cold int opengl_prepare_vertex (AVFormatContext *s)
 
static int opengl_draw (AVFormatContext *h, void *intput, int repaint, int is_pkt)
 
static av_cold int opengl_init_context (OpenGLContext *opengl)
 
static av_cold void opengl_deinit_context (OpenGLContext *opengl)
 
static int opengl_resize (AVFormatContext *h, int width, int height)
 
static int opengl_control_message (AVFormatContext *h, int type, void *data, size_t data_size)
 
static int av_cold opengl_load_procedures (OpenGLContext *opengl)
 
static void opengl_make_identity (float matrix[16])
 
static void opengl_make_ortho (float matrix[16], float left, float right, float bottom, float top, float nearZ, float farZ)
 
static av_cold int opengl_read_limits (OpenGLContext *opengl)
 
static const char * opengl_get_fragment_shader_code (enum AVPixelFormat format)
 
static int opengl_type_size (GLenum type)
 
static av_cold void opengl_get_texture_params (OpenGLContext *opengl)
 
static void opengl_compute_display_area (AVFormatContext *s)
 
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_fill_color_map (OpenGLContext *opengl)
 
static av_cold GLuint opengl_load_shader (OpenGLContext *opengl, GLenum type, const char *source)
 
static av_cold int opengl_compile_shaders (OpenGLContext *opengl, enum AVPixelFormat pix_fmt)
 
static av_cold int opengl_configure_texture (OpenGLContext *opengl, GLuint texture, GLsizei width, GLsizei height)
 
static int opengl_prepare (OpenGLContext *opengl)
 
static int opengl_create_window (AVFormatContext *h)
 
static int opengl_release_window (AVFormatContext *h)
 
static av_cold int opengl_write_trailer (AVFormatContext *h)
 
static av_cold int opengl_write_header (AVFormatContext *h)
 
static uint8_topengl_get_plane_pointer (OpenGLContext *opengl, AVPacket *pkt, int comp_index, const AVPixFmtDescriptor *desc)
 
static int opengl_write_packet (AVFormatContext *h, AVPacket *pkt)
 
static int opengl_write_frame (AVFormatContext *h, int stream_index, AVFrame **frame, unsigned flags)
 

Variables

static const GLushort g_index [6]
 
static const struct OpenGLFormatDesc opengl_format_desc []
 
static const AVOption options []
 
static const AVClass opengl_class
 
AVOutputFormat ff_opengl_muxer
 

Macro Definition Documentation

◆ APIENTRY

#define APIENTRY

Definition at line 64 of file opengl_enc.c.

◆ FF_GL_RED_COMPONENT

#define FF_GL_RED_COMPONENT   0x1903;

Definition at line 79 of file opengl_enc.c.

◆ FF_GL_UNSIGNED_BYTE_3_3_2

#define FF_GL_UNSIGNED_BYTE_3_3_2   0x8032

Definition at line 83 of file opengl_enc.c.

◆ FF_GL_UNSIGNED_BYTE_2_3_3_REV

#define FF_GL_UNSIGNED_BYTE_2_3_3_REV   0x8362

Definition at line 84 of file opengl_enc.c.

◆ FF_GL_UNSIGNED_SHORT_1_5_5_5_REV

#define FF_GL_UNSIGNED_SHORT_1_5_5_5_REV   0x8366

Definition at line 85 of file opengl_enc.c.

◆ FF_GL_UNPACK_ROW_LENGTH

#define FF_GL_UNPACK_ROW_LENGTH   0x0CF2

Definition at line 86 of file opengl_enc.c.

◆ FF_GL_ARRAY_BUFFER

#define FF_GL_ARRAY_BUFFER   0x8892

Definition at line 89 of file opengl_enc.c.

◆ FF_GL_ELEMENT_ARRAY_BUFFER

#define FF_GL_ELEMENT_ARRAY_BUFFER   0x8893

Definition at line 90 of file opengl_enc.c.

◆ FF_GL_STATIC_DRAW

#define FF_GL_STATIC_DRAW   0x88E4

Definition at line 91 of file opengl_enc.c.

◆ FF_GL_FRAGMENT_SHADER

#define FF_GL_FRAGMENT_SHADER   0x8B30

Definition at line 92 of file opengl_enc.c.

◆ FF_GL_VERTEX_SHADER

#define FF_GL_VERTEX_SHADER   0x8B31

Definition at line 93 of file opengl_enc.c.

◆ FF_GL_COMPILE_STATUS

#define FF_GL_COMPILE_STATUS   0x8B81

Definition at line 94 of file opengl_enc.c.

◆ FF_GL_LINK_STATUS

#define FF_GL_LINK_STATUS   0x8B82

Definition at line 95 of file opengl_enc.c.

◆ FF_GL_INFO_LOG_LENGTH

#define FF_GL_INFO_LOG_LENGTH   0x8B84

Definition at line 96 of file opengl_enc.c.

◆ OPENGL_ERROR_CHECK

#define OPENGL_ERROR_CHECK (   ctx)
Value:
{\
GLenum err_code; \
if ((err_code = glGetError()) != GL_NO_ERROR) { \
av_log(ctx, AV_LOG_ERROR, "OpenGL error occurred in '%s', line %d: %d\n", __FUNCTION__, __LINE__, err_code); \
goto fail; \
} \
}\

Definition at line 151 of file opengl_enc.c.

◆ LOAD_OPENGL_FUN

#define LOAD_OPENGL_FUN (   name,
  type 
)
Value:
procs->name = (type)SelectedGetProcAddress(#name); \
if (!procs->name) { \
av_log(opengl, AV_LOG_ERROR, "Cannot load OpenGL function: '%s'\n", #name); \
return AVERROR(ENOSYS); \
}

◆ FILL_COMPONENT

#define FILL_COMPONENT (   i)
Value:
{ \
shift = (desc->comp[i].depth - 1) >> 3; \
opengl->color_map[(i << 2) + (desc->comp[i].offset >> shift)] = 1.0; \
}

◆ LOAD_TEXTURE_DATA

#define LOAD_TEXTURE_DATA (   comp_index,
  sub 
)

Definition at line 1151 of file opengl_enc.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(OpenGLContext, x)

Definition at line 1265 of file opengl_enc.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 1266 of file opengl_enc.c.

Typedef Documentation

◆ FF_PFNGLACTIVETEXTUREPROC

typedef void(APIENTRY * FF_PFNGLACTIVETEXTUREPROC) (GLenum texture)

Definition at line 97 of file opengl_enc.c.

◆ FF_PFNGLGENBUFFERSPROC

typedef void(APIENTRY * FF_PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers)

Definition at line 98 of file opengl_enc.c.

◆ FF_PFNGLDELETEBUFFERSPROC

typedef void(APIENTRY * FF_PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers)

Definition at line 99 of file opengl_enc.c.

◆ FF_PFNGLBUFFERDATAPROC

typedef void(APIENTRY * FF_PFNGLBUFFERDATAPROC) (GLenum target, ptrdiff_t size, const GLvoid *data, GLenum usage)

Definition at line 100 of file opengl_enc.c.

◆ FF_PFNGLBINDBUFFERPROC

typedef void(APIENTRY * FF_PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer)

Definition at line 101 of file opengl_enc.c.

◆ FF_PFNGLGETATTRIBLOCATIONPROC

typedef GLint(APIENTRY * FF_PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const char *name)

Definition at line 102 of file opengl_enc.c.

◆ FF_PFNGLENABLEVERTEXATTRIBARRAYPROC

typedef void(APIENTRY * FF_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index)

Definition at line 103 of file opengl_enc.c.

◆ FF_PFNGLVERTEXATTRIBPOINTERPROC

typedef void(APIENTRY * FF_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t pointer)

Definition at line 104 of file opengl_enc.c.

◆ FF_PFNGLGETUNIFORMLOCATIONPROC

typedef GLint(APIENTRY * FF_PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const char *name)

Definition at line 105 of file opengl_enc.c.

◆ FF_PFNGLUNIFORM1FPROC

typedef void(APIENTRY * FF_PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0)

Definition at line 106 of file opengl_enc.c.

◆ FF_PFNGLUNIFORM1IPROC

typedef void(APIENTRY * FF_PFNGLUNIFORM1IPROC) (GLint location, GLint v0)

Definition at line 107 of file opengl_enc.c.

◆ FF_PFNGLUNIFORMMATRIX4FVPROC

typedef void(APIENTRY * FF_PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)

Definition at line 108 of file opengl_enc.c.

◆ FF_PFNGLCREATEPROGRAMPROC

typedef GLuint(APIENTRY * FF_PFNGLCREATEPROGRAMPROC) (void)

Definition at line 109 of file opengl_enc.c.

◆ FF_PFNGLDELETEPROGRAMPROC

typedef void(APIENTRY * FF_PFNGLDELETEPROGRAMPROC) (GLuint program)

Definition at line 110 of file opengl_enc.c.

◆ FF_PFNGLUSEPROGRAMPROC

typedef void(APIENTRY * FF_PFNGLUSEPROGRAMPROC) (GLuint program)

Definition at line 111 of file opengl_enc.c.

◆ FF_PFNGLLINKPROGRAMPROC

typedef void(APIENTRY * FF_PFNGLLINKPROGRAMPROC) (GLuint program)

Definition at line 112 of file opengl_enc.c.

◆ FF_PFNGLGETPROGRAMIVPROC

typedef void(APIENTRY * FF_PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params)

Definition at line 113 of file opengl_enc.c.

◆ FF_PFNGLGETPROGRAMINFOLOGPROC

typedef void(APIENTRY * FF_PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, char *infoLog)

Definition at line 114 of file opengl_enc.c.

◆ FF_PFNGLATTACHSHADERPROC

typedef void(APIENTRY * FF_PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader)

Definition at line 115 of file opengl_enc.c.

◆ FF_PFNGLCREATESHADERPROC

typedef GLuint(APIENTRY * FF_PFNGLCREATESHADERPROC) (GLenum type)

Definition at line 116 of file opengl_enc.c.

◆ FF_PFNGLDELETESHADERPROC

typedef void(APIENTRY * FF_PFNGLDELETESHADERPROC) (GLuint shader)

Definition at line 117 of file opengl_enc.c.

◆ FF_PFNGLCOMPILESHADERPROC

typedef void(APIENTRY * FF_PFNGLCOMPILESHADERPROC) (GLuint shader)

Definition at line 118 of file opengl_enc.c.

◆ FF_PFNGLSHADERSOURCEPROC

typedef void(APIENTRY * FF_PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const char **string, const GLint *length)

Definition at line 119 of file opengl_enc.c.

◆ FF_PFNGLGETSHADERIVPROC

typedef void(APIENTRY * FF_PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params)

Definition at line 120 of file opengl_enc.c.

◆ FF_PFNGLGETSHADERINFOLOGPROC

typedef void(APIENTRY * FF_PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, char *infoLog)

Definition at line 121 of file opengl_enc.c.

Function Documentation

◆ opengl_prepare_vertex()

static av_cold int opengl_prepare_vertex ( AVFormatContext s)
static

Definition at line 857 of file opengl_enc.c.

Referenced by opengl_resize(), and opengl_write_header().

◆ opengl_draw()

static int opengl_draw ( AVFormatContext h,
void *  intput,
int  repaint,
int  is_pkt 
)
static

Definition at line 1189 of file opengl_enc.c.

Referenced by opengl_resize(), opengl_write_frame(), and opengl_write_packet().

◆ opengl_init_context()

static av_cold int opengl_init_context ( OpenGLContext opengl)
static

Definition at line 991 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_deinit_context()

static av_cold void opengl_deinit_context ( OpenGLContext opengl)
static

Definition at line 283 of file opengl_enc.c.

Referenced by opengl_write_trailer().

◆ opengl_resize()

static int opengl_resize ( AVFormatContext h,
int  width,
int  height 
)
static

Definition at line 309 of file opengl_enc.c.

Referenced by opengl_control_message().

◆ opengl_control_message()

static int opengl_control_message ( AVFormatContext h,
int  type,
void *  data,
size_t  data_size 
)
static

Definition at line 329 of file opengl_enc.c.

◆ opengl_load_procedures()

static int av_cold opengl_load_procedures ( OpenGLContext opengl)
static

Definition at line 490 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_make_identity()

static void opengl_make_identity ( float  matrix[16])
static

Definition at line 545 of file opengl_enc.c.

Referenced by opengl_prepare_vertex().

◆ opengl_make_ortho()

static void opengl_make_ortho ( float  matrix[16],
float  left,
float  right,
float  bottom,
float  top,
float  nearZ,
float  farZ 
)
static

Definition at line 551 of file opengl_enc.c.

Referenced by opengl_prepare_vertex().

◆ opengl_read_limits()

static av_cold int opengl_read_limits ( OpenGLContext opengl)
static

Definition at line 571 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_get_fragment_shader_code()

static const char* opengl_get_fragment_shader_code ( enum AVPixelFormat  format)
static

Definition at line 625 of file opengl_enc.c.

Referenced by opengl_compile_shaders().

◆ opengl_type_size()

static int opengl_type_size ( GLenum  type)
static

Definition at line 635 of file opengl_enc.c.

Referenced by opengl_get_plane_pointer().

◆ opengl_get_texture_params()

static av_cold void opengl_get_texture_params ( OpenGLContext opengl)
static

Definition at line 651 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_compute_display_area()

static void opengl_compute_display_area ( AVFormatContext s)
static

Definition at line 663 of file opengl_enc.c.

Referenced by opengl_prepare_vertex().

◆ opengl_get_texture_size()

static av_cold void opengl_get_texture_size ( OpenGLContext opengl,
int  in_width,
int  in_height,
int out_width,
int out_height 
)
static

Definition at line 687 of file opengl_enc.c.

Referenced by opengl_configure_texture(), and opengl_prepare_vertex().

◆ opengl_fill_color_map()

static av_cold void opengl_fill_color_map ( OpenGLContext opengl)
static

Definition at line 705 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_load_shader()

static av_cold GLuint opengl_load_shader ( OpenGLContext opengl,
GLenum  type,
const char *  source 
)
static

Definition at line 737 of file opengl_enc.c.

Referenced by opengl_compile_shaders().

◆ opengl_compile_shaders()

static av_cold int opengl_compile_shaders ( OpenGLContext opengl,
enum AVPixelFormat  pix_fmt 
)
static

Definition at line 768 of file opengl_enc.c.

Referenced by opengl_init_context().

◆ opengl_configure_texture()

static av_cold int opengl_configure_texture ( OpenGLContext opengl,
GLuint  texture,
GLsizei  width,
GLsizei  height 
)
static

Definition at line 837 of file opengl_enc.c.

Referenced by opengl_init_context().

◆ opengl_prepare()

static int opengl_prepare ( OpenGLContext opengl)
static

Definition at line 902 of file opengl_enc.c.

Referenced by opengl_draw().

◆ opengl_create_window()

static int opengl_create_window ( AVFormatContext h)
static

Definition at line 927 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_release_window()

static int opengl_release_window ( AVFormatContext h)
static

Definition at line 960 of file opengl_enc.c.

Referenced by opengl_write_trailer().

◆ opengl_write_trailer()

static av_cold int opengl_write_trailer ( AVFormatContext h)
static

Definition at line 977 of file opengl_enc.c.

Referenced by opengl_write_header().

◆ opengl_write_header()

static av_cold int opengl_write_header ( AVFormatContext h)
static

Definition at line 1050 of file opengl_enc.c.

◆ opengl_get_plane_pointer()

static uint8_t* opengl_get_plane_pointer ( OpenGLContext opengl,
AVPacket pkt,
int  comp_index,
const AVPixFmtDescriptor desc 
)
static

Definition at line 1122 of file opengl_enc.c.

◆ opengl_write_packet()

static int opengl_write_packet ( AVFormatContext h,
AVPacket pkt 
)
static

Definition at line 1252 of file opengl_enc.c.

◆ opengl_write_frame()

static int opengl_write_frame ( AVFormatContext h,
int  stream_index,
AVFrame **  frame,
unsigned  flags 
)
static

Definition at line 1257 of file opengl_enc.c.

Variable Documentation

◆ g_index

const GLushort g_index[6]
static
Initial value:
=
{
0, 1, 2,
0, 3, 2,
}

Definition at line 167 of file opengl_enc.c.

Referenced by opengl_draw(), and opengl_init_context().

◆ opengl_format_desc

const struct OpenGLFormatDesc opengl_format_desc[]
static

◆ options

const AVOption options[]
static
Initial value:
= {
{ "background", "set background color", OFFSET(background), AV_OPT_TYPE_COLOR, {.str = "black"}, CHAR_MIN, CHAR_MAX, ENC },
{ "no_window", "disable default window", OFFSET(no_window), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, ENC },
{ "window_title", "set window title", OFFSET(window_title), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, ENC },
{ "window_size", "set window size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, ENC },
{ NULL }
}

Definition at line 1267 of file opengl_enc.c.

◆ opengl_class

const AVClass opengl_class
static
Initial value:
= {
.class_name = "opengl outdev",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 1275 of file opengl_enc.c.

◆ ff_opengl_muxer

AVOutputFormat ff_opengl_muxer
Initial value:
= {
.name = "opengl",
.long_name = NULL_IF_CONFIG_SMALL("OpenGL output"),
.priv_data_size = sizeof(OpenGLContext),
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_RAWVIDEO,
.write_uncoded_frame = opengl_write_frame,
.control_message = opengl_control_message,
.priv_class = &opengl_class,
}

Definition at line 1283 of file opengl_enc.c.

options
static const AVOption options[]
Definition: opengl_enc.c:1267
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:470
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:467
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: avcodec.h:231
opengl_control_message
static int opengl_control_message(AVFormatContext *h, int type, void *data, size_t data_size)
Definition: opengl_enc.c:329
name
const char * name
Definition: avisynth_c.h:867
fail
#define fail()
Definition: checkasm.h:120
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
opengl_write_frame
static int opengl_write_frame(AVFormatContext *h, int stream_index, AVFrame **frame, unsigned flags)
Definition: opengl_enc.c:1257
OFFSET
#define OFFSET(x)
Definition: opengl_enc.c:1265
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
opengl_write_packet
static int opengl_write_packet(AVFormatContext *h, AVPacket *pkt)
Definition: opengl_enc.c:1252
ctx
AVFormatContext * ctx
Definition: movenc.c:48
window_title
static const char * window_title
Definition: ffplay.c:312
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
ENC
#define ENC
Definition: opengl_enc.c:1266
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:238
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:233
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
Definition: log.h:41
desc
const char * desc
Definition: nvenc.c:68
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
AVFMT_NOFILE
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:463
write_packet
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:690
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: avcodec.h:216
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
opengl_class
static const AVClass opengl_class
Definition: opengl_enc.c:1275
OpenGLContext
Definition: opengl_enc.c:173
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
shift
static int shift(int a, int b)
Definition: sonic.c:82
opengl_write_trailer
static av_cold int opengl_write_trailer(AVFormatContext *h)
Definition: opengl_enc.c:977
opengl_write_header
static av_cold int opengl_write_header(AVFormatContext *h)
Definition: opengl_enc.c:1050
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:337