[Mplayer-cvslog] CVS: main/libmpcodecs dec_video.c,1.138,1.139 vd.h,1.9,1.10 vf.h,1.10,1.11 vf_vo.c,1.12,1.13

Alex Beregszaszi alex at mplayerhq.hu
Wed Jul 24 20:14:39 CEST 2002


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

Modified Files:
	dec_video.c vd.h vf.h vf_vo.c 
Log Message:
equalizer reworked

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- dec_video.c	25 Jun 2002 22:29:32 -0000	1.138
+++ dec_video.c	24 Jul 2002 18:14:21 -0000	1.139
@@ -76,53 +76,23 @@
 
 int set_video_colors(sh_video_t *sh_video,char *item,int value)
 {
-    if(vo_vaa.get_video_eq)
-    {
-	vidix_video_eq_t veq;
-	if(vo_vaa.get_video_eq(&veq) == 0)
-	{
-	    int v_hw_equ_cap = veq.cap;
-	    if(v_hw_equ_cap != 0)
-	    {
-		if(vo_vaa.set_video_eq)
-		{
-		    veq.flags = VEQ_FLG_ITU_R_BT_601; /* Fixme please !!! */
-		    if(strcmp(item,"Brightness") == 0)
-		    {
-			if(!(v_hw_equ_cap & VEQ_CAP_BRIGHTNESS)) goto try_sw_control;
-			veq.brightness = value*10;
-			veq.cap = VEQ_CAP_BRIGHTNESS;
-		    }
-		    else
-		    if(strcmp(item,"Contrast") == 0)
-		    {
-			if(!(v_hw_equ_cap & VEQ_CAP_CONTRAST)) goto try_sw_control;
-			veq.contrast = value*10;
-			veq.cap = VEQ_CAP_CONTRAST;
-		    }
-		    else
-		    if(strcmp(item,"Saturation") == 0)
-		    {
-			if(!(v_hw_equ_cap & VEQ_CAP_SATURATION)) goto try_sw_control;
-			veq.saturation = value*10;
-			veq.cap = VEQ_CAP_SATURATION;
-		    }
-		    else
-		    if(strcmp(item,"Hue") == 0)
-		    {
-			if(!(v_hw_equ_cap & VEQ_CAP_HUE)) goto try_sw_control;
-			veq.hue = value*10;
-			veq.cap = VEQ_CAP_HUE;
-		    }
-		    else goto try_sw_control;;
-		    vo_vaa.set_video_eq(&veq);
-		}
-		return 1;
-	    }
-	}
-    }
-    try_sw_control:
-    if(mpvdec) return mpvdec->control(sh_video,VDCTRL_SET_EQUALIZER,item,(int)value);
+    vf_instance_t* vf=sh_video->vfilter;
+    
+    if (vf->control(vf, VFCTRL_SET_EQUALIZER, item, (int *)value) == CONTROL_TRUE)
+	return 1;
+    /* try software control */
+    if(mpvdec) return mpvdec->control(sh_video,VDCTRL_SET_EQUALIZER, item, (int *)value);
+    return 0;
+}
+
+int get_video_colors(sh_video_t *sh_video,char *item,int *value)
+{
+    vf_instance_t* vf=sh_video->vfilter;
+    
+    if (vf->control(vf, VFCTRL_GET_EQUALIZER, item, value) == CONTROL_TRUE)
+	return 1;
+    /* try software control */
+    if(mpvdec) return mpvdec->control(sh_video,VDCTRL_GET_EQUALIZER, item, value);
     return 0;
 }
 
@@ -201,7 +171,7 @@
 //------------------------ frame decoded. --------------------
 
 #ifdef ARCH_X86
-	// some codecs is broken, and doesn't restore MMX state :(
+	// some codecs are broken, and doesn't restore MMX state :(
 	// it happens usually with broken/damaged files.
 if(gCpuCaps.has3DNow){
 	__asm __volatile ("femms\n\t":::"memory");

Index: vd.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vd.h	11 Jul 2002 20:17:27 -0000	1.9
+++ vd.h	24 Jul 2002 18:14:21 -0000	1.10
@@ -21,6 +21,7 @@
 #define VDCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
 #define VDCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
 #define VDCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
+#define VDCTRL_GET_EQUALIZER 7 /* get color options (brightness,contrast etc) */
 
 // callbacks:
 int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);

Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- vf.h	13 May 2002 21:05:02 -0000	1.10
+++ vf.h	24 Jul 2002 18:14:21 -0000	1.11
@@ -24,7 +24,7 @@
         int width, int height, int d_width, int d_height,
 	unsigned int flags, unsigned int outfmt);
     int (*control)(struct vf_instance_s* vf,
-        int request, void* data);
+        int request, void* data, ...);
     int (*query_format)(struct vf_instance_s* vf,
         unsigned int fmt);
     void (*get_image)(struct vf_instance_s* vf,
@@ -49,7 +49,7 @@
 #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
 #define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
 #define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
-
+#define VFCTRL_GET_EQUALIZER 8 /* gset color options (brightness,contrast etc) */
 #define VFCTRL_DRAW_OSD 7
 
 #include "vfcap.h"

Index: vf_vo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_vo.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- vf_vo.c	26 May 2002 15:55:29 -0000	1.12
+++ vf_vo.c	24 Jul 2002 18:14:21 -0000	1.13
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdarg.h>
 
 #include "../config.h"
 #include "../mp_msg.h"
@@ -46,13 +47,37 @@
     return 1;
 }
 
-static int control(struct vf_instance_s* vf,
-        int request, void* data){
+static int control(struct vf_instance_s* vf, int request, void* data, ...)
+{
     switch(request){
+#ifdef USE_OSD
     case VFCTRL_DRAW_OSD:
 	if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
 	video_out->draw_osd();
 	return CONTROL_TRUE;
+#endif
+    case VFCTRL_SET_EQUALIZER:
+    {
+	va_list ap;
+	int value;
+
+	if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
+	va_start(ap, data);
+	value = va_arg(ap, int);
+	va_end(ap);
+	return((video_out->control(VOCTRL_SET_EQUALIZER, data, (int *)value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE);
+    }
+    case VFCTRL_GET_EQUALIZER:
+    {
+	va_list ap;
+	int value;
+
+	if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
+	va_start(ap, data);
+	value = va_arg(ap, int);
+	va_end(ap);
+	return((video_out->control(VOCTRL_GET_EQUALIZER, data, (int *)value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE);
+    }
     }
     // return video_out->control(request,data);
     return CONTROL_UNKNOWN;




More information about the MPlayer-cvslog mailing list