From 844c8ffc48c7e7715c43a1290188f5bdfa289821 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 2 Dec 2007 14:24:23 +0000 Subject: 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 --- TOOLS/subrip.c | 2 +- gui/interface.c | 2 +- libmenu/vf_menu.c | 2 +- libmpcodecs/vf_vo.c | 4 ++-- libvo/video_out.c | 10 +++++----- libvo/video_out.h | 6 +++--- libvo/vo_dxr2.c | 2 +- libvo/vo_xover.c | 2 +- mencoder.c | 2 +- mp_core.h | 2 +- spudec.c | 4 ++-- spudec.h | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/TOOLS/subrip.c b/TOOLS/subrip.c index ed1161900e..1548a383db 100644 --- a/TOOLS/subrip.c +++ b/TOOLS/subrip.c @@ -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; diff --git a/gui/interface.c b/gui/interface.c index 63d86cde4e..ce89174205 100644 --- a/gui/interface.c +++ b/gui/interface.c @@ -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; diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index 5c8a2bf2a1..a707a8d476 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -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 diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index fc1ca92d42..4c3f7508ac 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -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; diff --git a/libvo/video_out.c b/libvo/video_out.c index 53aeb3eca1..98feb468d7 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -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(); diff --git a/libvo/video_out.h b/libvo/video_out.h index ee31c8735b..443654692c 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -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; diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index f2c9509b47..a424e5e6f3 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -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; diff --git a/libvo/vo_xover.c b/libvo/vo_xover.c index 9c1275b542..46f8f83fcf 100644 --- a/libvo/vo_xover.c +++ b/libvo/vo_xover.c @@ -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) diff --git a/mencoder.c b/mencoder.c index 835a65fcfa..4332b89673 100644 --- a/mencoder.c +++ b/mencoder.c @@ -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; diff --git a/mp_core.h b/mp_core.h index 0b6695861a..277c37f2aa 100644 --- a/mp_core.h +++ b/mp_core.h @@ -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. diff --git a/spudec.c b/spudec.c index 0263c9e689..99edb98136 100644 --- a/spudec.c +++ b/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) diff --git a/spudec.h b/spudec.h index 46d218a0a1..f3db985462 100644 --- a/spudec.h +++ b/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); -- cgit v1.2.3