FFmpeg
Data Structures | Enumerations | Functions
v4l2_buffers.h File Reference
#include <stdatomic.h>
#include <stddef.h>
#include <linux/videodev2.h>
#include "libavutil/frame.h"
#include "packet.h"

Go to the source code of this file.

Data Structures

struct  V4L2Buffer
 V4L2Buffer (wrapper for v4l2_buffer management) More...
 
struct  V4L2Buffer::V4L2Plane_info
 

Enumerations

enum  V4L2Buffer_status { V4L2BUF_AVAILABLE, V4L2BUF_IN_DRIVER, V4L2BUF_RET_USER }
 

Functions

int ff_v4l2_buffer_buf_to_avframe (AVFrame *frame, V4L2Buffer *buf)
 Extracts the data from a V4L2Buffer to an AVFrame. More...
 
int ff_v4l2_buffer_buf_to_avpkt (AVPacket *pkt, V4L2Buffer *buf)
 Extracts the data from a V4L2Buffer to an AVPacket. More...
 
int ff_v4l2_buffer_avpkt_to_buf (const AVPacket *pkt, V4L2Buffer *out)
 Extracts the data from an AVPacket to a V4L2Buffer. More...
 
int ff_v4l2_buffer_avframe_to_buf (const AVFrame *frame, V4L2Buffer *out)
 Extracts the data from an AVFrame to a V4L2Buffer. More...
 
int ff_v4l2_buffer_initialize (V4L2Buffer *avbuf, int index)
 Initializes a V4L2Buffer. More...
 
int ff_v4l2_buffer_enqueue (V4L2Buffer *avbuf)
 Enqueues a V4L2Buffer. More...
 

Enumeration Type Documentation

◆ V4L2Buffer_status

Enumerator
V4L2BUF_AVAILABLE 
V4L2BUF_IN_DRIVER 
V4L2BUF_RET_USER 

Definition at line 34 of file v4l2_buffers.h.

Function Documentation

◆ ff_v4l2_buffer_buf_to_avframe()

int ff_v4l2_buffer_buf_to_avframe ( AVFrame frame,
V4L2Buffer buf 
)

Extracts the data from a V4L2Buffer to an AVFrame.

Parameters
[in]frameThe AVFRame to push the information to
[in]bufThe V4L2Buffer to get the information from
Returns
0 in case of success, AVERROR(EINVAL) if the number of planes is incorrect, AVERROR(ENOMEM) if the AVBufferRef can't be created.

Definition at line 417 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_dequeue_frame().

◆ ff_v4l2_buffer_buf_to_avpkt()

int ff_v4l2_buffer_buf_to_avpkt ( AVPacket pkt,
V4L2Buffer buf 
)

Extracts the data from a V4L2Buffer to an AVPacket.

Parameters
[in]pktThe AVPacket to push the information to
[in]bufThe V4L2Buffer to get the information from
Returns
0 in case of success, AVERROR(EINVAL) if the number of planes is incorrect, AVERROR(ENOMEM) if the AVBufferRef can't be created.

Definition at line 452 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_dequeue_packet().

◆ ff_v4l2_buffer_avpkt_to_buf()

int ff_v4l2_buffer_avpkt_to_buf ( const AVPacket pkt,
V4L2Buffer out 
)

Extracts the data from an AVPacket to a V4L2Buffer.

Parameters
[in]frameAVPacket to get the data from
[in]avbufV4L2Bfuffer to push the information to
Returns
0 in case of success, a negative AVERROR code otherwise

Definition at line 477 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_enqueue_packet().

◆ ff_v4l2_buffer_avframe_to_buf()

int ff_v4l2_buffer_avframe_to_buf ( const AVFrame frame,
V4L2Buffer out 
)

Extracts the data from an AVFrame to a V4L2Buffer.

Parameters
[in]frameAVFrame to get the data from
[in]avbufV4L2Bfuffer to push the information to
Returns
0 in case of success, a negative AVERROR code otherwise

Definition at line 410 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_enqueue_frame().

◆ ff_v4l2_buffer_initialize()

int ff_v4l2_buffer_initialize ( V4L2Buffer avbuf,
int  index 
)

Initializes a V4L2Buffer.

Parameters
[in]avbufV4L2Bfuffer to initialize
[in]indexv4l2 buffer id
Returns
0 in case of success, a negative AVERROR code otherwise

Definition at line 493 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_init().

◆ ff_v4l2_buffer_enqueue()

int ff_v4l2_buffer_enqueue ( V4L2Buffer avbuf)

Enqueues a V4L2Buffer.

Parameters
[in]avbufV4L2Bfuffer to push to the driver
Returns
0 in case of success, a negative AVERROR code otherwise

Definition at line 560 of file v4l2_buffers.c.

Referenced by ff_v4l2_buffer_initialize(), ff_v4l2_context_enqueue_frame(), ff_v4l2_context_enqueue_packet(), and v4l2_free_buffer().