[Mplayer-cvslog] CVS: main/libmpcodecs vf_eq.c,1.6,1.7

Alban Bedel CVS albeu at mplayerhq.hu
Sat Mar 15 21:45:09 CET 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv6491/libmpcodecs

Modified Files:
	vf_eq.c 
Log Message:
Support for the new options stuff


Index: vf_eq.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_eq.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vf_eq.c	15 Mar 2003 18:01:02 -0000	1.6
+++ vf_eq.c	15 Mar 2003 20:45:03 -0000	1.7
@@ -15,10 +15,17 @@
 #include "../libvo/fastmemcpy.h"
 #include "../postproc/rgb2rgb.h"
 
-struct vf_priv_s {
+#include "m_option.h"
+#include "m_struct.h"
+
+static struct vf_priv_s {
 	unsigned char *buf;
 	int brightness;
 	int contrast;
+} vf_priv_dflt = {
+  NULL,
+  0,
+  0
 };
 
 #ifdef HAVE_MMX
@@ -202,8 +209,10 @@
 	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;
@@ -214,12 +223,26 @@
 	return 1;
 }
 
+#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
+static 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 = {
+  "eq",
+  sizeof(struct vf_priv_s),
+  &vf_priv_dflt,
+  vf_opts_fields
+};
+
 vf_info_t vf_info_eq = {
 	"soft video equalizer",
 	"eq",
 	"Richard Felker",
 	"",
 	open,
-	NULL
+	&vf_opts
 };
 



More information about the MPlayer-cvslog mailing list