mirror of
https://github.com/mpv-player/mpv
synced 2025-02-23 00:06:56 +00:00
Mark several uses of vo_functions_t as const to stop some of the current
hacks e.g. in vidix code from spreading. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25247 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
bbab104b7e
commit
844c8ffc48
@ -71,7 +71,7 @@ typedef struct {
|
||||
unsigned char *scaled_aimage;
|
||||
int auto_palette; /* 1 if we lack a palette and must use an heuristic. */
|
||||
int font_start_level; /* Darkest value used for the computed font */
|
||||
vo_functions_t *hw_spu;
|
||||
const vo_functions_t *hw_spu;
|
||||
int spu_changed;
|
||||
} spudec_handle_t;
|
||||
|
||||
|
@ -507,7 +507,7 @@ static void remove_vf( char * str )
|
||||
int guiGetEvent( int type,char * arg )
|
||||
{
|
||||
ao_functions_t *audio_out = NULL;
|
||||
vo_functions_t *video_out = NULL;
|
||||
const vo_functions_t *video_out = NULL;
|
||||
mixer_t *mixer = NULL;
|
||||
|
||||
stream_t * stream = (stream_t *) arg;
|
||||
|
@ -44,7 +44,7 @@ struct vf_priv_s {
|
||||
static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts);
|
||||
|
||||
void vf_menu_pause_update(struct vf_instance_s* vf) {
|
||||
vo_functions_t *video_out = mpctx_get_video_out(vf->priv->current->ctx);
|
||||
const vo_functions_t *video_out = mpctx_get_video_out(vf->priv->current->ctx);
|
||||
if(pause_mpi) {
|
||||
put_image(vf,pause_mpi, MP_NOPTS_VALUE);
|
||||
// Don't draw the osd atm
|
||||
|
@ -23,7 +23,7 @@ extern float sub_delay;
|
||||
|
||||
struct vf_priv_s {
|
||||
double pts;
|
||||
vo_functions_t *vo;
|
||||
const vo_functions_t *vo;
|
||||
#ifdef USE_ASS
|
||||
ass_renderer_t* ass_priv;
|
||||
int prev_visibility;
|
||||
@ -222,7 +222,7 @@ static int open(vf_instance_t *vf, char* args){
|
||||
vf->start_slice=start_slice;
|
||||
vf->uninit=uninit;
|
||||
vf->priv=calloc(1, sizeof(struct vf_priv_s));
|
||||
vf->priv->vo = (vo_functions_t *)args;
|
||||
vf->priv->vo = (const vo_functions_t *)args;
|
||||
if(!video_out) return 0; // no vo ?
|
||||
// if(video_out->preinit(args)) return 0; // preinit failed
|
||||
return 1;
|
||||
|
@ -147,7 +147,7 @@ extern vo_functions_t video_out_pnm;
|
||||
extern vo_functions_t video_out_md5sum;
|
||||
#endif
|
||||
|
||||
vo_functions_t* video_out_drivers[] =
|
||||
const vo_functions_t* const video_out_drivers[] =
|
||||
{
|
||||
#ifdef HAVE_XVR100
|
||||
&video_out_xvr100,
|
||||
@ -288,7 +288,7 @@ void list_video_out(void){
|
||||
mp_msg(MSGT_GLOBAL, MSGL_INFO,"\n");
|
||||
}
|
||||
|
||||
vo_functions_t* init_best_video_out(char** vo_list){
|
||||
const vo_functions_t* init_best_video_out(char** vo_list){
|
||||
int i;
|
||||
// first try the preferred drivers, with their optional subdevice param:
|
||||
if(vo_list && vo_list[0])
|
||||
@ -304,7 +304,7 @@ vo_functions_t* init_best_video_out(char** vo_list){
|
||||
++vo_subdevice;
|
||||
}
|
||||
for(i=0;video_out_drivers[i];i++){
|
||||
vo_functions_t* video_driver=video_out_drivers[i];
|
||||
const vo_functions_t* video_driver=video_out_drivers[i];
|
||||
const vo_info_t *info = video_driver->info;
|
||||
if(!strcmp(info->short_name,vo)){
|
||||
// name matches, try it
|
||||
@ -323,14 +323,14 @@ vo_functions_t* init_best_video_out(char** vo_list){
|
||||
// now try the rest...
|
||||
vo_subdevice=NULL;
|
||||
for(i=0;video_out_drivers[i];i++){
|
||||
vo_functions_t* video_driver=video_out_drivers[i];
|
||||
const vo_functions_t* video_driver=video_out_drivers[i];
|
||||
if(!video_driver->preinit(vo_subdevice))
|
||||
return video_driver; // success!
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int config_video_out(vo_functions_t *vo, uint32_t width, uint32_t height,
|
||||
int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
|
||||
uint32_t d_width, uint32_t d_height, uint32_t flags,
|
||||
char *title, uint32_t format) {
|
||||
panscan_init();
|
||||
|
@ -176,14 +176,14 @@ typedef struct vo_functions_s
|
||||
|
||||
} vo_functions_t;
|
||||
|
||||
vo_functions_t* init_best_video_out(char** vo_list);
|
||||
int config_video_out(vo_functions_t *vo, uint32_t width, uint32_t height,
|
||||
const vo_functions_t* init_best_video_out(char** vo_list);
|
||||
int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
|
||||
uint32_t d_width, uint32_t d_height, uint32_t flags,
|
||||
char *title, uint32_t format);
|
||||
void list_video_out(void);
|
||||
|
||||
// NULL terminated array of all drivers
|
||||
extern vo_functions_t* video_out_drivers[];
|
||||
extern const vo_functions_t* const video_out_drivers[];
|
||||
|
||||
extern int vo_flags;
|
||||
|
||||
|
@ -37,7 +37,7 @@ static int movie_w,movie_h;
|
||||
static int playing = 0;
|
||||
|
||||
// vo device used to blank the screen for the overlay init
|
||||
static vo_functions_t* sub_vo = NULL;
|
||||
static const vo_functions_t* sub_vo = NULL;
|
||||
|
||||
static uint8_t* sub_img = NULL;
|
||||
static int sub_x,sub_y,sub_w,sub_h;
|
||||
|
@ -67,7 +67,7 @@ static uint32_t window_width, window_height;
|
||||
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
|
||||
drwDepth, drwcX, drwcY, dwidth, dheight;
|
||||
|
||||
static vo_functions_t* sub_vo = NULL;
|
||||
static const vo_functions_t* sub_vo = NULL;
|
||||
|
||||
|
||||
static void set_window(int force_update)
|
||||
|
@ -215,7 +215,7 @@ char *info_sourceform=NULL;
|
||||
char *info_comment=NULL;
|
||||
|
||||
// Needed by libmpcodecs vf_vo.c
|
||||
int config_video_out(vo_functions_t *vo, uint32_t width, uint32_t height,
|
||||
int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
|
||||
uint32_t d_width, uint32_t d_height, uint32_t flags,
|
||||
char *title, uint32_t format) {
|
||||
return 1;
|
||||
|
@ -61,7 +61,7 @@ typedef struct MPContext {
|
||||
demux_stream_t *d_video;
|
||||
demux_stream_t *d_sub;
|
||||
mixer_t mixer;
|
||||
vo_functions_t *video_out;
|
||||
const vo_functions_t *video_out;
|
||||
// Frames buffered in the vo ready to flip. Currently always 0 or 1.
|
||||
// This is really a vo variable but currently there's no suitable vo
|
||||
// struct.
|
||||
|
4
spudec.c
4
spudec.c
@ -90,7 +90,7 @@ typedef struct {
|
||||
unsigned char *scaled_aimage;
|
||||
int auto_palette; /* 1 if we lack a palette and must use an heuristic. */
|
||||
int font_start_level; /* Darkest value used for the computed font */
|
||||
vo_functions_t *hw_spu;
|
||||
const vo_functions_t *hw_spu;
|
||||
int spu_changed;
|
||||
unsigned int forced_subs_only; /* flag: 0=display all subtitle, !0 display only forced subtitles */
|
||||
unsigned int is_forced_sub; /* true if current subtitle is a forced subtitle */
|
||||
@ -1170,7 +1170,7 @@ void spudec_free(void *this)
|
||||
}
|
||||
}
|
||||
|
||||
void spudec_set_hw_spu(void *this, vo_functions_t *hw_spu)
|
||||
void spudec_set_hw_spu(void *this, const vo_functions_t *hw_spu)
|
||||
{
|
||||
spudec_handle_t *spu = (spudec_handle_t*)this;
|
||||
if (!spu)
|
||||
|
2
spudec.h
2
spudec.h
@ -15,7 +15,7 @@ void spudec_free(void *this);
|
||||
void spudec_reset(void *this); // called after seek
|
||||
int spudec_visible(void *this); // check if spu is visible
|
||||
void spudec_set_font_factor(void * this, double factor); // sets the equivalent to ffactor
|
||||
void spudec_set_hw_spu(void *this, vo_functions_t *hw_spu);
|
||||
void spudec_set_hw_spu(void *this, const vo_functions_t *hw_spu);
|
||||
int spudec_changed(void *this);
|
||||
void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox);
|
||||
void spudec_set_forced_subs_only(void * const this, const unsigned int flag);
|
||||
|
Loading…
Reference in New Issue
Block a user