[Mplayer-cvslog] CVS: main/libmpcodecs ve_lavc.c,1.70,1.71
Alex Beregszaszi
alex at mplayerhq.hu
Mon Sep 1 15:26:44 CEST 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv5660
Modified Files:
ve_lavc.c
Log Message:
switched lavc_param_format to CONF_TYPE_IMGFMT
Index: ve_lavc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- ve_lavc.c 1 Sep 2003 12:44:31 -0000 1.70
+++ ve_lavc.c 1 Sep 2003 13:26:05 -0000 1.71
@@ -104,7 +104,7 @@
static int lavc_param_normalize_aqp= 0;
static int lavc_param_interlaced_dct= 0;
static int lavc_param_prediction_method= FF_PRED_LEFT;
-static char *lavc_param_format="YV12";
+static int lavc_param_format= IMGFMT_YV12;
static int lavc_param_debug= 0;
static int lavc_param_psnr= 0;
static int lavc_param_me_pre_cmp= 0;
@@ -185,7 +185,7 @@
{"ildct", &lavc_param_interlaced_dct, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"idct", &lavc_param_idct, CONF_TYPE_INT, CONF_RANGE, 0, 20, NULL},
{"pred", &lavc_param_prediction_method, CONF_TYPE_INT, CONF_RANGE, 0, 20, NULL},
- {"format", &lavc_param_format, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ {"format", &lavc_param_format, CONF_TYPE_IMGFMT, 0, 0, 0, NULL},
#if LIBAVCODEC_BUILD >= 4642
{"debug", &lavc_param_debug, CONF_TYPE_INT, CONF_RANGE, 0, 100000000, NULL},
#endif
@@ -420,21 +420,29 @@
lavc_venc_context->flags|= lavc_param_psnr;
#endif
lavc_venc_context->prediction_method= lavc_param_prediction_method;
- if(!strcasecmp(lavc_param_format, "YV12"))
- lavc_venc_context->pix_fmt= PIX_FMT_YUV420P;
- else if(!strcasecmp(lavc_param_format, "422P"))
- lavc_venc_context->pix_fmt= PIX_FMT_YUV422P;
- else if(!strcasecmp(lavc_param_format, "444P"))
- lavc_venc_context->pix_fmt= PIX_FMT_YUV444P;
- else if(!strcasecmp(lavc_param_format, "411P"))
- lavc_venc_context->pix_fmt= PIX_FMT_YUV411P;
- else if(!strcasecmp(lavc_param_format, "YVU9"))
- lavc_venc_context->pix_fmt= PIX_FMT_YUV410P;
- else if(!strcasecmp(lavc_param_format, "BGR32"))
- lavc_venc_context->pix_fmt= PIX_FMT_RGBA32;
- else{
- mp_msg(MSGT_MENCODER,MSGL_ERR,"%s is not a supported format\n", lavc_param_format);
- return 0;
+ switch(lavc_param_format)
+ {
+ case IMGFMT_YV12:
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV420P;
+ break;
+ case IMGFMT_422P:
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
+ break;
+ case IMGFMT_444P:
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV444P;
+ break;
+ case IMGFMT_411P:
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV411P;
+ break;
+ case IMGFMT_YVU9:
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV410P;
+ break;
+ case IMGFMT_BGR32:
+ lavc_venc_context->pix_fmt = PIX_FMT_RGBA32;
+ break;
+ default:
+ mp_msg(MSGT_MENCODER,MSGL_ERR,"%s is not a supported format\n", vo_format_name(lavc_param_format));
+ return 0;
}
/* lavc internal 2pass bitrate control */
@@ -514,27 +522,27 @@
case IMGFMT_YV12:
case IMGFMT_IYUV:
case IMGFMT_I420:
- if(!strcasecmp(lavc_param_format, "YV12"))
+ if(lavc_param_format == IMGFMT_YV12)
return VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
break;
case IMGFMT_411P:
- if(!strcasecmp(lavc_param_format, "411P"))
+ if(lavc_param_format == IMGFMT_411P)
return VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
break;
case IMGFMT_422P:
- if(!strcasecmp(lavc_param_format, "422P"))
+ if(lavc_param_format == IMGFMT_422P)
return VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
break;
case IMGFMT_444P:
- if(!strcasecmp(lavc_param_format, "444P"))
+ if(lavc_param_format == IMGFMT_444P)
return VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
break;
case IMGFMT_YVU9:
- if(!strcasecmp(lavc_param_format, "YVU9"))
+ if(lavc_param_format == IMGFMT_YVU9)
return VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
break;
case IMGFMT_BGR32:
- if(!strcasecmp(lavc_param_format, "BGR32"))
+ if(lavc_param_format == IMGFMT_BGR32)
return VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
break;
}
More information about the MPlayer-cvslog
mailing list