FFmpeg
Functions
v4l2_m2m.c File Reference
#include <linux/videodev2.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <dirent.h>
#include <fcntl.h>
#include "libavcodec/avcodec.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixfmt.h"
#include "refstruct.h"
#include "v4l2_context.h"
#include "v4l2_fmt.h"
#include "v4l2_m2m.h"

Go to the source code of this file.

Functions

static int v4l2_splane_video (struct v4l2_capability *cap)
 
static int v4l2_mplane_video (struct v4l2_capability *cap)
 
static int v4l2_prepare_contexts (V4L2m2mContext *s, int probe)
 
static int v4l2_probe_driver (V4L2m2mContext *s)
 
static int v4l2_configure_contexts (V4L2m2mContext *s)
 
int ff_v4l2_m2m_codec_reinit (V4L2m2mContext *s)
 Reinitializes the V4L2m2mContext when the driver cannot continue processing with the capture parameters. More...
 
static void v4l2_m2m_destroy_context (FFRefStructOpaque unused, void *context)
 
int ff_v4l2_m2m_codec_end (V4L2m2mPriv *priv)
 Releases all the codec resources if all AVBufferRefs have been returned to the ctx. More...
 
int ff_v4l2_m2m_codec_init (V4L2m2mPriv *priv)
 Probes the video nodes looking for the required codec capabilities. More...
 
int ff_v4l2_m2m_create_context (V4L2m2mPriv *priv, V4L2m2mContext **s)
 Allocate a new context and references for a V4L2 M2M instance. More...
 

Function Documentation

◆ v4l2_splane_video()

static int v4l2_splane_video ( struct v4l2_capability *  cap)
inlinestatic

Definition at line 40 of file v4l2_m2m.c.

Referenced by v4l2_prepare_contexts().

◆ v4l2_mplane_video()

static int v4l2_mplane_video ( struct v4l2_capability *  cap)
inlinestatic

Definition at line 52 of file v4l2_m2m.c.

Referenced by v4l2_prepare_contexts().

◆ v4l2_prepare_contexts()

static int v4l2_prepare_contexts ( V4L2m2mContext s,
int  probe 
)
static

Definition at line 64 of file v4l2_m2m.c.

Referenced by v4l2_configure_contexts(), and v4l2_probe_driver().

◆ v4l2_probe_driver()

static int v4l2_probe_driver ( V4L2m2mContext s)
static

Definition at line 101 of file v4l2_m2m.c.

Referenced by ff_v4l2_m2m_codec_init().

◆ v4l2_configure_contexts()

static int v4l2_configure_contexts ( V4L2m2mContext s)
static

Definition at line 137 of file v4l2_m2m.c.

Referenced by ff_v4l2_m2m_codec_init().

◆ ff_v4l2_m2m_codec_reinit()

int ff_v4l2_m2m_codec_reinit ( V4L2m2mContext ctx)

Reinitializes the V4L2m2mContext when the driver cannot continue processing with the capture parameters.

Parameters
[in]ctxThe V4L2m2mContext instantiated by the encoder/decoder.
Returns
0 in case of success, negative number otherwise

Definition at line 208 of file v4l2_m2m.c.

Referenced by v4l2_handle_event().

◆ v4l2_m2m_destroy_context()

static void v4l2_m2m_destroy_context ( FFRefStructOpaque  unused,
void *  context 
)
static

Definition at line 251 of file v4l2_m2m.c.

Referenced by ff_v4l2_m2m_create_context().

◆ ff_v4l2_m2m_codec_end()

int ff_v4l2_m2m_codec_end ( V4L2m2mPriv priv)

Releases all the codec resources if all AVBufferRefs have been returned to the ctx.

Otherwise keep the driver open.

Parameters
[in]TheV4L2m2mPriv instantiated by the encoder/decoder.
Returns
0

Definition at line 264 of file v4l2_m2m.c.

Referenced by v4l2_decode_close(), and v4l2_encode_close().

◆ ff_v4l2_m2m_codec_init()

int ff_v4l2_m2m_codec_init ( V4L2m2mPriv priv)

Probes the video nodes looking for the required codec capabilities.

Parameters
[in]ctxThe V4L2m2mPriv instantiated by the encoder/decoder.
Returns
0 if a driver is found, a negative number otherwise.

Definition at line 290 of file v4l2_m2m.c.

Referenced by v4l2_decode_init(), and v4l2_encode_init().

◆ ff_v4l2_m2m_create_context()

int ff_v4l2_m2m_create_context ( V4L2m2mPriv priv,
V4L2m2mContext **  s 
)

Allocate a new context and references for a V4L2 M2M instance.

Parameters
[in]ctxThe V4L2m2mPriv instantiated by the encoder/decoder.
[out]ctxThe V4L2m2mContext.
Returns
0 in success, a negative error code otherwise.

Definition at line 328 of file v4l2_m2m.c.

Referenced by v4l2_decode_init(), and v4l2_encode_init().