changeset 25219:e82ecde2cbd4

Mark several uses of vo_functions_t as const to stop some of the current hacks e.g. in vidix code from spreading.
author reimar
date Sun, 02 Dec 2007 14:24:23 +0000
parents 9e7ecd4c60c1
children c9e9ac2008c2
files TOOLS/subrip.c gui/interface.c libmenu/vf_menu.c libmpcodecs/vf_vo.c libvo/video_out.c libvo/video_out.h libvo/vo_dxr2.c libvo/vo_xover.c mencoder.c mp_core.h spudec.c spudec.h
diffstat 12 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/TOOLS/subrip.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/TOOLS/subrip.c	Sun Dec 02 14:24:23 2007 +0000
@@ -71,7 +71,7 @@
   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;
 
--- a/gui/interface.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/gui/interface.c	Sun Dec 02 14:24:23 2007 +0000
@@ -507,7 +507,7 @@
 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;
--- a/libmenu/vf_menu.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/libmenu/vf_menu.c	Sun Dec 02 14:24:23 2007 +0000
@@ -44,7 +44,7 @@
 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
--- a/libmpcodecs/vf_vo.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/libmpcodecs/vf_vo.c	Sun Dec 02 14:24:23 2007 +0000
@@ -23,7 +23,7 @@
 
 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 @@
     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;
--- a/libvo/video_out.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/libvo/video_out.c	Sun Dec 02 14:24:23 2007 +0000
@@ -147,7 +147,7 @@
 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 @@
       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_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 @@
     // 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();
--- a/libvo/video_out.h	Sun Dec 02 14:17:45 2007 +0000
+++ b/libvo/video_out.h	Sun Dec 02 14:24:23 2007 +0000
@@ -176,14 +176,14 @@
 
 } 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;
 
--- a/libvo/vo_dxr2.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/libvo/vo_dxr2.c	Sun Dec 02 14:24:23 2007 +0000
@@ -37,7 +37,7 @@
 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;
--- a/libvo/vo_xover.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/libvo/vo_xover.c	Sun Dec 02 14:24:23 2007 +0000
@@ -67,7 +67,7 @@
 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)
--- a/mencoder.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/mencoder.c	Sun Dec 02 14:24:23 2007 +0000
@@ -215,7 +215,7 @@
 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;
--- a/mp_core.h	Sun Dec 02 14:17:45 2007 +0000
+++ b/mp_core.h	Sun Dec 02 14:24:23 2007 +0000
@@ -61,7 +61,7 @@
     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.
--- a/spudec.c	Sun Dec 02 14:17:45 2007 +0000
+++ b/spudec.c	Sun Dec 02 14:24:23 2007 +0000
@@ -90,7 +90,7 @@
   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_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)
--- a/spudec.h	Sun Dec 02 14:17:45 2007 +0000
+++ b/spudec.h	Sun Dec 02 14:24:23 2007 +0000
@@ -15,7 +15,7 @@
 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);