FFmpeg
Data Structures | Functions
v4l2_context.h File Reference
#include <stdint.h>
#include <linux/videodev2.h>
#include "libavutil/pixfmt.h"
#include "libavutil/frame.h"
#include "libavutil/rational.h"
#include "codec_id.h"
#include "packet.h"
#include "v4l2_buffers.h"

Go to the source code of this file.

Data Structures

struct   V4L2Context
 

Functions

  Initializes a V4L2Context. More...
 
  Sets the V4L2Context format in the v4l2 driver. More...
 
  Queries the driver for a valid v4l2 format and copies it to the context. More...
 
  Releases a V4L2Context. More...
 
  Sets the status of a V4L2Context. More...
 
  Dequeues a buffer from a V4L2Context to an AVPacket. More...
 
  Dequeues a buffer from a V4L2Context to an AVFrame. More...
 
  Enqueues a buffer to a V4L2Context from an AVPacket. More...
 
  Enqueues a buffer to a V4L2Context from an AVFrame. More...
 

Function Documentation

ff_v4l2_context_init()

int ff_v4l2_context_init ( V4L2Contextctx )

Initializes a V4L2Context.

Parameters
[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables.
Returns
0 in case of success, a negative value representing the error otherwise.

Definition at line 717 of file v4l2_context.c.

Referenced by ff_v4l2_m2m_codec_full_reinit(), v4l2_configure_contexts(), and v4l2_try_start().

ff_v4l2_context_set_format()

int ff_v4l2_context_set_format ( V4L2Contextctx )

Sets the V4L2Context format in the v4l2 driver.

Parameters
[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables.
Returns
0 in case of success, a negative value representing the error otherwise.

Definition at line 698 of file v4l2_context.c.

Referenced by ff_v4l2_m2m_codec_full_reinit(), ff_v4l2_m2m_codec_reinit(), and v4l2_configure_contexts().

ff_v4l2_context_get_format()

int ff_v4l2_context_get_format ( V4L2Contextctx,
int  probe 
)

Queries the driver for a valid v4l2 format and copies it to the context.

Parameters
[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables.
[in] probe Probe only and ignore changes to the format.
Returns
0 in case of success, a negative value representing the error otherwise.

Definition at line 671 of file v4l2_context.c.

Referenced by ff_v4l2_m2m_codec_full_reinit(), ff_v4l2_m2m_codec_reinit(), and v4l2_probe_driver().

ff_v4l2_context_release()

void ff_v4l2_context_release ( V4L2Contextctx )

Releases a V4L2Context.

Parameters
[in] ctx A pointer to a V4L2Context. The caller is reponsible for freeing it. It must not be used after calling this function.

Definition at line 703 of file v4l2_context.c.

Referenced by ff_v4l2_m2m_codec_end(), ff_v4l2_m2m_codec_full_reinit(), ff_v4l2_m2m_codec_reinit(), and v4l2_m2m_destroy_context().

ff_v4l2_context_set_status()

int ff_v4l2_context_set_status ( V4L2Contextctx,
uint32_t  cmd 
)

Sets the status of a V4L2Context.

Parameters
[in] ctx A pointer to a V4L2Context.
[in] cmd The status to set (VIDIOC_STREAMON or VIDIOC_STREAMOFF). Warning: If VIDIOC_STREAMOFF is sent to a buffer context that still has some frames buffered, those frames will be dropped.
Returns
0 in case of success, a negative value representing the error otherwise.

Definition at line 567 of file v4l2_context.c.

Referenced by ff_v4l2_m2m_codec_end(), ff_v4l2_m2m_codec_full_reinit(), ff_v4l2_m2m_codec_reinit(), v4l2_receive_packet(), v4l2_stop_decode(), v4l2_stop_encode(), and v4l2_try_start().

ff_v4l2_context_dequeue_packet()

int ff_v4l2_context_dequeue_packet ( V4L2Contextctx,
AVPacketpkt 
)

Dequeues a buffer from a V4L2Context to an AVPacket.

The pkt must be non NULL.

Parameters
[in] ctx The V4L2Context to dequeue from.
[in,out] pkt The AVPacket to dequeue to.
Returns
0 in case of success, AVERROR(EAGAIN) if no buffer was ready, another negative error in case of error.

Definition at line 651 of file v4l2_context.c.

Referenced by v4l2_receive_packet().

ff_v4l2_context_dequeue_frame()

int ff_v4l2_context_dequeue_frame ( V4L2Contextctx,
AVFramef,
int  timeout 
)

Dequeues a buffer from a V4L2Context to an AVFrame.

The frame must be non NULL.

Parameters
[in] ctx The V4L2Context to dequeue from.
[in,out] f The AVFrame to dequeue to.
[in] timeout The timeout for dequeue (-1 to block, 0 to return immediately, or milliseconds)
Returns
0 in case of success, AVERROR(EAGAIN) if no buffer was ready, another negative error in case of error.

Definition at line 631 of file v4l2_context.c.

Referenced by v4l2_receive_frame().

ff_v4l2_context_enqueue_packet()

int ff_v4l2_context_enqueue_packet ( V4L2Contextctx,
const AVPacketpkt 
)

Enqueues a buffer to a V4L2Context from an AVPacket.

The packet must be non NULL. When the size of the pkt is null, the buffer is not queued but a V4L2_DEC_CMD_STOP command is sent instead to the driver.

Parameters
[in] ctx The V4L2Context to enqueue to.
[in] pkt A pointer to an AVPacket.
Returns
0 in case of success, a negative error otherwise.

Definition at line 606 of file v4l2_context.c.

Referenced by v4l2_receive_frame().

ff_v4l2_context_enqueue_frame()

int ff_v4l2_context_enqueue_frame ( V4L2Contextctx,
const AVFramef 
)

Enqueues a buffer to a V4L2Context from an AVFrame.

The frame must be non NULL.

Parameters
[in] ctx The V4L2Context to enqueue to.
[in] f A pointer to an AVFrame to enqueue.
Returns
0 in case of success, a negative error otherwise.

Definition at line 581 of file v4l2_context.c.

Referenced by v4l2_send_frame().


Generated on Wed Aug 24 2022 21:38:42 for FFmpeg by   doxygen 1.8.17

AltStyle によって変換されたページ (->オリジナル) /