FFmpeg
Classes | Macros | Variables
v4l2.c File Reference

Video4Linux2 grab interface. More...

#include <stdatomic.h>
#include "v4l2-common.h"
#include <dirent.h>

Classes

struct  video_data
 
struct  buff_data
 

Macros

#define V4L_ALLFORMATS   3
 
#define V4L_RAWFORMATS   1
 
#define V4L_COMPFORMATS   2
 
#define V4L_TS_DEFAULT   0
 Return timestamps to the user exactly as returned by the kernel.
 
#define V4L_TS_ABS   1
 Autodetect the kind of timestamps returned by the kernel and convert to absolute (wall clock) timestamps.
 
#define V4L_TS_MONO2ABS   2
 Assume kernel timestamps are from the monotonic clock and convert to absolute timestamps.
 
#define V4L_TS_CONVERT_READY   V4L_TS_DEFAULT
 Once the kind of timestamps returned by the kernel have been detected, the value of the timefilter (NULL or not) determines whether a conversion takes place.
 
#define SET_WRAPPERS(prefix)
 
#define v4l2_open   s->open_f
 
#define v4l2_close   s->close_f
 
#define v4l2_dup   s->dup_f
 
#define v4l2_ioctl   s->ioctl_f
 
#define v4l2_read   s->read_f
 
#define v4l2_mmap   s->mmap_f
 
#define v4l2_munmap   s->munmap_f
 
#define OFFSET(x)   offsetof(struct video_data, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Variables

AVInputFormat ff_v4l2_demuxer
 

Detailed Description

Video4Linux2 grab interface.

Part of this file is based on the V4L2 video capture example (http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html)

Thanks to Michael Niedermayer for providing the mapping between V4L2_PIX_FMT_* and AV_PIX_FMT_*

Macro Definition Documentation

§ SET_WRAPPERS

#define SET_WRAPPERS (   prefix)
Value:
do { \
s->open_f = prefix ## open; \
s->close_f = prefix ## close; \
s->dup_f = prefix ## dup; \
s->ioctl_f = prefix ## ioctl; \
s->read_f = prefix ## read; \
s->mmap_f = prefix ## mmap; \
s->munmap_f = prefix ## munmap; \
} while (0)

Variable Documentation

§ ff_v4l2_demuxer

AVInputFormat ff_v4l2_demuxer
Initial value:
= {
.name = "video4linux2,v4l2",
.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
.priv_data_size = sizeof(struct video_data),
.read_probe = v4l2_read_probe,
.read_header = v4l2_read_header,
.read_packet = v4l2_read_packet,
.read_close = v4l2_read_close,
.get_device_list = v4l2_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &v4l2_class,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
Definition: v4l2.c:70
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:465