[MPlayer-cvslog] r30704 - in trunk/libmpcodecs: vf_eq.c vf_expand.c vf_palette.c vf_scale.c

diego subversion at mplayerhq.hu
Mon Feb 22 15:03:46 CET 2010


Author: diego
Date: Mon Feb 22 15:03:46 2010
New Revision: 30704

Log:
Mark a bunch of video filter structures as const.

Modified:
   trunk/libmpcodecs/vf_eq.c
   trunk/libmpcodecs/vf_expand.c
   trunk/libmpcodecs/vf_palette.c
   trunk/libmpcodecs/vf_scale.c

Modified: trunk/libmpcodecs/vf_eq.c
==============================================================================
--- trunk/libmpcodecs/vf_eq.c	Mon Feb 22 15:02:18 2010	(r30703)
+++ trunk/libmpcodecs/vf_eq.c	Mon Feb 22 15:03:46 2010	(r30704)
@@ -235,13 +235,13 @@ static int vf_open(vf_instance_t *vf, ch
 }
 
 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
-static m_option_t vf_opts_fields[] = {
+static const m_option_t vf_opts_fields[] = {
   {"brightness", ST_OFF(brightness), CONF_TYPE_INT, M_OPT_RANGE,-100 ,100, NULL},
   {"contrast", ST_OFF(contrast), CONF_TYPE_INT, M_OPT_RANGE,-100 ,100, NULL},
   { NULL, NULL, 0, 0, 0, 0,  NULL }
 };
 
-static m_struct_t vf_opts = {
+static const m_struct_t vf_opts = {
   "eq",
   sizeof(struct vf_priv_s),
   &vf_priv_dflt,

Modified: trunk/libmpcodecs/vf_expand.c
==============================================================================
--- trunk/libmpcodecs/vf_expand.c	Mon Feb 22 15:02:18 2010	(r30703)
+++ trunk/libmpcodecs/vf_expand.c	Mon Feb 22 15:03:46 2010	(r30704)
@@ -470,7 +470,7 @@ static int vf_open(vf_instance_t *vf, ch
 }
 
 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
-static m_option_t vf_opts_fields[] = {
+static const m_option_t vf_opts_fields[] = {
   {"w", ST_OFF(cfg_exp_w), CONF_TYPE_INT, 0, 0 ,0, NULL},
   {"h", ST_OFF(cfg_exp_h), CONF_TYPE_INT, 0, 0 ,0, NULL},
   {"x", ST_OFF(cfg_exp_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
@@ -481,7 +481,7 @@ static m_option_t vf_opts_fields[] = {
   { NULL, NULL, 0, 0, 0, 0,  NULL }
 };
 
-static m_struct_t vf_opts = {
+static const m_struct_t vf_opts = {
   "expand",
   sizeof(struct vf_priv_s),
   &vf_priv_dflt,

Modified: trunk/libmpcodecs/vf_palette.c
==============================================================================
--- trunk/libmpcodecs/vf_palette.c	Mon Feb 22 15:02:18 2010	(r30703)
+++ trunk/libmpcodecs/vf_palette.c	Mon Feb 22 15:03:46 2010	(r30704)
@@ -37,14 +37,14 @@
 // routines are incorrrect.  they assume the palette to be of the same
 // depth as the output, which is incorrect. --Joey
 
-static unsigned int bgr_list[]={
+static const unsigned int bgr_list[]={
     IMGFMT_BGR32,
     IMGFMT_BGR24,
 //    IMGFMT_BGR16,
 //    IMGFMT_BGR15,
     0
 };
-static unsigned int rgb_list[]={
+static const unsigned int rgb_list[]={
     IMGFMT_RGB32,
     IMGFMT_RGB24,
 //    IMGFMT_RGB16,
@@ -57,7 +57,7 @@ static unsigned int gray_pal[256];
 static unsigned int find_best(struct vf_instance *vf, unsigned int fmt){
     unsigned int best=0;
     int ret;
-    unsigned int* p;
+    const unsigned int* p;
     if(fmt==IMGFMT_BGR8) p=bgr_list;
     else if(fmt==IMGFMT_RGB8) p=rgb_list;
     else return 0;

Modified: trunk/libmpcodecs/vf_scale.c
==============================================================================
--- trunk/libmpcodecs/vf_scale.c	Mon Feb 22 15:02:18 2010	(r30703)
+++ trunk/libmpcodecs/vf_scale.c	Mon Feb 22 15:03:46 2010	(r30704)
@@ -63,7 +63,7 @@ static struct vf_priv_s {
 
 void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam);
 
-static unsigned int outfmt_list[]={
+static const unsigned int outfmt_list[]={
 // YUV:
     IMGFMT_444P,
     IMGFMT_444P16_LE,
@@ -655,7 +655,7 @@ struct SwsContext *sws_getContextFromCmd
 }
 
 /// An example of presets usage
-static struct size_preset {
+static const struct size_preset {
   char* name;
   int w, h;
 } vf_size_presets_defs[] = {
@@ -676,15 +676,15 @@ static m_option_t vf_size_preset_fields[
   { NULL, NULL, 0, 0, 0, 0,  NULL }
 };
 
-static m_struct_t vf_size_preset = {
+static const m_struct_t vf_size_preset = {
   "scale_size_preset",
   sizeof(struct size_preset),
   NULL,
   vf_size_preset_fields
 };
 
-static m_struct_t vf_opts;
-static m_obj_presets_t size_preset = {
+static const m_struct_t vf_opts;
+static const m_obj_presets_t size_preset = {
   &vf_size_preset, // Input struct desc
   &vf_opts, // Output struct desc
   vf_size_presets_defs, // The list of presets
@@ -694,7 +694,7 @@ static m_obj_presets_t size_preset = {
 /// Now the options
 #undef ST_OFF
 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
-static m_option_t vf_opts_fields[] = {
+static const m_option_t vf_opts_fields[] = {
   {"w", ST_OFF(w), CONF_TYPE_INT, M_OPT_MIN,-11,0, NULL},
   {"h", ST_OFF(h), CONF_TYPE_INT, M_OPT_MIN,-11,0, NULL},
   {"interlaced", ST_OFF(interlaced), CONF_TYPE_INT, M_OPT_RANGE, 0, 1, NULL},
@@ -709,7 +709,7 @@ static m_option_t vf_opts_fields[] = {
   { NULL, NULL, 0, 0, 0, 0,  NULL }
 };
 
-static m_struct_t vf_opts = {
+static const m_struct_t vf_opts = {
   "scale",
   sizeof(struct vf_priv_s),
   &vf_priv_dflt,


More information about the MPlayer-cvslog mailing list