31 int res = 0,
flags = O_RDWR;
32 struct v4l2_format fmt = {
33 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT
53 "V4L2 output device supports only a single raw video stream\n");
66 if (ioctl(s->
fd, VIDIOC_G_FMT, &fmt) < 0) {
72 fmt.fmt.pix.width = par->
width;
73 fmt.fmt.pix.height = par->
height;
74 fmt.fmt.pix.pixelformat = v4l2_pixfmt;
77 if (ioctl(s->
fd, VIDIOC_S_FMT, &fmt) < 0) {
118 .priv_class = &v4l2_class,
#define LIBAVUTIL_VERSION_INT
static const AVClass v4l2_class
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
This struct describes the properties of an encoded stream.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVStream ** streams
A list of all streams in the file.
int flags
Flags modifying the (de)muxer behaviour.
static av_cold int write_header(AVFormatContext *s1)
Main libavdevice API header.
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
AVOutputFormat ff_v4l2_muxer
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
char filename[1024]
input or output filename
static int write_trailer(AVFormatContext *s1)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Describe the class of an AVClass context structure.
void * priv_data
Format private data.
AVCodecParameters * codecpar
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)