FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
v4l2_m2m_dec.c File Reference
#include <linux/videodev2.h>
#include <sys/ioctl.h>
#include "libavutil/pixfmt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/decode.h"
#include "v4l2_context.h"
#include "v4l2_m2m.h"
#include "v4l2_fmt.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(V4L2m2mContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 
#define M2MDEC(NAME, LONGNAME, CODEC, bsf_name)
 

Functions

static int v4l2_try_start (AVCodecContext *avctx)
 
static int v4l2_prepare_decoder (V4L2m2mContext *s)
 
static int v4l2_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 
static av_cold int v4l2_decode_init (AVCodecContext *avctx)
 
 M2MDEC (h264,"H.264", AV_CODEC_ID_H264,"h264_mp4toannexb")
 
 M2MDEC (hevc,"HEVC", AV_CODEC_ID_HEVC,"hevc_mp4toannexb")
 
 M2MDEC (mpeg1,"MPEG1", AV_CODEC_ID_MPEG1VIDEO, NULL)
 
 M2MDEC (mpeg2,"MPEG2", AV_CODEC_ID_MPEG2VIDEO, NULL)
 
 M2MDEC (mpeg4,"MPEG4", AV_CODEC_ID_MPEG4, NULL)
 
 M2MDEC (h263,"H.263", AV_CODEC_ID_H263, NULL)
 
 M2MDEC (vc1,"VC1", AV_CODEC_ID_VC1, NULL)
 
 M2MDEC (vp8,"VP8", AV_CODEC_ID_VP8, NULL)
 
 M2MDEC (vp9,"VP9", AV_CODEC_ID_VP9, NULL)
 

Variables

static const AVOption options []
 

Macro Definition Documentation

#define OFFSET (   x)    offsetof(V4L2m2mContext, x)

Definition at line 189 of file v4l2_m2m_dec.c.

Definition at line 190 of file v4l2_m2m_dec.c.

#define M2MDEC (   NAME,
  LONGNAME,
  CODEC,
  bsf_name 
)
Value:
static const AVClass v4l2_m2m_ ## NAME ## _dec_class = {\
.class_name = #NAME "_v4l2_m2m_decoder",\
.item_name = av_default_item_name,\
.option = options,\
.version = LIBAVUTIL_VERSION_INT,\
};\
\
AVCodec ff_ ## NAME ## _v4l2m2m_decoder = { \
.name = #NAME "_v4l2m2m" ,\
.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"),\
.id = CODEC ,\
.priv_data_size = sizeof(V4L2m2mContext),\
.priv_class = &v4l2_m2m_ ## NAME ## _dec_class,\
.bsfs = bsf_name, \
};
static const AVOption options[]
Definition: v4l2_m2m_dec.c:192
#define LIBAVUTIL_VERSION_INT
Definition: version.h:86
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static CopyRet receive_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
Definition: crystalhd.c:560
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: v4l2_m2m_dec.c:128
av_default_item_name
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
int ff_v4l2_m2m_codec_end(AVCodecContext *avctx)
Releases all the codec resources if all AVBufferRefs have been returned to the ctx.
Definition: v4l2_m2m.c:314
Describe the class of an AVClass context structure.
Definition: log.h:67
static av_cold int v4l2_decode_init(AVCodecContext *avctx)
Definition: v4l2_m2m_dec.c:160

Definition at line 199 of file v4l2_m2m_dec.c.

Function Documentation

static int v4l2_try_start ( AVCodecContext avctx)
static

Definition at line 36 of file v4l2_m2m_dec.c.

Referenced by v4l2_receive_frame().

static int v4l2_prepare_decoder ( V4L2m2mContext s)
static

requirements

Definition at line 104 of file v4l2_m2m_dec.c.

Referenced by v4l2_decode_init().

static int v4l2_receive_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 128 of file v4l2_m2m_dec.c.

static av_cold int v4l2_decode_init ( AVCodecContext avctx)
static

Definition at line 160 of file v4l2_m2m_dec.c.

M2MDEC ( h264  ,
"H.264"  ,
AV_CODEC_ID_H264  ,
"h264_mp4toannexb"   
)
M2MDEC ( hevc  ,
"HEVC"  ,
AV_CODEC_ID_HEVC  ,
"hevc_mp4toannexb"   
)
M2MDEC ( mpeg1  ,
"MPEG1"  ,
AV_CODEC_ID_MPEG1VIDEO  ,
NULL   
)
M2MDEC ( mpeg2  ,
"MPEG2"  ,
AV_CODEC_ID_MPEG2VIDEO  ,
NULL   
)
M2MDEC ( mpeg4  ,
"MPEG4"  ,
AV_CODEC_ID_MPEG4  ,
NULL   
)
M2MDEC ( h263  ,
"H.263"  ,
AV_CODEC_ID_H263  ,
NULL   
)
M2MDEC ( vc1  ,
"VC1"  ,
AV_CODEC_ID_VC1  ,
NULL   
)
M2MDEC ( vp8  ,
"VP8"  ,
AV_CODEC_ID_VP8  ,
NULL   
)
M2MDEC ( vp9  ,
"VP9"  ,
AV_CODEC_ID_VP9  ,
NULL   
)

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "num_capture_buffers", "Number of buffers in the capture context",
OFFSET(capture.num_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 20, INT_MAX, FLAGS },
{ NULL},
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: v4l2_m2m_dec.c:190
#define OFFSET(x)
Definition: v4l2_m2m_dec.c:189
#define V4L_M2M_DEFAULT_OPTS
Definition: v4l2_m2m.h:39

Definition at line 192 of file v4l2_m2m_dec.c.