24 #ifndef AVCODEC_V4L2_CONTEXT_H
25 #define AVCODEC_V4L2_CONTEXT_H
27 #include <stdatomic.h>
28 #include <linux/videodev2.h>
47 enum v4l2_buf_type
type;
static int probe(const AVProbeData *p)
Libavcodec external API header.
refcounted data buffer API
reference-counted frame API
AVCodecID
Identify the syntax and semantics of the bitstream.
AVPixelFormat
Pixel format.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
Rational number (pair of numerator and denominator).
V4L2Buffer (wrapper for v4l2_buffer management)
AVRational sample_aspect_ratio
enum AVPixelFormat av_pix_fmt
AVPixelFormat corresponding to this buffer context.
enum v4l2_buf_type type
Type of this buffer context.
int width
Width and height of the frames it produces (in case of a capture context, e.g.
const char * name
context name.
struct v4l2_format format
Format returned by the driver after initializing the buffer context.
enum AVCodecID av_codec_id
AVCodecID corresponding to this buffer context.
int done
Either no more buffers available or an unrecoverable error was notified by the V4L2 kernel driver: on...
int num_buffers
Readonly after init.
V4L2Buffer * buffers
Indexed array of V4L2Buffers.
int streamon
Whether the stream has been started (VIDIOC_STREAMON has been sent).
void ff_v4l2_context_release(V4L2Context *ctx)
Releases a V4L2Context.
int ff_v4l2_context_dequeue_frame(V4L2Context *ctx, AVFrame *f, int timeout)
Dequeues a buffer from a V4L2Context to an AVFrame.
int ff_v4l2_context_get_format(V4L2Context *ctx, int probe)
Queries the driver for a valid v4l2 format and copies it to the context.
int ff_v4l2_context_enqueue_frame(V4L2Context *ctx, const AVFrame *f)
Enqueues a buffer to a V4L2Context from an AVFrame.
int ff_v4l2_context_set_status(V4L2Context *ctx, uint32_t cmd)
Sets the status of a V4L2Context.
int ff_v4l2_context_enqueue_packet(V4L2Context *ctx, const AVPacket *pkt)
Enqueues a buffer to a V4L2Context from an AVPacket.
int ff_v4l2_context_dequeue_packet(V4L2Context *ctx, AVPacket *pkt)
Dequeues a buffer from a V4L2Context to an AVPacket.
int ff_v4l2_context_set_format(V4L2Context *ctx)
Sets the V4L2Context format in the v4l2 driver.
int ff_v4l2_context_init(V4L2Context *ctx)
Initializes a V4L2Context.