[Mplayer-cvslog] CVS: main mplayer.c,1.377,1.378 mencoder.c,1.74,1.75 dec_video.c,1.89,1.90

Nick Kurshev nick at mplayer.dev.hu
Mon Jan 28 08:29:27 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv9796/main

Modified Files:
	mplayer.c mencoder.c dec_video.c 
Log Message:
New logic of HW equalizing:
1) Check HW capability.
2) If HW equalizer is capable control value then use it.
   In this case value of control is in range -100 : +100 (10x)
3) If not then try use SW equalizing (currently only divxds).
   Use old range (0 : +100) for that.
Well, you shouldn't watch OSD bar if neighter HW nor SW equalizers
are not capable control value.
TODO: find out keys (maybe Rr Bb Gg) or 'on screen menu' for RGB intensity
and OEM effects (fx).


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.377
retrieving revision 1.378
diff -u -r1.377 -r1.378
--- mplayer.c	27 Jan 2002 18:39:53 -0000	1.377
+++ mplayer.c	28 Jan 2002 07:29:17 -0000	1.378
@@ -114,11 +114,6 @@
              Video accelerated architecture
 **************************************************************************/
 vo_vaa_t vo_vaa;
-int v_hw_equ_cap=0;
-int v_bright=50;
-int v_cont=50;
-int v_hue=50;
-int v_saturation=50;
 
 //**************************************************************************//
 //             Config file
@@ -446,6 +441,11 @@
 int osd_show_av_delay = 0;
 int osd_show_sub_delay = 0;
 
+int v_hw_equ_cap=0;
+int v_bright=50;
+int v_cont=50;
+int v_hue=50;
+int v_saturation=50;
 /*
 For future:
 int v_red_intensity=0;
@@ -1327,10 +1327,10 @@
 	if(vo_vaa.get_video_eq(&veq) == 0)
 	{
 	    v_hw_equ_cap = veq.cap;
-	    v_bright = veq.brightness/10;
-	    v_cont = veq.contrast/10;
-	    v_hue = veq.hue/10;
-	    v_saturation=veq.saturation/10;
+	    if(veq.cap & VEQ_CAP_BRIGHTNESS) v_bright = veq.brightness/10;
+	    if(veq.cap & VEQ_CAP_CONTRAST) v_cont = veq.contrast/10;
+	    if(veq.cap & VEQ_CAP_HUE) v_hue = veq.hue/10;
+	    if(veq.cap & VEQ_CAP_SATURATION) v_saturation=veq.saturation/10;
 	    /*
 	    v_red_intensity=veq.red_intensity/10;
 	    v_green_intensity=veq.green_intensity/10;
@@ -2097,7 +2097,7 @@
 	    if ( ++v_cont > 100 ) v_cont = 100;
         } else {
 	    --v_cont;
-	    if(v_hw_equ_cap)
+	    if(v_hw_equ_cap & VEQ_CAP_CONTRAST)
 	    {
 		if(v_cont < -100) v_cont = -100;
 	    }
@@ -2125,7 +2125,7 @@
 	    if ( ++v_bright > 100 ) v_bright = 100;
         } else {
 	    --v_bright;
-	    if(v_hw_equ_cap)
+	    if(v_hw_equ_cap & VEQ_CAP_BRIGHTNESS)
 	    {
 		if(v_bright < -100) v_bright = -100;
 	    }
@@ -2153,7 +2153,7 @@
 	    if ( ++v_hue > 100 ) v_hue = 100;
         } else {
 	    --v_hue;
-	    if(v_hw_equ_cap)
+	    if(v_hw_equ_cap & VEQ_CAP_HUE)
 	    {
 		if(v_hue < -100) v_hue = -100;
 	    }
@@ -2181,7 +2181,7 @@
 	    if ( ++v_saturation > 100 ) v_saturation = 100;
         } else {
 	    --v_saturation;
-	    if(v_hw_equ_cap)
+	    if(v_hw_equ_cap & VEQ_CAP_SATURATION)
 	    {
 		if(v_saturation < -100) v_saturation = -100;
 	    }

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- mencoder.c	27 Jan 2002 21:46:06 -0000	1.74
+++ mencoder.c	28 Jan 2002 07:29:17 -0000	1.75
@@ -88,11 +88,6 @@
              Video accelerated architecture
 **************************************************************************/
 vo_vaa_t vo_vaa;
-int v_hw_equ_cap=0;
-int v_bright=50;
-int v_cont=50;
-int v_hue=50;
-int v_saturation=50;
 
 
 //--------------------------

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- dec_video.c	27 Jan 2002 18:39:53 -0000	1.89
+++ dec_video.c	28 Jan 2002 07:29:17 -0000	1.90
@@ -39,11 +39,6 @@
 extern double video_time_usage;
 extern double vout_time_usage;
 extern vo_vaa_t vo_vaa;
-extern int v_hw_equ_cap;
-extern int v_bright;
-extern int v_cont;
-extern int v_hue;
-extern int v_saturation;
 
 extern int frameratecode2framerate[16];
 
@@ -281,22 +276,55 @@
  }
 }
 
-int set_video_colors(sh_video_t *sh_video,char *item,int value){
-    if(v_hw_equ_cap != 0)
+int set_video_colors(sh_video_t *sh_video,char *item,int value)
+{
+    if(vo_vaa.get_video_eq)
     {
-	if(vo_vaa.set_video_eq)
+	vidix_video_eq_t veq;
+	if(vo_vaa.get_video_eq(&veq) == 0)
 	{
-	    vidix_video_eq_t veq;
-	    veq.cap = VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST | VEQ_CAP_SATURATION | VEQ_CAP_HUE;
-	    veq.brightness = v_bright*10;
-	    veq.contrast = v_cont*10;
-	    veq.saturation = v_saturation*10;
-	    veq.hue = v_hue;
-	    veq.flags = VEQ_FLG_ITU_R_BT_601; /* Fixme please !!! */
-	    vo_vaa.set_video_eq(&veq);
+	    int v_hw_equ_cap = veq.cap;
+	    if(v_hw_equ_cap != 0)
+	    {
+		if(vo_vaa.set_video_eq)
+		{
+		    vidix_video_eq_t veq;
+		    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;
+	    }
 	}
-	return 1;
     }
+    try_sw_control:
 #ifdef USE_DIRECTSHOW
     if(sh_video->codec->driver==VFM_DSHOW){
 	DS_VideoDecoder_SetValue(ds_vdec,item,value);




More information about the MPlayer-cvslog mailing list