FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
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 "decode.h"
#include "hwaccel.h"
#include "internal.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"

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 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 int rkmpp_close_decoder (AVCodecContext *avctx)
 
static void rkmpp_release_decoder (void *opaque, uint8_t *data)
 
static 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 void rkmpp_flush (AVCodecContext *avctx)
 

Variables

static const
AVCodecHWConfigInternal
rkmpp_hw_configs []
 

Macro Definition Documentation

#define RECEIVE_FRAME_TIMEOUT   100

Definition at line 41 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

#define FRAMEGROUP_MAX_FRAMES   16

Definition at line 42 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

#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
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
Describe the class of an AVClass context structure.
Definition: log.h:67

Definition at line 572 of file rkmppdec.c.

#define RKMPP_DEC (   NAME,
  ID,
  BSFS 
)
Value:
AVCodec ff_##NAME##_rkmpp_decoder = { \
.name = #NAME "_rkmpp", \
.long_name = NULL_IF_CONFIG_SMALL(#NAME " (rkmpp)"), \
.type = AVMEDIA_TYPE_VIDEO, \
.id = ID, \
.priv_data_size = sizeof(RKMPPDecodeContext), \
.close = rkmpp_close_decoder, \
.priv_class = &rkmpp_##NAME##_dec_class, \
.capabilities = AV_CODEC_CAP_DELAY, \
.caps_internal = AV_CODEC_CAP_AVOID_PROBING, \
.hw_configs = rkmpp_hw_configs, \
.bsfs = BSFS, \
};
static void rkmpp_flush(AVCodecContext *avctx)
Definition: rkmppdec.c:551
static void flush(AVCodecContext *avctx)
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
static int rkmpp_close_decoder(AVCodecContext *avctx)
Definition: rkmppdec.c:124
#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: avcodec.h:981
static int rkmpp_init_decoder(AVCodecContext *avctx)
Definition: rkmppdec.c:152
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define RKMPP_DEC_CLASS(NAME)
Definition: rkmppdec.c:572
static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: rkmppdec.c:512
#define ID(x)
Definition: cast5.c:29
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:324
static const AVCodecHWConfigInternal * rkmpp_hw_configs[]
Definition: rkmppdec.c:567
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
#define AV_CODEC_CAP_AVOID_PROBING
Decoder is not a preferred choice for probing.
Definition: avcodec.h:1038
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 578 of file rkmppdec.c.

Function Documentation

static MppCodingType rkmpp_get_codingtype ( AVCodecContext avctx)
static

Definition at line 67 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

static uint32_t rkmpp_get_frameformat ( MppFrameFormat  mppformat)
static

Definition at line 78 of file rkmppdec.c.

Referenced by rkmpp_retrieve_frame().

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

Definition at line 89 of file rkmppdec.c.

Referenced by rkmpp_send_packet().

static int rkmpp_close_decoder ( AVCodecContext avctx)
static

Definition at line 124 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

static void rkmpp_release_decoder ( void opaque,
uint8_t data 
)
static

Definition at line 131 of file rkmppdec.c.

Referenced by rkmpp_init_decoder().

static int rkmpp_init_decoder ( AVCodecContext avctx)
static

Definition at line 152 of file rkmppdec.c.

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

Definition at line 269 of file rkmppdec.c.

static void rkmpp_release_frame ( void opaque,
uint8_t data 
)
static

Definition at line 307 of file rkmppdec.c.

Referenced by rkmpp_retrieve_frame().

static int rkmpp_retrieve_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 320 of file rkmppdec.c.

static int rkmpp_receive_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 512 of file rkmppdec.c.

static void rkmpp_flush ( AVCodecContext avctx)
static

Definition at line 551 of file rkmppdec.c.

Variable Documentation

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

Definition at line 567 of file rkmppdec.c.