[Mplayer-cvslog] CVS: main mplayer.c,1.198,1.199 dec_video.c,1.14,1.15

Arpi of Ize arpi at mplayer.dev.hu
Wed Aug 1 03:02:36 CEST 2001


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

Modified Files:
	mplayer.c dec_video.c 
Log Message:
contrast/brightness/etc patch (temporary)

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- mplayer.c	31 Jul 2001 23:18:16 -0000	1.198
+++ mplayer.c	1 Aug 2001 01:02:33 -0000	1.199
@@ -173,6 +173,10 @@
 demuxer_t* demux_open(stream_t *stream,int file_format);
 int demux_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
 
+int get_video_quality_max(sh_video_t *sh_video);
+void set_video_quality(sh_video_t *sh_video,int quality);
+int set_video_colors(sh_video_t *sh_video,char *item,int value);
+
 // MPEG video stream parser:
 #include "parse_es.h"
 
@@ -227,6 +231,7 @@
 // options:
 int osd_level=2;
 int divx_quality=0;
+int auto_quality=-1;
 char *seek_to_sec=NULL;
 off_t seek_to_byte=0;
 int has_audio=1;
@@ -461,6 +466,11 @@
 int osd_function=OSD_PLAY;
 int osd_last_pts=-303;
 
+int v_bright=50;
+int v_cont=50;
+int v_hue=50;
+int v_saturation=50;
+
 //float a_frame=0;    // Audio
 
 float rel_seek_secs=0;
@@ -1565,6 +1575,83 @@
     case 'm':
       mixer_usemaster=!mixer_usemaster;
       break;
+
+    // Contrast:
+    case '1':
+    case '2':
+        if(c=='2'){
+	    if ( v_cont++ > 100 ) v_cont = 100;
+        } else {
+    	    if ( v_cont-- < 0 ) v_cont = 0;	    
+        }
+	if(set_video_colors(sh_video,"Contrast",v_cont)){
+#ifdef USE_OSD
+    		if(osd_level){
+            	    osd_visible=sh_video->fps; // 1 sec
+	    	    vo_osd_progbar_type=OSD_CONTRAST;
+            	    vo_osd_progbar_value=(v_cont)*10/4;
+		}
+#endif
+	}
+	break;
+
+    // Brightness:
+    case '3':
+    case '4':
+        if(c=='4'){
+	    if ( v_bright++ > 100 ) v_bright = 100;
+        } else {
+    	    if ( v_bright-- < 0 ) v_bright = 0;	    
+        }
+	if(set_video_colors(sh_video,"Brightness",v_bright)){
+#ifdef USE_OSD
+    		if(osd_level){
+            	    osd_visible=sh_video->fps; // 1 sec
+	    	    vo_osd_progbar_type=OSD_BRIGHTNESS;
+            	    vo_osd_progbar_value=(v_bright)*10/4;
+		}
+#endif
+	}
+	break;
+
+    // Hue:
+    case '5':
+    case '6':
+        if(c=='6'){
+	    if ( v_hue++ > 100 ) v_hue = 100;
+        } else {
+    	    if ( v_hue-- < 0 ) v_hue = 0;	    
+        }
+	if(set_video_colors(sh_video,"Hue",v_hue)){
+#ifdef USE_OSD
+    		if(osd_level){
+            	    osd_visible=sh_video->fps; // 1 sec
+	    	    vo_osd_progbar_type=OSD_HUE;
+            	    vo_osd_progbar_value=(v_hue)*10/4;
+		}
+#endif
+	}
+	break;
+
+    // Saturation:
+    case '7':
+    case '8':
+        if(c=='8'){
+	    if ( v_saturation++ > 100 ) v_saturation = 100;
+        } else {
+    	    if ( v_saturation-- < 0 ) v_saturation = 0;	    
+        }
+	if(set_video_colors(sh_video,"Saturation",v_saturation)){
+#ifdef USE_OSD
+    		if(osd_level){
+            	    osd_visible=sh_video->fps; // 1 sec
+	    	    vo_osd_progbar_type=OSD_SATURATION;
+            	    vo_osd_progbar_value=(v_saturation)*10/4;
+		}
+#endif
+	}
+	break;
+
     case 'd':
       frame_dropping=(frame_dropping+1)%3;
       printf("== drop: %d ==  \n",frame_dropping);

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- dec_video.c	30 Jul 2001 02:00:54 -0000	1.14
+++ dec_video.c	1 Aug 2001 01:02:33 -0000	1.15
@@ -84,6 +84,58 @@
 }
 #endif
 
+int get_video_quality_max(sh_video_t *sh_video){
+ switch(sh_video->codec->driver){
+#ifdef USE_DIRECTSHOW
+  case VFM_DSHOW:
+      return 4;
+#endif
+#ifdef MPEG12_POSTPROC
+  case VFM_MPEG:
+#endif
+  case VFM_DIVX4:
+  case VFM_ODIVX:
+      return 6;
+ }
+ return 0;
+}
+
+void set_video_quality(sh_video_t *sh_video,int quality){
+ switch(sh_video->codec->driver){
+#ifdef ARCH_X86
+#ifdef USE_DIRECTSHOW
+  case VFM_DSHOW: {
+   if(quality<0 || quality>4) quality=4;
+   DS_SetValue_DivX("Quality",quality);
+  }
+  break;
+#endif
+#endif
+#ifdef MPEG12_POSTPROC
+  case VFM_MPEG: {
+   if(quality<0 || quality>6) quality=6;
+   picture->pp_options=(1<<quality)-1;
+  }
+  break;
+#endif
+  case VFM_DIVX4:
+  case VFM_ODIVX: {
+   DEC_SET dec_set;
+   if(quality<0 || quality>6) quality=6;
+   dec_set.postproc_level=(1<<quality)-1;
+   decore(0x123,DEC_OPT_SETPP,&dec_set,NULL);
+  }
+  break;
+ }
+}
+
+int set_video_colors(sh_video_t *sh_video,char *item,int value){
+    if(!strcmp(sh_video->codec->name,"divxds")){
+	DS_SetValue_DivX(item,value);
+	return 1;
+    }
+    return 0;
+}
 
 int init_video(sh_video_t *sh_video){
 unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx];




More information about the MPlayer-cvslog mailing list