diff grab.c @ 159:7d698c3213a0 libavformat

tv standard selection support for dv1394 and grab (v4l)
author al3x
date Wed, 25 Jun 2003 10:21:45 +0000
parents 25062c9b1f86
children ee98d63dbba7
line wrap: on
line diff
--- a/grab.c	Fri Jun 20 18:21:58 2003 +0000
+++ b/grab.c	Wed Jun 25 10:21:45 2003 +0000
@@ -62,6 +62,7 @@
     int video_fd, frame_size;
     int ret, frame_rate, frame_rate_base;
     int desired_palette;
+    struct video_tuner tuner;
     struct video_audio audio;
     const char *video_device;
 
@@ -109,6 +110,17 @@
     } else if (st->codec.pix_fmt == PIX_FMT_BGR24) {
         desired_palette = VIDEO_PALETTE_RGB24;
     }    
+
+    /* set tv standard */
+    if (ap->standard && !ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
+	if (!strcasecmp(ap->standard, "pal"))
+	    tuner.mode = VIDEO_MODE_PAL;
+	else if (!strcasecmp(ap->standard, "secam"))
+	    tuner.mode = VIDEO_MODE_SECAM;
+	else
+	    tuner.mode = VIDEO_MODE_NTSC;
+	ioctl(video_fd, VIDIOCSTUNER, &tuner);
+    }
     
     /* unmute audio */
     audio.audio = 0;