FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions
v4l2_buffers.h File Reference
#include <stdatomic.h>
#include <linux/videodev2.h>
#include "avcodec.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

Enumerator
V4L2BUF_AVAILABLE 
V4L2BUF_IN_DRIVER 
V4L2BUF_RET_USER 

Definition at line 32 of file v4l2_buffers.h.

Function Documentation

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 cant be created.

Definition at line 304 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_dequeue_frame().

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 cant be created.

Definition at line 355 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_dequeue_packet().

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 380 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_enqueue_packet().

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 289 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_enqueue_frame().

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 396 of file v4l2_buffers.c.

Referenced by ff_v4l2_context_init().

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 465 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().