[Mplayer-cvslog] CVS: main/libmpdemux tv.c,1.4,1.5 tv.h,1.2,1.3

Alex Beregszaszi alex at mplayer.dev.hu
Sun Nov 11 03:54:53 CET 2001


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

Modified Files:
	tv.c tv.h 
Log Message:
added support for -tv outfmt

Index: tv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tv.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- tv.c	11 Nov 2001 02:04:41 -0000	1.4
+++ tv.c	11 Nov 2001 02:54:50 -0000	1.5
@@ -31,6 +31,7 @@
 int tv_param_width = -1;
 int tv_param_height = -1;
 int tv_param_input = 0; /* used in v4l and bttv */
+char *tv_param_outfmt = "yv12";
 
 
 /* ================== DEMUX_TV ===================== */
@@ -95,8 +96,24 @@
     
     sh_video = new_sh_video(demuxer, 0);
 
-    /* hack to use YUV 4:2:0 format ;) */
-    sh_video->format = IMGFMT_UYVY;
+    if (!strcasecmp(tv_param_outfmt, "yv12"))
+	sh_video->format = IMGFMT_YV12;
+    else if (!strcasecmp(tv_param_outfmt, "uyvy"))
+	sh_video->format = IMGFMT_UYVY;
+    else if (!strcasecmp(tv_param_outfmt, "rgb32"))
+	sh_video->format = IMGFMT_RGB32;
+    else if (!strcasecmp(tv_param_outfmt, "rgb24"))
+	sh_video->format = IMGFMT_RGB24;
+    else if (!strcasecmp(tv_param_outfmt, "rgb16"))
+	sh_video->format = IMGFMT_RGB16;
+    else if (!strcasecmp(tv_param_outfmt, "rgb15"))
+	sh_video->format = IMGFMT_RGB15;
+    else
+    {
+	printf("Unknown format given: %s\n", tv_param_outfmt);
+	printf("Using default: Planar YV12\n");
+	sh_video->format = IMGFMT_YV12;
+    }
     funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &sh_video->format);
 
     /* get IMGFMT_ */
@@ -185,7 +202,7 @@
 	    case AFMT_MPEG:
 	    case AFMT_AC3:
 	    default:
-		printf("%s unsupported!\n", audio_out_format_name(audio_format));
+//		printf("%s unsupported!\n", audio_out_format_name(audio_format));
 		goto no_audio;
 	}
 	

Index: tv.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/tv.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- tv.h	10 Nov 2001 23:31:08 -0000	1.2
+++ tv.h	11 Nov 2001 02:54:50 -0000	1.3
@@ -3,6 +3,7 @@
 #ifdef USE_TV
 #include "../libao2/afmt.h"
 #include "../libvo/img_format.h"
+#include "../libvo/fastmemcpy.h"
 
 extern unsigned long tv_param_freq;
 extern char *tv_param_channel;
@@ -13,6 +14,7 @@
 extern int tv_param_width;
 extern int tv_param_height;
 extern int tv_param_input;
+extern char *tv_param_outfmt;
 
 typedef struct tvi_info_s
 {




More information about the MPlayer-cvslog mailing list