[Mplayer-cvslog] CVS: main/libvo mga_common.c,1.21,1.22

Arpi of Ize arpi at mplayer.dev.hu
Sun Mar 10 04:37:29 CET 2002


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

Modified Files:
	mga_common.c 
Log Message:
video_eq support - applied brightness/contrast patch by Brian J. Murrell

Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- mga_common.c	7 Mar 2002 17:50:25 -0000	1.21
+++ mga_common.c	10 Mar 2002 03:37:26 -0000	1.22
@@ -29,6 +29,42 @@
     }
 }
 
+static int mga_set_video_eq( const vidix_video_eq_t *info)
+{
+
+	uint32_t luma;
+	float factor = 256.0 / 2000;
+
+	luma = ((int)(info->brightness * factor) << 16) +
+		   ((int)(info->contrast * factor) & 0xFFFF);
+	if (ioctl(f,MGA_VID_SET_LUMA,luma)) {
+		perror("Error in mga_vid_config ioctl()");
+                printf("Could not set luma values in the kernel module!\n");
+		return -1;
+	}
+    return 0;
+
+}
+
+static int mga_get_video_eq( vidix_video_eq_t *info)
+{
+
+	uint32_t luma;
+	float factor = 2000.0 / 256;
+
+	if (ioctl(f,MGA_VID_GET_LUMA,&luma)) {
+		perror("Error in mga_vid_config ioctl()");
+                printf("Could not get luma values from the kernel module!\n");
+		return -1;
+	}
+	info->brightness = (luma >> 16) * factor;
+	info->cap |= VEQ_CAP_BRIGHTNESS;
+
+	info->contrast = (luma & 0xFFFF) * factor;
+	info->cap |= VEQ_CAP_CONTRAST;
+
+    return 0;
+}
 
 //static void
 //write_slice_g200(uint8_t *y,uint8_t *cr, uint8_t *cb,uint32_t slice_num)
@@ -230,9 +266,18 @@
     return 0;
 }
 
+static void query_vaa(vo_vaa_t *vaa)
+{
+  memset(vaa,0,sizeof(vo_vaa_t));
+  vaa->get_video_eq = mga_get_video_eq;
+  vaa->set_video_eq = mga_set_video_eq;
+}
 static uint32_t control(uint32_t request, void *data, ...)
 {
   switch (request) {
+  case VOCTRL_QUERY_VAA:
+    query_vaa((vo_vaa_t*)data);
+    return VO_TRUE;
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
   case VOCTRL_GET_IMAGE:




More information about the MPlayer-cvslog mailing list