33 #if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
34 # include <dev/bktr/ioctl_meteor.h>
35 # include <dev/bktr/ioctl_bt848.h>
36 #elif HAVE_MACHINE_IOCTL_METEOR_H && HAVE_MACHINE_IOCTL_BT848_H
37 # include <machine/ioctl_meteor.h>
38 # include <machine/ioctl_bt848.h>
39 #elif HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H && HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H
40 # include <dev/video/meteor/ioctl_meteor.h>
41 # include <dev/video/bktr/ioctl_bt848.h>
42 #elif HAVE_DEV_IC_BT8XX_H
43 # include <dev/ic/bt8xx.h>
47 #include <sys/ioctl.h>
75 #define PAL_HEIGHT 576
76 #define SECAM_HEIGHT 576
77 #define NTSC_HEIGHT 480
80 #define VIDEO_FORMAT NTSC
83 static const int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
84 METEOR_DEV3, METEOR_DEV_SVIDEO };
99 int format,
int *video_fd,
int *tuner_fd,
int idev,
double frequency)
101 struct meteor_geomet geo;
103 long ioctl_frequency;
106 struct sigaction act = { {0} }, old;
110 if (idev < 0 || idev > 4)
112 arg = getenv (
"BKTR_DEV");
115 if (idev < 0 || idev > 4)
119 if (format < 1 || format > 6)
121 arg = getenv (
"BKTR_FORMAT");
124 if (format < 1 || format > 6)
130 arg = getenv (
"BKTR_FREQUENCY");
132 frequency = atof (arg);
137 sigemptyset(&act.sa_mask);
139 sigaction(SIGUSR1, &act, &old);
156 geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12;
159 case PAL: h_max =
PAL_HEIGHT; c = BT848_IFORM_F_PALBDGHI;
break;
165 default: h_max =
PAL_HEIGHT; c = BT848_IFORM_F_PALBDGHI;
break;
168 if (height <= h_max / 2)
169 geo.oformat |= METEOR_GEO_EVEN_ONLY;
171 if (ioctl(*video_fd, METEORSETGEO, &geo) < 0) {
178 if (ioctl(*video_fd, BT848SFMT, &c) < 0) {
186 if (ioctl(*video_fd, METEORSINPUT, &c) < 0) {
196 PROT_READ, MAP_SHARED, *video_fd, (off_t)0);
204 if (frequency != 0.0) {
205 ioctl_frequency = (
unsigned long)(frequency*16);
206 if (ioctl(*tuner_fd, TVTUNER_SETFREQ, &ioctl_frequency) < 0)
211 if (ioctl(*tuner_fd, BT848_SAUDIO, &c) < 0)
214 c = METEOR_CAP_CONTINOUS;
215 ioctl(*video_fd, METEORCAPTUR, &c);
218 ioctl(*video_fd, METEORSSIGNAL, &c);
233 "SLEPT NO signals - %d microseconds late\n",
316 c = METEOR_CAP_STOP_CONT;
317 ioctl(s->
video_fd, METEORCAPTUR, &c);
321 ioctl(s->
tuner_fd, BT848_SAUDIO, &c);
329 #define OFFSET(x) offsetof(VideoData, x)
330 #define DEC AV_OPT_FLAG_DECODING_PARAM
332 {
"standard",
"", offsetof(
VideoData, standard),
AV_OPT_TYPE_INT, {.i64 =
VIDEO_FORMAT},
PAL,
NTSCJ,
AV_OPT_FLAG_DECODING_PARAM,
"standard" },
360 .priv_class = &bktr_class,