[MPlayer-cvslog] r29945 - in trunk/libmpcodecs: vf_crop.c vf_delogo.c vf_eq.c vf_format.c vf_hue.c vf_noformat.c vf_scale.c
reimar
subversion at mplayerhq.hu
Sat Nov 21 20:50:33 CET 2009
Author: reimar
Date: Sat Nov 21 20:50:33 2009
New Revision: 29945
Log:
Remove unreachable parsing code: for filters that use the option parser,
the args argument to open will always be NULL and vf->priv will always be
!= NULL.
Modified:
trunk/libmpcodecs/vf_crop.c
trunk/libmpcodecs/vf_delogo.c
trunk/libmpcodecs/vf_eq.c
trunk/libmpcodecs/vf_format.c
trunk/libmpcodecs/vf_hue.c
trunk/libmpcodecs/vf_noformat.c
trunk/libmpcodecs/vf_scale.c
Modified: trunk/libmpcodecs/vf_crop.c
==============================================================================
--- trunk/libmpcodecs/vf_crop.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_crop.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -144,19 +144,6 @@ static int open(vf_instance_t *vf, char*
vf->start_slice=start_slice;
vf->draw_slice=draw_slice;
vf->default_reqs=VFCAP_ACCEPT_STRIDE;
- if(!vf->priv) {
- vf->priv=malloc(sizeof(struct vf_priv_s));
- // TODO: parse args ->
- vf->priv->crop_x=
- vf->priv->crop_y=
- vf->priv->crop_w=
- vf->priv->crop_h=-1;
- } //if(!vf->priv)
- if(args) sscanf(args, "%d:%d:%d:%d",
- &vf->priv->crop_w,
- &vf->priv->crop_h,
- &vf->priv->crop_x,
- &vf->priv->crop_y);
mp_msg(MSGT_VFILTER, MSGL_INFO, "Crop: %d x %d, %d ; %d\n",
vf->priv->crop_w,
vf->priv->crop_h,
Modified: trunk/libmpcodecs/vf_delogo.c
==============================================================================
--- trunk/libmpcodecs/vf_delogo.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_delogo.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -204,20 +204,6 @@ static int open(vf_instance_t *vf, char*
vf->get_image=get_image;
vf->query_format=query_format;
vf->uninit=uninit;
- if (!vf->priv)
- {
- vf->priv=malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
- }
-
- if (args) res = sscanf(args, "%d:%d:%d:%d:%d",
- &vf->priv->xoff, &vf->priv->yoff,
- &vf->priv->lw, &vf->priv->lh,
- &vf->priv->band);
- if (args && (res != 5)) {
- uninit(vf);
- return 0; // bad syntax
- }
mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n",
vf->priv->xoff, vf->priv->yoff,
Modified: trunk/libmpcodecs/vf_eq.c
==============================================================================
--- trunk/libmpcodecs/vf_eq.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_eq.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -208,12 +208,6 @@ static int open(vf_instance_t *vf, char*
vf->put_image=put_image;
vf->uninit=uninit;
- if(!vf->priv) {
- vf->priv = malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
- }
- if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
-
process = process_C;
#if HAVE_MMX
if(gCpuCaps.hasMMX) process = process_MMX;
Modified: trunk/libmpcodecs/vf_format.c
==============================================================================
--- trunk/libmpcodecs/vf_format.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_format.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -31,45 +31,6 @@ static int query_format(struct vf_instan
static int open(vf_instance_t *vf, char* args){
vf->query_format=query_format;
vf->default_caps=0;
- if(!vf->priv) {
- vf->priv=malloc(sizeof(struct vf_priv_s));
- vf->priv->fmt=IMGFMT_YUY2;
- }
- if(args){
- if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
- if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
- if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else
- if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
- if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
- if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
- if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else
- if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else
- if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
- if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
- if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
- if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
- if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
- if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
- if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
- if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else
- if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else
- if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else
- if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
- if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
- if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
- if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
- if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
- if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else
- if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
- if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
- if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else
- if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
- if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
- if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
- { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
- }
-
-
return 1;
}
Modified: trunk/libmpcodecs/vf_hue.c
==============================================================================
--- trunk/libmpcodecs/vf_hue.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_hue.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -152,11 +152,6 @@ static int open(vf_instance_t *vf, char*
vf->put_image=put_image;
vf->uninit=uninit;
- if(!vf->priv) {
- vf->priv = malloc(sizeof(struct vf_priv_s));
- memset(vf->priv, 0, sizeof(struct vf_priv_s));
- }
- if (args) sscanf(args, "%f:%f", &vf->priv->hue, &vf->priv->saturation);
vf->priv->hue *= M_PI / 180.0;
process = process_C;
Modified: trunk/libmpcodecs/vf_noformat.c
==============================================================================
--- trunk/libmpcodecs/vf_noformat.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_noformat.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -31,45 +31,6 @@ static int query_format(struct vf_instan
static int open(vf_instance_t *vf, char* args){
vf->query_format=query_format;
vf->default_caps=0;
- if(!vf->priv) {
- vf->priv=malloc(sizeof(struct vf_priv_s));
- vf->priv->fmt=IMGFMT_YV12;
- }
- if(args){
- if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
- if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
- if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else
- if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
- if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
- if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
- if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else
- if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else
- if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
- if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
- if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
- if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
- if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
- if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
- if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
- if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else
- if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else
- if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else
- if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
- if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
- if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
- if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
- if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
- if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else
- if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
- if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
- if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else
- if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
- if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
- if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
- { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
- }
-
-
return 1;
}
Modified: trunk/libmpcodecs/vf_scale.c
==============================================================================
--- trunk/libmpcodecs/vf_scale.c Sat Nov 21 19:59:52 2009 (r29944)
+++ trunk/libmpcodecs/vf_scale.c Sat Nov 21 20:50:33 2009 (r29945)
@@ -508,25 +508,6 @@ static int open(vf_instance_t *vf, char*
vf->query_format=query_format;
vf->control= control;
vf->uninit=uninit;
- if(!vf->priv) {
- vf->priv=malloc(sizeof(struct vf_priv_s));
- // TODO: parse args ->
- vf->priv->ctx=NULL;
- vf->priv->ctx2=NULL;
- vf->priv->w=
- vf->priv->h=-1;
- vf->priv->v_chr_drop=0;
- vf->priv->accurate_rnd=0;
- vf->priv->param[0]=
- vf->priv->param[1]=SWS_PARAM_DEFAULT;
- vf->priv->palette=NULL;
- } // if(!vf->priv)
- if(args) sscanf(args, "%d:%d:%d:%lf:%lf",
- &vf->priv->w,
- &vf->priv->h,
- &vf->priv->v_chr_drop,
- &vf->priv->param[0],
- &vf->priv->param[1]);
mp_msg(MSGT_VFILTER,MSGL_V,"SwScale params: %d x %d (-1=no scaling)\n",
vf->priv->w,
vf->priv->h);
More information about the MPlayer-cvslog
mailing list