# HG changeset patch # User al3x # Date 1056536505 0 # Node ID 7d698c3213a0356d05b9d0fa4a48a2479e8df659 # Parent 700b69d00b271d56e245164047403b9536f50fe3 tv standard selection support for dv1394 and grab (v4l) diff -r 700b69d00b27 -r 7d698c3213a0 avformat.h --- a/avformat.h Fri Jun 20 18:21:58 2003 +0000 +++ b/avformat.h Wed Jun 25 10:21:45 2003 +0000 @@ -86,6 +86,7 @@ struct AVImageFormat *image_format; int channel; /* used to select dv channel */ const char *device; /* video4linux, audio or DV device */ + const char *standard; /* tv standard, NTSC, PAL, SECAM */ } AVFormatParameters; #define AVFMT_NOFILE 0x0001 /* no file should be opened */ diff -r 700b69d00b27 -r 7d698c3213a0 dv1394.c --- a/dv1394.c Fri Jun 20 18:21:58 2003 +0000 +++ b/dv1394.c Wed Jun 25 10:21:45 2003 +0000 @@ -91,8 +91,10 @@ return -ENOMEM; } - /* FIXME: Need a format change parameter */ - dv->format = DV1394_NTSC; + if (ap->standard && !strcasecmp(ap->standard, "pal")) + dv->format = DV1394_PAL; + else + dv->format = DV1394_NTSC; if (ap->channel) dv->channel = ap->channel; diff -r 700b69d00b27 -r 7d698c3213a0 grab.c --- 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;