FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
bktr.c File Reference
#include "libavformat/internal.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/time.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <signal.h>
#include <stdint.h>
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  VideoData
 

Macros

#define PAL   1
 
#define PALBDGHI   1
 
#define NTSC   2
 
#define NTSCM   2
 
#define SECAM   3
 
#define PALN   4
 
#define PALM   5
 
#define NTSCJ   6
 
#define PAL_HEIGHT   576
 
#define SECAM_HEIGHT   576
 
#define NTSC_HEIGHT   480
 
#define VIDEO_FORMAT   NTSC
 
#define OFFSET(x)   offsetof(VideoData, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static void catchsignal (int signal)
 
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 void bktr_getframe (uint64_t per_frame)
 
static int grab_read_packet (AVFormatContext *s1, AVPacket *pkt)
 
static int grab_read_header (AVFormatContext *s1)
 
static int grab_read_close (AVFormatContext *s1)
 

Variables

static const int bktr_dev []
 
uint8_tvideo_buf
 
size_t video_buf_size
 
uint64_t last_frame_time
 
volatile sig_atomic_t nsignals
 
static const AVOption options []
 
static const AVClass bktr_class
 
AVInputFormat ff_bktr_demuxer
 

Macro Definition Documentation

#define PAL   1

Definition at line 65 of file bktr.c.

Referenced by bktr_init(), ffprobe_show_pixel_formats(), grab_read_header(), and opt_target().

#define PALBDGHI   1

Definition at line 66 of file bktr.c.

#define NTSC   2

Definition at line 67 of file bktr.c.

Referenced by bktr_init(), grab_read_header(), and opt_target().

#define NTSCM   2

Definition at line 68 of file bktr.c.

#define SECAM   3

Definition at line 69 of file bktr.c.

Referenced by bktr_init(), and grab_read_header().

#define PALN   4

Definition at line 70 of file bktr.c.

Referenced by bktr_init().

#define PALM   5

Definition at line 71 of file bktr.c.

Referenced by bktr_init().

#define NTSCJ   6

Definition at line 72 of file bktr.c.

Referenced by bktr_init().

#define PAL_HEIGHT   576

Definition at line 75 of file bktr.c.

Referenced by bktr_init().

#define SECAM_HEIGHT   576

Definition at line 76 of file bktr.c.

Referenced by bktr_init().

#define NTSC_HEIGHT   480

Definition at line 77 of file bktr.c.

Referenced by bktr_init().

#define VIDEO_FORMAT   NTSC

Definition at line 80 of file bktr.c.

Referenced by bktr_init().

#define OFFSET (   x)    offsetof(VideoData, x)

Definition at line 329 of file bktr.c.

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 330 of file bktr.c.

Function Documentation

static void catchsignal ( int  signal)
static

Definition at line 92 of file bktr.c.

Referenced by bktr_init().

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

Definition at line 98 of file bktr.c.

Referenced by grab_read_header().

static void bktr_getframe ( uint64_t  per_frame)
static

Definition at line 223 of file bktr.c.

Referenced by grab_read_packet().

static int grab_read_packet ( AVFormatContext s1,
AVPacket pkt 
)
static

Definition at line 243 of file bktr.c.

static int grab_read_header ( AVFormatContext s1)
static

Definition at line 258 of file bktr.c.

static int grab_read_close ( AVFormatContext s1)
static

Definition at line 311 of file bktr.c.

Variable Documentation

const int bktr_dev[]
static
Initial value:
= { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
METEOR_DEV3, METEOR_DEV_SVIDEO }

Definition at line 83 of file bktr.c.

Referenced by bktr_init().

uint8_t* video_buf

Definition at line 86 of file bktr.c.

Referenced by bktr_init(), grab_read_close(), and grab_read_packet().

size_t video_buf_size

Definition at line 87 of file bktr.c.

Referenced by bktr_init(), grab_read_close(), and grab_read_packet().

uint64_t last_frame_time

Definition at line 88 of file bktr.c.

Referenced by bktr_getframe(), and grab_read_header().

volatile sig_atomic_t nsignals

Definition at line 89 of file bktr.c.

Referenced by bktr_getframe(), catchsignal(), and grab_read_header().

const AVOption options[]
static
Initial value:
= {
{ "standard", "", 0x42, AV_OPT_TYPE_INT, {.i64 = VIDEO_FORMAT}, PAL, NTSCJ, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PAL", "", 0, AV_OPT_TYPE_CONST, {.i64 = PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "NTSC", "", 0, AV_OPT_TYPE_CONST, {.i64 = NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "SECAM", "", 0, AV_OPT_TYPE_CONST, {.i64 = SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PALN", "", 0, AV_OPT_TYPE_CONST, {.i64 = PALN}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PALM", "", 0, AV_OPT_TYPE_CONST, {.i64 = PALM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "NTSCJ", "", 0, AV_OPT_TYPE_CONST, {.i64 = NTSCJ}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = "vga"}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define DEC
Definition: bktr.c:330
#define SECAM
Definition: bktr.c:69
#define NTSC
Definition: bktr.c:67
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:286
offset must point to two consecutive integers
Definition: opt.h:232
#define PALN
Definition: bktr.c:70
#define VIDEO_FORMAT
Definition: bktr.c:80
#define OFFSET(x)
Definition: bktr.c:329
#define PALM
Definition: bktr.c:71
#define NTSCJ
Definition: bktr.c:72
#define PAL
Definition: bktr.c:65
static int width

Definition at line 331 of file bktr.c.

const AVClass bktr_class
static
Initial value:
= {
.class_name = "BKTR grab interface",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
av_default_item_name
static const AVOption options[]
Definition: bktr.c:331

Definition at line 344 of file bktr.c.

AVInputFormat ff_bktr_demuxer
Initial value:
= {
.name = "bktr",
.long_name = NULL_IF_CONFIG_SMALL("video grab"),
.priv_data_size = sizeof(VideoData),
.priv_class = &bktr_class,
}
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
static const AVClass bktr_class
Definition: bktr.c:344
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
Definition: bktr.c:54
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:620
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
Definition: bktr.c:243
static int grab_read_header(AVFormatContext *s1)
Definition: bktr.c:258
static int flags
Definition: cpu.c:47
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:465
static int grab_read_close(AVFormatContext *s1)
Definition: bktr.c:311

Definition at line 352 of file bktr.c.