Go to the documentation of this file.
36 #if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
37 # include <dev/bktr/ioctl_meteor.h>
38 # include <dev/bktr/ioctl_bt848.h>
39 #elif HAVE_MACHINE_IOCTL_METEOR_H && HAVE_MACHINE_IOCTL_BT848_H
40 # include <machine/ioctl_meteor.h>
41 # include <machine/ioctl_bt848.h>
42 #elif HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H && HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H
43 # include <dev/video/meteor/ioctl_meteor.h>
44 # include <dev/video/bktr/ioctl_bt848.h>
45 #elif HAVE_DEV_IC_BT8XX_H
46 # include <dev/ic/bt8xx.h>
50 #include <sys/ioctl.h>
78 #define PAL_HEIGHT 576
79 #define SECAM_HEIGHT 576
80 #define NTSC_HEIGHT 480
83 #define VIDEO_FORMAT NTSC
86 static const int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
87 METEOR_DEV3, METEOR_DEV_SVIDEO };
102 int format,
int *video_fd,
int *tuner_fd,
int idev,
double frequency)
104 struct meteor_geomet geo;
106 long ioctl_frequency;
109 struct sigaction act, old;
113 if (idev < 0 || idev > 4)
115 arg = getenv (
"BKTR_DEV");
118 if (idev < 0 || idev > 4)
122 if (format < 1 || format > 6)
124 arg = getenv (
"BKTR_FORMAT");
127 if (format < 1 || format > 6)
133 arg = getenv (
"BKTR_FREQUENCY");
135 frequency = atof (
arg);
140 memset(&act, 0,
sizeof(act));
141 sigemptyset(&act.sa_mask);
143 sigaction(SIGUSR1, &act, &old);
160 geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12;
169 default: h_max =
PAL_HEIGHT;
c = BT848_IFORM_F_PALBDGHI;
break;
173 geo.oformat |= METEOR_GEO_EVEN_ONLY;
175 if (ioctl(*video_fd, METEORSETGEO, &geo) < 0) {
182 if (ioctl(*video_fd, BT848SFMT, &
c) < 0) {
190 if (ioctl(*video_fd, METEORSINPUT, &
c) < 0) {
200 PROT_READ, MAP_SHARED, *video_fd, (off_t)0);
208 if (frequency != 0.0) {
209 ioctl_frequency = (
unsigned long)(frequency*16);
210 if (ioctl(*tuner_fd, TVTUNER_SETFREQ, &ioctl_frequency) < 0)
215 if (ioctl(*tuner_fd, BT848_SAUDIO, &
c) < 0)
218 c = METEOR_CAP_CONTINOUS;
219 ioctl(*video_fd, METEORCAPTUR, &
c);
222 ioctl(*video_fd, METEORSSIGNAL, &
c);
237 "SLEPT NO signals - %d microseconds late\n",
270 "Please contact the developers if you are interested in maintaining it.\n");
273 switch (
s->standard) {
304 &
s->video_fd, &
s->tuner_fd, -1, 0.0) < 0) {
321 c = METEOR_CAP_STOP_CONT;
322 ioctl(
s->video_fd, METEORCAPTUR, &
c);
326 ioctl(
s->tuner_fd, BT848_SAUDIO, &
c);
334 #define OFFSET(x) offsetof(VideoData, x)
335 #define DEC AV_OPT_FLAG_DECODING_PARAM
337 {
"standard",
"", offsetof(
VideoData, standard),
AV_OPT_TYPE_INT, {.i64 =
VIDEO_FORMAT},
PAL,
NTSCJ,
AV_OPT_FLAG_DECODING_PARAM, .unit =
"standard" },
static const AVClass bktr_class
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
#define AV_LOG_WARNING
Something somehow does not look correct.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
static const AVOption options[]
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AVRational avg_frame_rate
Average framerate.
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
static av_cold int bktr_init(const char *video_device, int width, int height, int format, int *video_fd, int *tuner_fd, int idev, double frequency)
static av_cold int read_close(AVFormatContext *ctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static const int bktr_dev[]
static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
static int read_header(FFV1Context *f)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static int grab_read_header(AVFormatContext *s1)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
char * url
input or output URL.
#define AV_LOG_INFO
Standard information.
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
char * framerate
Set by a private option.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static void bktr_getframe(uint64_t per_frame)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
@ AV_OPT_TYPE_INT
Underlying C type is int.
static void catchsignal(int signal)
int64_t av_gettime(void)
Get the current time in microseconds.
const FFInputFormat ff_bktr_demuxer
char * av_strdup(const char *s)
Duplicate a string.
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
static int grab_read_close(AVFormatContext *s1)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
volatile sig_atomic_t nsignals
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
void * priv_data
Format private data.