[MPlayer-cvslog] r25247 - in trunk: 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

reimar subversion at mplayerhq.hu
Sun Dec 2 15:24:23 CET 2007


Author: reimar
Date: Sun Dec  2 15:24:23 2007
New Revision: 25247

Log:
Mark several uses of vo_functions_t as const to stop some of the current
hacks e.g. in vidix code from spreading.


Modified:
   trunk/TOOLS/subrip.c
   trunk/gui/interface.c
   trunk/libmenu/vf_menu.c
   trunk/libmpcodecs/vf_vo.c
   trunk/libvo/video_out.c
   trunk/libvo/video_out.h
   trunk/libvo/vo_dxr2.c
   trunk/libvo/vo_xover.c
   trunk/mencoder.c
   trunk/mp_core.h
   trunk/spudec.c
   trunk/spudec.h

Modified: trunk/TOOLS/subrip.c
==============================================================================
--- trunk/TOOLS/subrip.c	(original)
+++ trunk/TOOLS/subrip.c	Sun Dec  2 15:24:23 2007
@@ -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;
 

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	(original)
+++ trunk/gui/interface.c	Sun Dec  2 15:24:23 2007
@@ -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;

Modified: trunk/libmenu/vf_menu.c
==============================================================================
--- trunk/libmenu/vf_menu.c	(original)
+++ trunk/libmenu/vf_menu.c	Sun Dec  2 15:24:23 2007
@@ -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

Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c	(original)
+++ trunk/libmpcodecs/vf_vo.c	Sun Dec  2 15:24:23 2007
@@ -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*
     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;

Modified: trunk/libvo/video_out.c
==============================================================================
--- trunk/libvo/video_out.c	(original)
+++ trunk/libvo/video_out.c	Sun Dec  2 15:24:23 2007
@@ -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_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
     // 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();

Modified: trunk/libvo/video_out.h
==============================================================================
--- trunk/libvo/video_out.h	(original)
+++ trunk/libvo/video_out.h	Sun Dec  2 15:24:23 2007
@@ -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;
 

Modified: trunk/libvo/vo_dxr2.c
==============================================================================
--- trunk/libvo/vo_dxr2.c	(original)
+++ trunk/libvo/vo_dxr2.c	Sun Dec  2 15:24:23 2007
@@ -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;

Modified: trunk/libvo/vo_xover.c
==============================================================================
--- trunk/libvo/vo_xover.c	(original)
+++ trunk/libvo/vo_xover.c	Sun Dec  2 15:24:23 2007
@@ -67,7 +67,7 @@ static uint32_t window_width, window_hei
 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)

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	(original)
+++ trunk/mencoder.c	Sun Dec  2 15:24:23 2007
@@ -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;

Modified: trunk/mp_core.h
==============================================================================
--- trunk/mp_core.h	(original)
+++ trunk/mp_core.h	Sun Dec  2 15:24:23 2007
@@ -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.

Modified: trunk/spudec.c
==============================================================================
--- trunk/spudec.c	(original)
+++ trunk/spudec.c	Sun Dec  2 15:24:23 2007
@@ -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)

Modified: trunk/spudec.h
==============================================================================
--- trunk/spudec.h	(original)
+++ trunk/spudec.h	Sun Dec  2 15:24:23 2007
@@ -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);



More information about the MPlayer-cvslog mailing list