aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/grab.c
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2003-06-25 10:21:45 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2003-06-25 10:21:45 +0000
commite3ee328330e924e6524003a6e082934fddb87a44 (patch)
tree1737169dd2e55b799c854862ce012cf6433bfd48 /libavformat/grab.c
parent93caefc7d6608f109ae9ab16c2f6d5ae6c75cffd (diff)
downloadffmpeg-e3ee328330e924e6524003a6e082934fddb87a44.tar.gz
tv standard selection support for dv1394 and grab (v4l)
Originally committed as revision 1987 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/grab.c')
-rw-r--r--libavformat/grab.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/grab.c b/libavformat/grab.c
index 3a99704520..cd4b8fe908 100644
--- a/libavformat/grab.c
+++ b/libavformat/grab.c
@@ -62,6 +62,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
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 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
} 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;