34 #if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
35 # include <dev/bktr/ioctl_meteor.h>
36 # include <dev/bktr/ioctl_bt848.h>
37 #elif HAVE_MACHINE_IOCTL_METEOR_H && HAVE_MACHINE_IOCTL_BT848_H
38 # include <machine/ioctl_meteor.h>
39 # include <machine/ioctl_bt848.h>
40 #elif HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H && HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H
41 # include <dev/video/meteor/ioctl_meteor.h>
42 # include <dev/video/bktr/ioctl_bt848.h>
43 #elif HAVE_DEV_IC_BT8XX_H
44 # include <dev/ic/bt8xx.h>
48 #include <sys/ioctl.h>
76 #define PAL_HEIGHT 576
77 #define SECAM_HEIGHT 576
78 #define NTSC_HEIGHT 480
81 #define VIDEO_FORMAT NTSC
84 static int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
85 METEOR_DEV3, METEOR_DEV_SVIDEO };
100 int format,
int *video_fd,
int *tuner_fd,
int idev,
double frequency)
102 struct meteor_geomet geo;
104 long ioctl_frequency;
107 struct sigaction act = { 0 }, old;
109 if (idev < 0 || idev > 4)
111 arg = getenv (
"BKTR_DEV");
114 if (idev < 0 || idev > 4)
118 if (format < 1 || format > 6)
120 arg = getenv (
"BKTR_FORMAT");
123 if (format < 1 || format > 6)
129 arg = getenv (
"BKTR_FREQUENCY");
131 frequency = atof (arg);
136 sigemptyset(&act.sa_mask);
138 sigaction(SIGUSR1, &act, &old);
153 geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12;
156 case PAL: h_max =
PAL_HEIGHT; c = BT848_IFORM_F_PALBDGHI;
break;
162 default: h_max =
PAL_HEIGHT; c = BT848_IFORM_F_PALBDGHI;
break;
165 if (height <= h_max / 2)
166 geo.oformat |= METEOR_GEO_EVEN_ONLY;
168 if (ioctl(*video_fd, METEORSETGEO, &geo) < 0) {
173 if (ioctl(*video_fd, BT848SFMT, &c) < 0) {
179 if (ioctl(*video_fd, METEORSINPUT, &c) < 0) {
187 PROT_READ, MAP_SHARED, *video_fd, (off_t)0);
193 if (frequency != 0.0) {
194 ioctl_frequency = (
unsigned long)(frequency*16);
195 if (ioctl(*tuner_fd, TVTUNER_SETFREQ, &ioctl_frequency) < 0)
200 if (ioctl(*tuner_fd, BT848_SAUDIO, &c) < 0)
203 c = METEOR_CAP_CONTINOUS;
204 ioctl(*video_fd, METEORCAPTUR, &c);
207 ioctl(*video_fd, METEORSSIGNAL, &c);
222 "SLEPT NO signals - %d microseconds late\n",
313 c = METEOR_CAP_STOP_CONT;
314 ioctl(s->
video_fd, METEORCAPTUR, &c);
318 ioctl(s->
tuner_fd, BT848_SAUDIO, &c);
326 #define OFFSET(x) offsetof(VideoData, x)
327 #define DEC AV_OPT_FLAG_DECODING_PARAM
329 {
"standard",
"", offsetof(
VideoData, standard),
AV_OPT_TYPE_INT, {.i64 =
VIDEO_FORMAT},
PAL,
NTSCJ,
AV_OPT_FLAG_DECODING_PARAM,
"standard" },
356 .priv_class = &bktr_class,