/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* You can alternatively redistribute this file and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>
#include "config.h"
#include "talloc.h"
#include "mp_msg.h"
#include "subopt-helper.h"
#include "video_out.h"
#include "libmpcodecs/vfcap.h"
#include "libmpcodecs/mp_image.h"
#include "geometry.h"
#include "osd.h"
#include "sub/font_load.h"
#include "sub/sub.h"
#ifdef CONFIG_GL_X11
#include "x11_common.h"
#endif
#include "gl_common.h"
#include "aspect.h"
#include "fastmemcpy.h"
#include "sub/ass_mp.h"
#ifdef CONFIG_GL_SDL
#ifdef CONFIG_SDL_SDL_H
#include <SDL/SDL.h>
#else
#include <SDL.h>
#endif
#endif
static int preinit_nosw(struct vo *vo, const char *arg);
//! How many parts the OSD may consist of at most
#define MAX_OSD_PARTS 20
#define LARGE_EOSD_TEX_SIZE 512
#define TINYTEX_SIZE 16
#define TINYTEX_COLS (LARGE_EOSD_TEX_SIZE / TINYTEX_SIZE)
#define TINYTEX_MAX (TINYTEX_COLS * TINYTEX_COLS)
#define SMALLTEX_SIZE 32
#define SMALLTEX_COLS (LARGE_EOSD_TEX_SIZE / SMALLTEX_SIZE)
#define SMALLTEX_MAX (SMALLTEX_COLS * SMALLTEX_COLS)
//for gl_priv.use_yuv
#define MASK_ALL_YUV (~(1 << YUV_CONVERSION_NONE))
#define MASK_NOT_COMBINERS (~((1 << YUV_CONVERSION_NONE) | (1 << YUV_CONVERSION_COMBINERS)))
#define MASK_GAMMA_SUPPORT (MASK_NOT_COMBINERS & ~(1 << YUV_CONVERSION_FRAGMENT))
struct gl_priv {
MPGLContext *glctx;
GL *gl;
int use_osd;
int scaled_osd;
//! Textures for OSD
GLuint osdtex[MAX_OSD_PARTS];
#ifndef FAST_OSD
//! Alpha textures for OSD
GLuint osdatex[MAX_OSD_PARTS];
#endif
GLuint *eosdtex;
GLuint largeeosdtex[2];
//! Display lists that draw the OSD parts
GLuint osdDispList[MAX_OSD_PARTS];
#ifndef FAST_OSD
GLuint osdaDispList[MAX_OSD_PARTS];
#endif
GLuint eosdDispList;
//! How many parts the OSD currently consists of
int osdtexCnt;
int eosdtexCnt;
int osd_color;
int use_ycbcr;
int use_yuv;
struct mp_csp_details colorspace;
int is_yuv;
int lscale;
int cscale;
float filter_strength;
int yuvconvtype;
int use_rectangle;
int err_shown;
uint32_t image_width;
uint32_t image_height;
uint32_t image_format;
uint32_t image_d_width;
uint32_t image_d_height;
int many_fmts;
int ati_hack;
int force_pbo;
int mesa_buffer;
int use_glFinish;
int swap_interval;
GLenum target;
GLint texfmt;
GLenum gl_format;
GLenum gl_type;
GLuint buffer;
GLuint buffer_uv[2];
int buffersize;
int buffersize_uv;
void *bufferptr;
void *bufferptr_uv[2];
int mesa_buffersize;
void *mesa_bufferptr;
GLuint fragprog;
GLuint default_texs[22];
char *custom_prog;
char *custom_tex;
int custom_tlin;
int custom_trect;
int mipmap_gen;
int stereo_mode;
int int_pause;
struct mp_csp_equalizer video_eq;
int texture_width;
|