xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
video_out_opengl2.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include <ctype.h>
#include <pthread.h>
#include <xine.h>
#include <xine/video_out.h>
#include <xine/vo_scale.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include "opengl/xine_gl.h"
#include "mem_frame.h"
#include "hw_frame.h"
#include "color_matrix.c"

Data Structures

union  _opengl2_w2_t
 
struct  opengl2_overlay_t
 
struct  opengl2_program_t
 
struct  opengl2_yuvtex_t
 
struct  opengl2_driver_s
 
struct  opengl2_class_t
 
struct  opengl2_rect_t
 
struct  opengl2_draw_info_t
 

Macros

#define LOG_MODULE   "video_out_opengl2"
 
#define GL_GLEXT_PROTOTYPES
 
#define _FLAG2BIT(_flag)
 
#define GL_RED   0x1903
 
#define GL_RG   0x8227
 
#define SCALE_MASK   3
 
#define OGL2_NUM_VIDEO_PBO   2
 
#define OGL2_OVERLAY_PBO   OGL2_NUM_VIDEO_PBO + 1
 
#define OGL2_BC_LUT   1
 
#define OGL2_BC_PROG_1   2
 
#define OGL2_BC_PROG_2   4
 
#define OGL2_BC_FBO   8
 
#define MAX_EXIT_TARGETS   8
 
#define CM_LUT
 
#define CM_HAVE_YCGCO_SUPPORT   1
 
#define CM_HAVE_BT2020_SUPPORT   1
 
#define CM_DRIVER_T   opengl2_driver_t
 
#define LUTWIDTH   1000
 
#define _OGL2_STATE_OK   1
 
#define _OGL2_STATE_CHANGED   2
 
#define OGL2_FT_MASK   15
 
#define INITWIDTH   720
 
#define INITHEIGHT   576
 

Typedefs

typedef mem_frame_t opengl2_frame_t
 
typedef struct opengl2_driver_s opengl2_driver_t
 
typedef char opengl2_shader_arg_name_t[8]
 

Enumerations

enum  opengl2_csc_shader_t {
  OGL2_cscs_NONE = 0 , OGL2_cscs_yuv420 , OGL2_cscs_yuv420j , OGL2_cscs_yuv420j16 ,
  OGL2_cscs_nv12 , OGL2_cscs_yuv422 , OGL2_cscs_LAST
}
 
enum  opengl2_tex_t {
  OGL2_TEX_VIDEO_0 = 0 , OGL2_TEX_VIDEO_1 , OGL2_TEX_y , OGL2_TEX_u_v ,
  OGL2_TEX_u , OGL2_TEX_v , OGL2_TEX_yuv , OGL2_TEX_uv ,
  OGL2_TEX_HW0 , OGL2_TEX_HW1 , OGL2_TEX_HW2 , OGL2_TEX_CUBIC_TEMP ,
  OGL2_TEX_CUBIC_LUT , OGL2_TEX_LAST
}
 
enum  opengl2_spline_t { SPLINE_CATMULLROM = 0 , SPLINE_COS , SPLINE_LAST }
 
enum  opengl2_scale_t {
  SCALE_SIMPLE = 0 , SCALE_LINEAR , SCALE_CATMULLROM , SCALE_COS ,
  SCALE_LAST
}
 
enum  _ogl2_ft_t {
  OGL2_FT_UNKNOWN = 0 , OGL2_FT_YV12 , OGL2_FT_YV12_DEEP , OGL2_FT_NV12 ,
  OGL2_FT_YUY2 , OGL2_FT_HW_UNKNOWN , OGL2_FT_HW_YV12 , OGL2_FT_HW_YV12_DEEP ,
  OGL2_FT_HW_NV12 , OGL2_FT_HW_YUY2 , OGL2_FT_LAST
}
 

Functions

static void opengl2_exit (void)
 
static void opengl2_exit_unregister (opengl2_driver_t *this)
 
static void opengl2_exit_register (opengl2_driver_t *this)
 
static void opengl2_accel_lock (vo_frame_t *frame, int lock)
 
static GLint _opengl2_next_videoPBO (opengl2_driver_t *this)
 
static const char * _ogl2_fmt2str (uint32_t v)
 
static void _ogl2_str2hex (char **q, uint32_t v)
 
static void _ogl2_dump_tex_fmts (opengl2_driver_t *this)
 
static double _opengl2_cos_spline (double x)
 
static double _opengl2_catmullrom_spline (double x)
 
static int create_lut_texture (opengl2_driver_t *that)
 
static int opengl2_build_program (opengl2_driver_t *this, opengl2_program_t *prog, const char *source, const char *name, const opengl2_shader_arg_name_t *arg_names)
 
static void opengl2_delete_program (opengl2_program_t *prog)
 
static void _config_texture (GLenum target, GLuint texture, GLsizei width, GLsizei height, GLenum format, GLenum type, GLenum minmag_filter)
 
static uint32_t opengl2_check_textures_size (opengl2_driver_t *this_gen, int w, int h, int bits)
 
static void opengl2_upload_overlay (opengl2_driver_t *this, opengl2_overlay_t *o, vo_overlay_t *overlay)
 
static void opengl2_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay)
 
static void _opengl2_overlay_dummy_blend (opengl2_driver_t *this, vo_frame_t *frame_gen, vo_overlay_t *overlay)
 
static void _opengl2_overlay_blend (opengl2_driver_t *this, vo_frame_t *frame_gen, vo_overlay_t *overlay)
 
static void opengl2_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img)
 
static void _opengl2_overlay_dummy_end (opengl2_driver_t *this, vo_frame_t *vo_img)
 
static void _opengl2_overlay_end (opengl2_driver_t *this, vo_frame_t *vo_img)
 
static void opengl2_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed)
 
static int opengl2_redraw_needed (vo_driver_t *this_gen)
 
static void opengl2_update_csc_matrix (opengl2_driver_t *that, opengl2_frame_t *frame, int bits)
 
static void opengl2_rect_set (opengl2_rect_t *r, opengl2_overlay_t *o)
 
static void opengl2_draw_scaled_overlays (opengl2_driver_t *that, opengl2_frame_t *frame)
 
static void opengl2_draw_unscaled_overlays (opengl2_driver_t *that)
 
static GLuint opengl2_vtex_swap (opengl2_driver_t *that)
 
static int opengl2_sharpness (opengl2_driver_t *that, opengl2_frame_t *frame)
 
static uint32_t _opengl2_setup_bicubic (opengl2_driver_t *that, uint32_t flags)
 
static int opengl2_setup_bicubic (opengl2_driver_t *that, uint32_t flags)
 
static uint32_t opengl2_draw_video_bicubic (opengl2_driver_t *that, const opengl2_draw_info_t *info)
 
static uint32_t opengl2_draw_video_cubic_x (opengl2_driver_t *that, const opengl2_draw_info_t *info)
 
static uint32_t opengl2_draw_video_cubic_y (opengl2_driver_t *that, const opengl2_draw_info_t *info)
 
static int opengl2_draw_video_simple (opengl2_driver_t *that, const opengl2_draw_info_t *info)
 
static uint32_t opengl2_draw_video_bilinear (opengl2_driver_t *that, const opengl2_draw_info_t *info)
 
static void _upload_texture (GLenum target, GLuint tex, GLenum format, GLenum type, const void *data, unsigned pitch, GLuint bpp, GLuint height, GLuint pbo)
 
static GLuint opengl2_use_csc (opengl2_driver_t *that, opengl2_csc_shader_t what)
 
static uint32_t opengl2_get_ft (uint32_t type)
 
static int opengl2_draw (opengl2_driver_t *that, opengl2_frame_t *frame)
 
static void opengl2_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
 
static int opengl2_get_property (vo_driver_t *this_gen, int property)
 
static int opengl2_set_property (vo_driver_t *this_gen, int property, int value)
 
static void opengl2_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
 
static int opengl2_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
 
static uint32_t opengl2_get_capabilities (vo_driver_t *this_gen)
 
static void opengl2_set_bicubic (void *this_gen, xine_cfg_entry_t *entry)
 
static void opengl2_set_scale_mode (void *this_gen, xine_cfg_entry_t *entry)
 
static void opengl2_dispose (vo_driver_t *this_gen)
 
static vo_frame_topengl2_alloc_frame (vo_driver_t *this_gen)
 
static vo_driver_topengl2_open_plugin (video_driver_class_t *class_gen, const void *visual_gen)
 
static uint32_t opengl2_check_platform (xine_t *xine, unsigned visual_type, const void *visual)
 
static void * opengl2_init_class (xine_t *xine, unsigned visual_type, const void *visual_gen)
 
static void * opengl2_init_class_x11 (xine_t *xine, const void *visual_gen)
 
static void * opengl2_init_class_wl (xine_t *xine, const void *visual_gen)
 

Variables

static const char _ogl2_tex_names [OGL2_TEX_LAST][12]
 
static const char _opengl2_scale_names [SCALE_LAST][16]
 
static const float _opengl2_lut_y [SCALE_LAST]
 
opengl2_driver_topengl2_exit_vector [8]
 
static const opengl2_shader_arg_name_t bicubic_pass1_args [] = {"ARB", "tex", "lut", "spline", ""}
 
static const char bicubic_pass1_frag []
 
static const opengl2_shader_arg_name_t bicubic_pass2_args [] = {"ARB", "tex", "lut", "spline", ""}
 
static const char bicubic_pass2_frag []
 
static double(*const _opengl2_spline [SPLINE_LAST])(double x)
 
static const opengl2_shader_arg_name_t blur_sharpen_args [] = {"ARB", "tex", "mid", "side", "corn", ""}
 
static const char blur_sharpen_frag []
 
static const opengl2_shader_arg_name_t yuv420_args [] = {"r_coefs", "g_coefs", "b_coefs", "texY", "texU", "texV", ""}
 
static const char yuv420_frag []
 
static const opengl2_shader_arg_name_t yuv420j_args [] = {"r_coefs", "g_coefs", "b_coefs", "texY", "tex_U_V", ""}
 
static const char yuv420j_frag []
 
static const opengl2_shader_arg_name_t yuv420j16_args [] = {"r_coefs", "g_coefs", "b_coefs", "texY", "tex_U_V", "join16", ""}
 
static const char yuv420j16_frag []
 
static const opengl2_shader_arg_name_t nv12_args [] = {"r_coefs", "g_coefs", "b_coefs", "texY", "texUV", ""}
 
static const char nv12_frag []
 
static const opengl2_shader_arg_name_t yuv422_args [] = {"r_coefs", "g_coefs", "b_coefs", "texYUV", "yuy2v", ""}
 
static const char yuv422_frag []
 
static const vo_info_t vo_info_opengl2
 
static const vo_info_t vo_info_opengl2_wl
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Macro Definition Documentation

◆ _FLAG2BIT

#define _FLAG2BIT ( _flag)
Value:
(( \
((0x80000000 - ((_flag) & 0xffff0000)) >> 31) * 16 \
+ ((0x80000000 - ((_flag) & 0xff00ff00)) >> 31) * 8 \
+ ((0x80000000 - ((_flag) & 0xf0f0f0f0)) >> 31) * 4 \
+ ((0x80000000 - ((_flag) & 0xcccccccc)) >> 31) * 2 \
+ ((0x80000000 - ((_flag) & 0xaaaaaaaa)) >> 31) * 1) ^ 31)

Referenced by opengl2_draw().

◆ _OGL2_STATE_CHANGED

#define _OGL2_STATE_CHANGED   2

◆ _OGL2_STATE_OK

#define _OGL2_STATE_OK   1

◆ CM_DRIVER_T

#define CM_DRIVER_T   opengl2_driver_t

◆ CM_HAVE_BT2020_SUPPORT

#define CM_HAVE_BT2020_SUPPORT   1

◆ CM_HAVE_YCGCO_SUPPORT

#define CM_HAVE_YCGCO_SUPPORT   1

◆ CM_LUT

#define CM_LUT

◆ GL_GLEXT_PROTOTYPES

#define GL_GLEXT_PROTOTYPES

◆ GL_RED

#define GL_RED   0x1903

Referenced by opengl2_open_plugin().

◆ GL_RG

#define GL_RG   0x8227

Referenced by opengl2_open_plugin().

◆ INITHEIGHT

#define INITHEIGHT   576

◆ INITWIDTH

#define INITWIDTH   720

◆ LOG_MODULE

#define LOG_MODULE   "video_out_opengl2"

◆ LUTWIDTH

#define LUTWIDTH   1000

Referenced by create_lut_texture().

◆ MAX_EXIT_TARGETS

#define MAX_EXIT_TARGETS   8

◆ OGL2_BC_FBO

#define OGL2_BC_FBO   8

◆ OGL2_BC_LUT

#define OGL2_BC_LUT   1

◆ OGL2_BC_PROG_1

#define OGL2_BC_PROG_1   2

◆ OGL2_BC_PROG_2

#define OGL2_BC_PROG_2   4

◆ OGL2_FT_MASK

#define OGL2_FT_MASK   15

Referenced by opengl2_draw().

◆ OGL2_NUM_VIDEO_PBO

#define OGL2_NUM_VIDEO_PBO   2

◆ OGL2_OVERLAY_PBO

#define OGL2_OVERLAY_PBO   OGL2_NUM_VIDEO_PBO + 1

Referenced by opengl2_upload_overlay().

◆ SCALE_MASK

#define SCALE_MASK   3

Referenced by opengl2_draw().

Typedef Documentation

◆ opengl2_driver_t

◆ opengl2_frame_t

◆ opengl2_shader_arg_name_t

typedef char opengl2_shader_arg_name_t[8]

Enumeration Type Documentation

◆ _ogl2_ft_t

enum _ogl2_ft_t
Enumerator
OGL2_FT_UNKNOWN 
OGL2_FT_YV12 
OGL2_FT_YV12_DEEP 
OGL2_FT_NV12 
OGL2_FT_YUY2 
OGL2_FT_HW_UNKNOWN 
OGL2_FT_HW_YV12 
OGL2_FT_HW_YV12_DEEP 
OGL2_FT_HW_NV12 
OGL2_FT_HW_YUY2 
OGL2_FT_LAST 

◆ opengl2_csc_shader_t

Enumerator
OGL2_cscs_NONE 
OGL2_cscs_yuv420 
OGL2_cscs_yuv420j 
OGL2_cscs_yuv420j16 
OGL2_cscs_nv12 
OGL2_cscs_yuv422 
OGL2_cscs_LAST 

◆ opengl2_scale_t

Enumerator
SCALE_SIMPLE 
SCALE_LINEAR 
SCALE_CATMULLROM 
SCALE_COS 
SCALE_LAST 

◆ opengl2_spline_t

Enumerator
SPLINE_CATMULLROM 
SPLINE_COS 
SPLINE_LAST 

◆ opengl2_tex_t

Enumerator
OGL2_TEX_VIDEO_0 
OGL2_TEX_VIDEO_1 
OGL2_TEX_y 
OGL2_TEX_u_v 
OGL2_TEX_u 
OGL2_TEX_v 
OGL2_TEX_yuv 
OGL2_TEX_uv 
OGL2_TEX_HW0 
OGL2_TEX_HW1 
OGL2_TEX_HW2 
OGL2_TEX_CUBIC_TEMP 
OGL2_TEX_CUBIC_LUT 
OGL2_TEX_LAST 

Function Documentation

◆ _config_texture()

static void _config_texture ( GLenum target,
GLuint texture,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLenum minmag_filter )
static

◆ _ogl2_dump_tex_fmts()

static void _ogl2_dump_tex_fmts ( opengl2_driver_t * this)
static

◆ _ogl2_fmt2str()

static const char * _ogl2_fmt2str ( uint32_t v)
static

References name, and v.

Referenced by _ogl2_dump_tex_fmts().

◆ _ogl2_str2hex()

static void _ogl2_str2hex ( char ** q,
uint32_t v )
static

References tab_hex, and v.

Referenced by _ogl2_dump_tex_fmts().

◆ _opengl2_catmullrom_spline()

static double _opengl2_catmullrom_spline ( double x)
static

◆ _opengl2_cos_spline()

static double _opengl2_cos_spline ( double x)
static

◆ _opengl2_next_videoPBO()

static GLint _opengl2_next_videoPBO ( opengl2_driver_t * this)
static

References OGL2_NUM_VIDEO_PBO.

Referenced by opengl2_draw().

◆ _opengl2_overlay_blend()

static void _opengl2_overlay_blend ( opengl2_driver_t * this,
vo_frame_t * frame_gen,
vo_overlay_t * overlay )
static

◆ _opengl2_overlay_dummy_blend()

static void _opengl2_overlay_dummy_blend ( opengl2_driver_t * this,
vo_frame_t * frame_gen,
vo_overlay_t * overlay )
static

◆ _opengl2_overlay_dummy_end()

static void _opengl2_overlay_dummy_end ( opengl2_driver_t * this,
vo_frame_t * vo_img )
static

◆ _opengl2_overlay_end()

static void _opengl2_overlay_end ( opengl2_driver_t * this,
vo_frame_t * vo_img )
static

◆ _opengl2_setup_bicubic()

static uint32_t _opengl2_setup_bicubic ( opengl2_driver_t * that,
uint32_t flags )
static

◆ _upload_texture()

static void _upload_texture ( GLenum target,
GLuint tex,
GLenum format,
GLenum type,
const void * data,
unsigned pitch,
GLuint bpp,
GLuint height,
GLuint pbo )
static

References height, NULL, type, and xine_fast_memcpy.

Referenced by opengl2_draw().

◆ create_lut_texture()

static int create_lut_texture ( opengl2_driver_t * that)
static

◆ opengl2_accel_lock()

static void opengl2_accel_lock ( vo_frame_t * frame,
int lock )
static

Referenced by opengl2_open_plugin().

◆ opengl2_alloc_frame()

static vo_frame_t * opengl2_alloc_frame ( vo_driver_t * this_gen)
static

◆ opengl2_build_program()

static int opengl2_build_program ( opengl2_driver_t * this,
opengl2_program_t * prog,
const char * source,
const char * name,
const opengl2_shader_arg_name_t * arg_names )
static

◆ opengl2_check_platform()

static uint32_t opengl2_check_platform ( xine_t * xine,
unsigned visual_type,
const void * visual )
static

◆ opengl2_check_textures_size()

static uint32_t opengl2_check_textures_size ( opengl2_driver_t * this_gen,
int w,
int h,
int bits )
static

◆ opengl2_delete_program()

static void opengl2_delete_program ( opengl2_program_t * prog)
static

◆ opengl2_display_frame()

static void opengl2_display_frame ( vo_driver_t * this_gen,
vo_frame_t * frame_gen )
static

◆ opengl2_dispose()

static void opengl2_dispose ( vo_driver_t * this_gen)
static

◆ opengl2_draw()

static int opengl2_draw ( opengl2_driver_t * that,
opengl2_frame_t * frame )
static

References _FLAG2BIT, _ogl2_dump_tex_fmts(), _OGL2_STATE_CHANGED, _OGL2_STATE_OK, _opengl2_next_videoPBO(), _upload_texture(), opengl2_program_t::args, vo_frame_s::base, opengl2_driver_s::bicubic, bits, opengl2_driver_s::changed, opengl2_driver_s::corn, opengl2_driver_s::csc_shaders, opengl2_draw_info_t::dh, vo_scale_s::displayed_height, vo_scale_s::displayed_width, vo_scale_s::displayed_xoffset, vo_scale_s::displayed_yoffset, opengl2_draw_info_t::dw, opengl2_draw_info_t::dx, opengl2_draw_info_t::dy, opengl2_driver_s::fbo, vo_frame_s::flags, opengl2_driver_s::flags, opengl2_driver_s::fmt_1p, opengl2_driver_s::fmt_2p, vo_frame_s::format, mem_frame_t::format, xine_hwdec_t::frame_format, xine_glconv_t::get_textures, opengl2_driver_s::gl, opengl2_driver_s::glconv, vo_scale_s::gui_height, vo_scale_s::gui_width, opengl2_draw_info_t::guih, opengl2_draw_info_t::guiw, mem_frame_t::height, opengl2_driver_s::hw, opengl2_driver_s::join16, LOG_MODULE, xine_gl::make_current, opengl2_driver_s::mid, opengl2_driver_s::mode2, opengl2_driver_s::mode_changed, OGL2_cscs_nv12, OGL2_cscs_yuv420, OGL2_cscs_yuv420j, OGL2_cscs_yuv420j16, OGL2_cscs_yuv422, OGL2_FT_HW_NV12, OGL2_FT_HW_UNKNOWN, OGL2_FT_HW_YUY2, OGL2_FT_HW_YV12, OGL2_FT_HW_YV12_DEEP, OGL2_FT_MASK, OGL2_FT_NV12, OGL2_FT_UNKNOWN, OGL2_FT_YUY2, OGL2_FT_YV12, OGL2_FT_YV12_DEEP, OGL2_TEX_HW0, OGL2_TEX_u, OGL2_TEX_u_v, OGL2_TEX_uv, OGL2_TEX_v, OGL2_TEX_y, OGL2_TEX_yuv, opengl2_check_textures_size(), opengl2_draw_scaled_overlays(), opengl2_draw_unscaled_overlays(), opengl2_draw_video_bicubic(), opengl2_draw_video_bilinear(), opengl2_draw_video_cubic_x(), opengl2_draw_video_cubic_y(), opengl2_draw_video_simple(), opengl2_get_ft(), opengl2_sharpness(), opengl2_update_csc_matrix(), opengl2_use_csc(), opengl2_vtex_swap(), vo_scale_s::output_height, vo_scale_s::output_width, vo_scale_s::output_xoffset, vo_scale_s::output_yoffset, vo_frame_s::pitches, xine_gl::release_current, opengl2_yuvtex_t::relw, opengl2_driver_s::sc, SCALE_CATMULLROM, SCALE_COS, SCALE_MASK, SCALE_SIMPLE, opengl2_driver_s::sharp, opengl2_driver_s::side, xine_gl::swap_buffers, opengl2_draw_info_t::sx1, opengl2_draw_info_t::sx2, opengl2_draw_info_t::sy1, opengl2_draw_info_t::sy2, opengl2_driver_s::tex, opengl2_driver_s::transform, opengl2_driver_s::value, opengl2_draw_info_t::video_texture, mem_frame_t::vo_frame, VO_GET_FLAGS_DEPTH, opengl2_driver_s::vtex, mem_frame_t::width, opengl2_driver_s::xine, XINE_IMGFMT_YV12_DEEP, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, XINE_VO_TRANSFORM_FLIP_H, XINE_VO_TRANSFORM_FLIP_V, xprintf, opengl2_driver_s::yuvtex, opengl2_yuvtex_t::yuy2_div, and opengl2_yuvtex_t::yuy2_mul.

Referenced by opengl2_display_frame().

◆ opengl2_draw_scaled_overlays()

static void opengl2_draw_scaled_overlays ( opengl2_driver_t * that,
opengl2_frame_t * frame )
static

◆ opengl2_draw_unscaled_overlays()

static void opengl2_draw_unscaled_overlays ( opengl2_driver_t * that)
static

◆ opengl2_draw_video_bicubic()

static uint32_t opengl2_draw_video_bicubic ( opengl2_driver_t * that,
const opengl2_draw_info_t * info )
static

◆ opengl2_draw_video_bilinear()

static uint32_t opengl2_draw_video_bilinear ( opengl2_driver_t * that,
const opengl2_draw_info_t * info )
static

◆ opengl2_draw_video_cubic_x()

static uint32_t opengl2_draw_video_cubic_x ( opengl2_driver_t * that,
const opengl2_draw_info_t * info )
static

◆ opengl2_draw_video_cubic_y()

static uint32_t opengl2_draw_video_cubic_y ( opengl2_driver_t * that,
const opengl2_draw_info_t * info )
static

◆ opengl2_draw_video_simple()

static int opengl2_draw_video_simple ( opengl2_driver_t * that,
const opengl2_draw_info_t * info )
static

◆ opengl2_exit()

static void opengl2_exit ( void )
static

◆ opengl2_exit_register()

static void opengl2_exit_register ( opengl2_driver_t * this)
static

◆ opengl2_exit_unregister()

static void opengl2_exit_unregister ( opengl2_driver_t * this)
static

References MAX_EXIT_TARGETS, NULL, and opengl2_exit_vector.

Referenced by opengl2_dispose().

◆ opengl2_get_capabilities()

static uint32_t opengl2_get_capabilities ( vo_driver_t * this_gen)
static

◆ opengl2_get_ft()

static uint32_t opengl2_get_ft ( uint32_t type)
static

◆ opengl2_get_property()

static int opengl2_get_property ( vo_driver_t * this_gen,
int property )
static

◆ opengl2_get_property_min_max()

static void opengl2_get_property_min_max ( vo_driver_t * this_gen,
int property,
int * min,
int * max )
static

◆ opengl2_gui_data_exchange()

static int opengl2_gui_data_exchange ( vo_driver_t * this_gen,
int data_type,
void * data )
static

◆ opengl2_init_class()

static void * opengl2_init_class ( xine_t * xine,
unsigned visual_type,
const void * visual_gen )
static

◆ opengl2_init_class_wl()

static void * opengl2_init_class_wl ( xine_t * xine,
const void * visual_gen )
static

◆ opengl2_init_class_x11()

static void * opengl2_init_class_x11 ( xine_t * xine,
const void * visual_gen )
static

◆ opengl2_open_plugin()

static vo_driver_t * opengl2_open_plugin ( video_driver_class_t * class_gen,
const void * visual_gen )
static

References _, _opengl2_lut_y, _opengl2_overlay_dummy_blend(), _opengl2_overlay_dummy_end(), _opengl2_scale_names, _x_hwdec_new(), _x_load_gl(), _x_vo_scale_init(), xine_s::config, contrast, x11_visual_t::dest_size_cb, x11_visual_t::display, xine_wayland_visual_t::display, vo_frame_s::dispose, x11_visual_t::frame_output_cb, xine_wayland_visual_t::frame_output_cb, GL_RED, GL_RG, INITHEIGHT, INITWIDTH, LOG_MODULE, mem_frame_update_frame_format(), NULL, nv12_args, nv12_frag, OGL2_cscs_NONE, OGL2_cscs_nv12, OGL2_cscs_yuv420, OGL2_cscs_yuv420j, OGL2_cscs_yuv420j16, OGL2_cscs_yuv422, OGL2_TEX_LAST, opengl2_accel_lock(), opengl2_alloc_frame(), opengl2_build_program(), opengl2_check_textures_size(), opengl2_display_frame(), opengl2_dispose(), opengl2_get_capabilities(), opengl2_get_property(), opengl2_get_property_min_max(), opengl2_gui_data_exchange(), opengl2_overlay_begin(), opengl2_overlay_blend(), opengl2_overlay_end(), opengl2_redraw_needed(), opengl2_set_bicubic(), opengl2_set_property(), opengl2_set_scale_mode(), config_values_s::register_bool, config_values_s::register_range, SCALE_CATMULLROM, SCALE_LAST, SCALE_LINEAR, opengl2_class_t::texture_float, config_values_s::update_num, x11_visual_t::user_data, xine_wayland_visual_t::user_data, v, config_values_s::xine, opengl2_class_t::xine, XINE_GL_API_OPENGL, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, XINE_VISUAL_TYPE_X11, XINE_VO_ASPECT_AUTO, XINE_VORAW_MAX_OVL, xprintf, yuv420_args, yuv420_frag, yuv420j16_args, yuv420j16_frag, yuv420j_args, yuv420j_frag, yuv422_args, and yuv422_frag.

Referenced by opengl2_init_class().

◆ opengl2_overlay_begin()

static void opengl2_overlay_begin ( vo_driver_t * this_gen,
vo_frame_t * frame_gen,
int changed )
static

◆ opengl2_overlay_blend()

static void opengl2_overlay_blend ( vo_driver_t * this_gen,
vo_frame_t * frame_gen,
vo_overlay_t * overlay )
static

Referenced by opengl2_open_plugin().

◆ opengl2_overlay_end()

static void opengl2_overlay_end ( vo_driver_t * this_gen,
vo_frame_t * vo_img )
static

Referenced by opengl2_open_plugin().

◆ opengl2_rect_set()

static void opengl2_rect_set ( opengl2_rect_t * r,
opengl2_overlay_t * o )
static

◆ opengl2_redraw_needed()

static int opengl2_redraw_needed ( vo_driver_t * this_gen)
static

◆ opengl2_set_bicubic()

static void opengl2_set_bicubic ( void * this_gen,
xine_cfg_entry_t * entry )
static

◆ opengl2_set_property()

static int opengl2_set_property ( vo_driver_t * this_gen,
int property,
int value )
static

◆ opengl2_set_scale_mode()

static void opengl2_set_scale_mode ( void * this_gen,
xine_cfg_entry_t * entry )
static

◆ opengl2_setup_bicubic()

static int opengl2_setup_bicubic ( opengl2_driver_t * that,
uint32_t flags )
inlinestatic

◆ opengl2_sharpness()

static int opengl2_sharpness ( opengl2_driver_t * that,
opengl2_frame_t * frame )
static

◆ opengl2_update_csc_matrix()

static void opengl2_update_csc_matrix ( opengl2_driver_t * that,
opengl2_frame_t * frame,
int bits )
static

◆ opengl2_upload_overlay()

static void opengl2_upload_overlay ( opengl2_driver_t * this,
opengl2_overlay_t * o,
vo_overlay_t * overlay )
static

◆ opengl2_use_csc()

static GLuint opengl2_use_csc ( opengl2_driver_t * that,
opengl2_csc_shader_t what )
static

◆ opengl2_vtex_swap()

static GLuint opengl2_vtex_swap ( opengl2_driver_t * that)
static

Variable Documentation

◆ _ogl2_tex_names

const char _ogl2_tex_names[OGL2_TEX_LAST][12]
static
Initial value:
= {
[OGL2_TEX_VIDEO_0] = "VIDEO_0",
[OGL2_TEX_VIDEO_1] = "VIDEO_1",
[OGL2_TEX_y] = "y",
[OGL2_TEX_u_v] = "u_v",
[OGL2_TEX_u] = "u",
[OGL2_TEX_v] = "v",
[OGL2_TEX_yuv] = "yuv",
[OGL2_TEX_uv] = "uv",
[OGL2_TEX_HW0] = "HW0",
[OGL2_TEX_HW1] = "HW1",
[OGL2_TEX_HW2] = "HW2",
[OGL2_TEX_CUBIC_TEMP] = "cubic_temp",
[OGL2_TEX_CUBIC_LUT] = "cubic_lut"
}
@ OGL2_TEX_y
Definition video_out_opengl2.c:116
@ OGL2_TEX_HW1
Definition video_out_opengl2.c:123
@ OGL2_TEX_CUBIC_TEMP
Definition video_out_opengl2.c:126
@ OGL2_TEX_uv
Definition video_out_opengl2.c:121
@ OGL2_TEX_HW0
Definition video_out_opengl2.c:122
@ OGL2_TEX_u
Definition video_out_opengl2.c:118
@ OGL2_TEX_u_v
Definition video_out_opengl2.c:117
@ OGL2_TEX_VIDEO_1
Definition video_out_opengl2.c:115
@ OGL2_TEX_yuv
Definition video_out_opengl2.c:120
@ OGL2_TEX_HW2
Definition video_out_opengl2.c:124
@ OGL2_TEX_CUBIC_LUT
Definition video_out_opengl2.c:127
@ OGL2_TEX_VIDEO_0
Definition video_out_opengl2.c:114
@ OGL2_TEX_v
Definition video_out_opengl2.c:119

Referenced by _ogl2_dump_tex_fmts().

◆ _opengl2_lut_y

const float _opengl2_lut_y[SCALE_LAST]
static
Initial value:
= {
}
@ SPLINE_CATMULLROM
Definition video_out_opengl2.c:156
@ SPLINE_COS
Definition video_out_opengl2.c:157
@ SCALE_COS
Definition video_out_opengl2.c:165
@ SCALE_CATMULLROM
Definition video_out_opengl2.c:164
@ SCALE_SIMPLE
Definition video_out_opengl2.c:162
@ SCALE_LINEAR
Definition video_out_opengl2.c:163

Referenced by opengl2_open_plugin(), opengl2_set_bicubic(), and opengl2_set_scale_mode().

◆ _opengl2_scale_names

const char _opengl2_scale_names[SCALE_LAST][16]
static
Initial value:
= {
[SCALE_SIMPLE] = "Simple",
[SCALE_LINEAR] = "Linear",
[SCALE_CATMULLROM] = "Catmullrom",
[SCALE_COS] = "Cosinus"
}

Referenced by opengl2_open_plugin(), opengl2_set_bicubic(), and opengl2_set_scale_mode().

◆ _opengl2_spline

double(*const _opengl2_spline[SPLINE_LAST])(double x) ( double x)
static
Initial value:
= {
}
static double _opengl2_cos_spline(double x)
Definition video_out_opengl2.c:582
static double _opengl2_catmullrom_spline(double x)
Definition video_out_opengl2.c:589

Referenced by create_lut_texture().

◆ bicubic_pass1_args

const opengl2_shader_arg_name_t bicubic_pass1_args[] = {"ARB", "tex", "lut", "spline", ""}
static

Referenced by _opengl2_setup_bicubic().

◆ bicubic_pass1_frag

const char bicubic_pass1_frag[]
static
Initial value:
=
"#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex, lut;\n"
"uniform float spline;\n"
"void main() {\n"
" vec2 coord = gl_TexCoord[0].xy;\n"
" vec2 TexCoord = vec2( floor( coord.x - 0.5 ) + 0.5, coord.y );\n"
" vec4 wlut = texture2DRect( lut, vec2( ( coord.x - TexCoord.x ) * 1000.0, spline ) );\n"
" vec4 sum = texture2DRect( tex, TexCoord + vec2( -1.0, 0.0) ) * wlut[0];\n"
" sum += texture2DRect( tex, TexCoord ) * wlut[1];\n"
" sum += texture2DRect( tex, TexCoord + vec2( 1.0, 0.0) ) * wlut[2];\n"
" sum += texture2DRect( tex, TexCoord + vec2( 2.0, 0.0) ) * wlut[3];\n"
" gl_FragColor = sum;\n"
"}\n"

Referenced by _opengl2_setup_bicubic().

◆ bicubic_pass2_args

const opengl2_shader_arg_name_t bicubic_pass2_args[] = {"ARB", "tex", "lut", "spline", ""}
static

Referenced by _opengl2_setup_bicubic().

◆ bicubic_pass2_frag

const char bicubic_pass2_frag[]
static
Initial value:
=
"#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex, lut;\n"
"uniform float spline;\n"
"void main() {\n"
" vec2 coord = gl_TexCoord[0].xy;\n"
" vec2 TexCoord = vec2( coord.x, floor( coord.y - 0.5 ) + 0.5 );\n"
" vec4 wlut = texture2DRect( lut, vec2( ( coord.y - TexCoord.y ) * 1000.0, spline ) );\n"
" vec4 sum = texture2DRect( tex, TexCoord + vec2( 0.0, -1.0 ) ) * wlut[0];\n"
" sum += texture2DRect( tex, TexCoord ) * wlut[1];\n"
" sum += texture2DRect( tex, TexCoord + vec2( 0.0, 1.0 ) ) * wlut[2];\n"
" sum += texture2DRect( tex, TexCoord + vec2( 0.0, 2.0 ) ) * wlut[3];\n"
" gl_FragColor = sum;\n"
"}\n"

Referenced by _opengl2_setup_bicubic().

◆ blur_sharpen_args

const opengl2_shader_arg_name_t blur_sharpen_args[] = {"ARB", "tex", "mid", "side", "corn", ""}
static

Referenced by opengl2_sharpness().

◆ blur_sharpen_frag

const char blur_sharpen_frag[]
static
Initial value:
=
"#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex;\n"
"uniform float mid, side, corn;\n"
"void main() {\n"
" vec2 pos = gl_TexCoord[0].xy;\n"
" vec4 c1;\n"
" c1 = texture2DRect (tex, pos) * mid\n"
" + (texture2DRect (tex, pos + vec2 (-1.0, 0.0))\n"
" + texture2DRect (tex, pos + vec2 ( 0.0, -1.0))\n"
" + texture2DRect (tex, pos + vec2 ( 1.0, 0.0))\n"
" + texture2DRect (tex, pos + vec2 ( 0.0, 1.0))) * side\n"
" + (texture2DRect (tex, pos + vec2 (-1.0, -1.0))\n"
" + texture2DRect (tex, pos + vec2 ( 1.0, -1.0))\n"
" + texture2DRect (tex, pos + vec2 (-1.0, 1.0))\n"
" + texture2DRect (tex, pos + vec2 ( 1.0, 1.0))) * corn;\n"
" gl_FragColor = c1 ;\n"
"}\n"

Referenced by opengl2_sharpness().

◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED
Initial value:
= {
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
static void * opengl2_init_class_x11(xine_t *xine, const void *visual_gen)
Definition video_out_opengl2.c:2554
static void * opengl2_init_class_wl(xine_t *xine, const void *visual_gen)
Definition video_out_opengl2.c:2558
static const vo_info_t vo_info_opengl2
Definition video_out_opengl2.c:2562
static const vo_info_t vo_info_opengl2_wl
Definition video_out_opengl2.c:2567
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
Definition xine_plugin.c:78
#define PLUGIN_NONE
Definition xine_plugin.h:29
#define PLUGIN_VIDEO_OUT
Definition xine_plugin.h:36

◆ nv12_args

const opengl2_shader_arg_name_t nv12_args[] = {"r_coefs", "g_coefs", "b_coefs", "texY", "texUV", ""}
static

Referenced by opengl2_open_plugin().

◆ nv12_frag

const char nv12_frag[]
static
Initial value:
=
"uniform sampler2D texY, texUV;\n"
"uniform vec4 r_coefs, g_coefs, b_coefs;\n"
"void main (void) {\n"
" vec4 rgb;\n"
" vec4 yuv;\n"
" vec2 coord = gl_TexCoord[0].xy;\n"
" yuv.r = texture2D (texY, coord).r;\n"
" yuv.g = texture2D (texUV, coord).r;\n"
" yuv.b = texture2D (texUV, coord).$;\n"
" yuv.a = 1.0;\n"
" rgb.r = dot( yuv, r_coefs );\n"
" rgb.g = dot( yuv, g_coefs );\n"
" rgb.b = dot( yuv, b_coefs );\n"
" rgb.a = 1.0;\n"
" gl_FragColor = rgb;\n"
"}\n"

Referenced by opengl2_open_plugin().

◆ opengl2_exit_vector

opengl2_driver_t* opengl2_exit_vector[8]

◆ vo_info_opengl2

const vo_info_t vo_info_opengl2
static
Initial value:
= {
.priority = 8,
.visual_type = XINE_VISUAL_TYPE_X11,
}
#define XINE_VISUAL_TYPE_X11
Definition xine.h:154

◆ vo_info_opengl2_wl

const vo_info_t vo_info_opengl2_wl
static
Initial value:
= {
.priority = 8,
.visual_type = XINE_VISUAL_TYPE_WAYLAND,
}
#define XINE_VISUAL_TYPE_WAYLAND
Definition xine.h:166

◆ yuv420_args

const opengl2_shader_arg_name_t yuv420_args[] = {"r_coefs", "g_coefs", "b_coefs", "texY", "texU", "texV", ""}
static

Referenced by opengl2_open_plugin().

◆ yuv420_frag

const char yuv420_frag[]
static
Initial value:
=
"uniform sampler2D texY, texU, texV;\n"
"uniform vec4 r_coefs, g_coefs, b_coefs;\n"
"void main(void) {\n"
" vec4 rgb;\n"
" vec4 yuv;\n"
" vec2 coord = gl_TexCoord[0].xy;\n"
" yuv.r = texture2D (texY, coord).r;\n"
" yuv.g = texture2D (texU, coord).r;\n"
" yuv.b = texture2D (texV, coord).r;\n"
" yuv.a = 1.0;\n"
" rgb.r = dot (yuv, r_coefs);\n"
" rgb.g = dot (yuv, g_coefs);\n"
" rgb.b = dot (yuv, b_coefs);\n"
" rgb.a = 1.0;\n"
" gl_FragColor = rgb;\n"
"}\n"

Referenced by opengl2_open_plugin().

◆ yuv420j16_args

const opengl2_shader_arg_name_t yuv420j16_args[] = {"r_coefs", "g_coefs", "b_coefs", "texY", "tex_U_V", "join16", ""}
static

Referenced by opengl2_open_plugin().

◆ yuv420j16_frag

const char yuv420j16_frag[]
static
Initial value:
=
"uniform sampler2D texY, tex_U_V;\n"
"uniform vec4 r_coefs, g_coefs, b_coefs;\n"
"uniform vec2 join16;\n"
"void main(void) {\n"
" vec4 rgb;\n"
" vec4 yuv;\n"
" vec2 coord_y = gl_TexCoord[0].xy;\n"
" vec2 coord_u_v = coord_y * vec2 (1.0, 0.5);\n"
" yuv.r = dot (texture2D (texY, coord_y).r$, join16);\n"
" yuv.g = dot (texture2D (tex_U_V, coord_u_v).r$, join16);\n"
" yuv.b = dot (texture2D (tex_U_V, coord_u_v + vec2 (0.0, 0.5)).r$, join16);\n"
" yuv.a = 1.0;\n"
" rgb.r = dot (yuv, r_coefs);\n"
" rgb.g = dot (yuv, g_coefs);\n"
" rgb.b = dot (yuv, b_coefs);\n"
" rgb.a = 1.0;\n"
" gl_FragColor = rgb;\n"
"}\n"

Referenced by opengl2_open_plugin().

◆ yuv420j_args

const opengl2_shader_arg_name_t yuv420j_args[] = {"r_coefs", "g_coefs", "b_coefs", "texY", "tex_U_V", ""}
static

Referenced by opengl2_open_plugin().

◆ yuv420j_frag

const char yuv420j_frag[]
static
Initial value:
=
"uniform sampler2D texY, tex_U_V;\n"
"uniform vec4 r_coefs, g_coefs, b_coefs;\n"
"void main(void) {\n"
" vec4 rgb;\n"
" vec4 yuv;\n"
" vec2 coord_y = gl_TexCoord[0].xy;\n"
" vec2 coord_u_v = coord_y * vec2 (1.0, 0.5);\n"
" yuv.r = texture2D (texY, coord_y).r;\n"
" yuv.g = texture2D (tex_U_V, coord_u_v).r;\n"
" yuv.b = texture2D (tex_U_V, coord_u_v + vec2 (0.0, 0.5)).r;\n"
" yuv.a = 1.0;\n"
" rgb.r = dot (yuv, r_coefs);\n"
" rgb.g = dot (yuv, g_coefs);\n"
" rgb.b = dot (yuv, b_coefs);\n"
" rgb.a = 1.0;\n"
" gl_FragColor = rgb;\n"
"}\n"

Referenced by opengl2_open_plugin().

◆ yuv422_args

const opengl2_shader_arg_name_t yuv422_args[] = {"r_coefs", "g_coefs", "b_coefs", "texYUV", "yuy2v", ""}
static

Referenced by opengl2_open_plugin().

◆ yuv422_frag

const char yuv422_frag[]
static
Initial value:
=
"uniform sampler2D texYUV;\n"
"uniform vec4 r_coefs, g_coefs, b_coefs;\n"
"uniform vec2 yuy2v;\n"
"void main(void) {\n"
" vec4 rgba;\n"
" vec4 yuv;\n"
" vec4 coord = gl_TexCoord[0].xyxx;\n"
" float group_x = floor (coord.x * yuy2v.x);\n"
" coord.z = (group_x + 0.25) * yuy2v.y;\n"
" coord.w = (group_x + 0.75) * yuy2v.y;\n"
" yuv.r = texture2D (texYUV, coord.xy).r;\n"
" yuv.g = texture2D (texYUV, coord.zy).$;\n"
" yuv.b = texture2D (texYUV, coord.wy).$;\n"
" yuv.a = 1.0;\n"
" rgba.r = dot (yuv, r_coefs);\n"
" rgba.g = dot (yuv, g_coefs);\n"
" rgba.b = dot (yuv, b_coefs);\n"
" rgba.a = 1.0;\n"
" gl_FragColor = rgba;\n"
"}\n"

Referenced by opengl2_open_plugin().