FFmpeg
Loading...
Searching...
No Matches
rkmppdec.c File Reference
#include <drm_fourcc.h>
#include <pthread.h>
#include <rockchip/mpp_buffer.h>
#include <rockchip/rk_mpi.h>
#include <time.h>
#include <unistd.h>
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "decode_bsf.h"
#include "hwconfig.h"
#include "libavutil/refstruct.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
#include "libavutil/frame.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_drm.h"
#include "libavutil/imgutils.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Data Structures

struct  RKMPPDecoder
 
struct  RKMPPDecodeContext
 
struct  RKMPPFrameContext
 

Macros

#define RECEIVE_FRAME_TIMEOUT   100
 
#define FRAMEGROUP_MAX_FRAMES   16
 
#define INPUT_MAX_PACKETS   4
 
#define RKMPP_DEC_CLASS(NAME)
 
#define RKMPP_DEC(NAME, ID, BSFS)
 

Functions

static MppCodingType rkmpp_get_codingtype (AVCodecContext *avctx)
 
static uint32_t rkmpp_get_frameformat (MppFrameFormat mppformat)
 
static int rkmpp_write_data (AVCodecContext *avctx, uint8_t *buffer, int size, int64_t pts)
 
static av_cold int rkmpp_close_decoder (AVCodecContext *avctx)
 
static void rkmpp_release_decoder (AVRefStructOpaque unused, void *obj)
 
static av_cold int rkmpp_init_decoder (AVCodecContext *avctx)
 
static int rkmpp_send_packet (AVCodecContext *avctx, const AVPacket *avpkt)
 
static void rkmpp_release_frame (void *opaque, uint8_t *data)
 
static int rkmpp_retrieve_frame (AVCodecContext *avctx, AVFrame *frame)
 
static int rkmpp_receive_frame (AVCodecContext *avctx, AVFrame *frame)
 
static av_cold void rkmpp_flush (AVCodecContext *avctx)
 

Variables

static const AVCodecHWConfigInternal *const rkmpp_hw_configs []
 

Macro Definition Documentation

◆ RECEIVE_FRAME_TIMEOUT

#define RECEIVE_FRAME_TIMEOUT   100

Definition at line 44 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

◆ FRAMEGROUP_MAX_FRAMES

#define FRAMEGROUP_MAX_FRAMES   16

Definition at line 45 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

◆ INPUT_MAX_PACKETS

#define INPUT_MAX_PACKETS   4

Definition at line 46 of file rkmppdec.c.

Referenced by rkmpp_receive_frame().

◆ RKMPP_DEC_CLASS

#define RKMPP_DEC_CLASS ( NAME)
Value:
static const AVClass rkmpp_##NAME##_dec_class = { \
.class_name = "rkmpp_" #NAME "_dec", \
.version = LIBAVUTIL_VERSION_INT, \
};
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
Describe the class of an AVClass context structure.
Definition log.h:76

Definition at line 553 of file rkmppdec.c.

◆ RKMPP_DEC

#define RKMPP_DEC ( NAME,
ID,
BSFS )
Value:
const FFCodec ff_##NAME##_rkmpp_decoder = { \
.p.name = #NAME "_rkmpp", \
CODEC_LONG_NAME(#NAME " (rkmpp)"), \
.p.type = AVMEDIA_TYPE_VIDEO, \
.p.id = ID, \
.priv_data_size = sizeof(RKMPPDecodeContext), \
.flush = rkmpp_flush, \
.p.priv_class = &rkmpp_##NAME##_dec_class, \
.hw_configs = rkmpp_hw_configs, \
.bsfs = BSFS, \
.p.wrapper_name = "rkmpp", \
};
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_RECEIVE_FRAME_CB(func)
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
Definition codec.h:126
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition codec.h:79
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition codec.h:133
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define ID(_0)
Definition mov_chan.c:124
static av_cold int rkmpp_close_decoder(AVCodecContext *avctx)
Definition rkmppdec.c:127
static const AVCodecHWConfigInternal *const rkmpp_hw_configs[]
Definition rkmppdec.c:548
#define RKMPP_DEC_CLASS(NAME)
Definition rkmppdec.c:553
static av_cold int rkmpp_init_decoder(AVCodecContext *avctx)
Definition rkmppdec.c:153
static av_cold void rkmpp_flush(AVCodecContext *avctx)
Definition rkmppdec.c:533
static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition rkmppdec.c:482

Definition at line 559 of file rkmppdec.c.

Function Documentation

◆ rkmpp_get_codingtype()

static MppCodingType rkmpp_get_codingtype ( AVCodecContext * avctx)
static

Definition at line 70 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

◆ rkmpp_get_frameformat()

static uint32_t rkmpp_get_frameformat ( MppFrameFormat mppformat)
static

Definition at line 81 of file rkmppdec.c.

Referenced by rkmpp_retrieve_frame().

◆ rkmpp_write_data()

static int rkmpp_write_data ( AVCodecContext * avctx,
uint8_t * buffer,
int size,
int64_t pts )
static

Definition at line 92 of file rkmppdec.c.

Referenced by rkmpp_send_packet().

◆ rkmpp_close_decoder()

static av_cold int rkmpp_close_decoder ( AVCodecContext * avctx)
static

Definition at line 127 of file rkmppdec.c.

◆ rkmpp_release_decoder()

static void rkmpp_release_decoder ( AVRefStructOpaque unused,
void * obj )
static

Definition at line 134 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

◆ rkmpp_init_decoder()

static av_cold int rkmpp_init_decoder ( AVCodecContext * avctx)
static

Definition at line 153 of file rkmppdec.c.

◆ rkmpp_send_packet()

static int rkmpp_send_packet ( AVCodecContext * avctx,
const AVPacket * avpkt )
static

Definition at line 263 of file rkmppdec.c.

Referenced by rkmpp_receive_frame().

◆ rkmpp_release_frame()

static void rkmpp_release_frame ( void * opaque,
uint8_t * data )
static

Definition at line 303 of file rkmppdec.c.

Referenced by rkmpp_retrieve_frame().

◆ rkmpp_retrieve_frame()

static int rkmpp_retrieve_frame ( AVCodecContext * avctx,
AVFrame * frame )
static

Definition at line 314 of file rkmppdec.c.

Referenced by rkmpp_receive_frame().

◆ rkmpp_receive_frame()

static int rkmpp_receive_frame ( AVCodecContext * avctx,
AVFrame * frame )
static

Definition at line 482 of file rkmppdec.c.

◆ rkmpp_flush()

static av_cold void rkmpp_flush ( AVCodecContext * avctx)
static

Definition at line 533 of file rkmppdec.c.

Variable Documentation

◆ rkmpp_hw_configs

const AVCodecHWConfigInternal* const rkmpp_hw_configs[]
static
Initial value:
= {
HW_CONFIG_INTERNAL(DRM_PRIME),
}
#define NULL
Definition coverity.c:32
#define HW_CONFIG_INTERNAL(format)
Definition hwconfig.h:54

Definition at line 548 of file rkmppdec.c.