mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01:00
lavc/rkmppenc: add RKMPP MJPEG encoder
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
parent
9de0f4b793
commit
ab1bad7034
5 changed files with 149 additions and 32 deletions
1
configure
vendored
1
configure
vendored
|
|
@ -3266,6 +3266,7 @@ mjpeg_cuvid_decoder_deps="cuvid"
|
|||
mjpeg_qsv_decoder_select="qsvdec"
|
||||
mjpeg_qsv_encoder_deps="libmfx"
|
||||
mjpeg_qsv_encoder_select="qsvenc"
|
||||
mjpeg_rkmpp_encoder_deps="rkmpp"
|
||||
mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
|
||||
mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
|
||||
mp3_mf_encoder_deps="mediafoundation"
|
||||
|
|
|
|||
|
|
@ -502,6 +502,7 @@ OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpegenc_common.o \
|
|||
OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o
|
||||
OBJS-$(CONFIG_MJPEG_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_MJPEG_QSV_ENCODER) += qsvenc_jpeg.o
|
||||
OBJS-$(CONFIG_MJPEG_RKMPP_ENCODER) += rkmppenc.o
|
||||
OBJS-$(CONFIG_MJPEG_VAAPI_ENCODER) += vaapi_encode_mjpeg.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlpdsp.o
|
||||
OBJS-$(CONFIG_MLP_ENCODER) += mlpenc.o mlp.o
|
||||
|
|
|
|||
|
|
@ -878,6 +878,7 @@ extern const FFCodec ff_libkvazaar_encoder;
|
|||
extern const FFCodec ff_mjpeg_cuvid_decoder;
|
||||
extern const FFCodec ff_mjpeg_qsv_encoder;
|
||||
extern const FFCodec ff_mjpeg_qsv_decoder;
|
||||
extern const FFCodec ff_mjpeg_rkmpp_encoder;
|
||||
extern const FFCodec ff_mjpeg_vaapi_encoder;
|
||||
extern const FFCodec ff_mp3_mf_encoder;
|
||||
extern const FFCodec ff_mpeg1_cuvid_decoder;
|
||||
|
|
|
|||
|
|
@ -30,13 +30,14 @@
|
|||
static MppCodingType rkmpp_get_coding_type(AVCodecContext *avctx)
|
||||
{
|
||||
switch (avctx->codec_id) {
|
||||
case AV_CODEC_ID_H264: return MPP_VIDEO_CodingAVC;
|
||||
case AV_CODEC_ID_HEVC: return MPP_VIDEO_CodingHEVC;
|
||||
default: return MPP_VIDEO_CodingUnused;
|
||||
case AV_CODEC_ID_H264: return MPP_VIDEO_CodingAVC;
|
||||
case AV_CODEC_ID_HEVC: return MPP_VIDEO_CodingHEVC;
|
||||
case AV_CODEC_ID_MJPEG: return MPP_VIDEO_CodingMJPEG;
|
||||
default: return MPP_VIDEO_CodingUnused;
|
||||
}
|
||||
}
|
||||
|
||||
static MppFrameFormat rkmpp_get_mpp_fmt(enum AVPixelFormat pix_fmt)
|
||||
static MppFrameFormat rkmpp_get_mpp_fmt_h26x(enum AVPixelFormat pix_fmt)
|
||||
{
|
||||
switch (pix_fmt) {
|
||||
case AV_PIX_FMT_GRAY8: return MPP_FMT_YUV400;
|
||||
|
|
@ -64,6 +65,33 @@ static MppFrameFormat rkmpp_get_mpp_fmt(enum AVPixelFormat pix_fmt)
|
|||
}
|
||||
}
|
||||
|
||||
static MppFrameFormat rkmpp_get_mpp_fmt_mjpeg(enum AVPixelFormat pix_fmt)
|
||||
{
|
||||
switch (pix_fmt) {
|
||||
case AV_PIX_FMT_YUV420P: return MPP_FMT_YUV420P;
|
||||
case AV_PIX_FMT_NV12: return MPP_FMT_YUV420SP;
|
||||
case AV_PIX_FMT_YUYV422: return MPP_FMT_YUV422_YUYV;
|
||||
case AV_PIX_FMT_UYVY422: return MPP_FMT_YUV422_UYVY;
|
||||
case AV_PIX_FMT_RGB444BE: return MPP_FMT_RGB444;
|
||||
case AV_PIX_FMT_BGR444BE: return MPP_FMT_BGR444;
|
||||
case AV_PIX_FMT_RGB555BE: return MPP_FMT_RGB555;
|
||||
case AV_PIX_FMT_BGR555BE: return MPP_FMT_BGR555;
|
||||
case AV_PIX_FMT_RGB565BE: return MPP_FMT_RGB565;
|
||||
case AV_PIX_FMT_BGR565BE: return MPP_FMT_BGR565;
|
||||
case AV_PIX_FMT_RGBA:
|
||||
case AV_PIX_FMT_RGB0: return MPP_FMT_RGBA8888;
|
||||
case AV_PIX_FMT_BGRA:
|
||||
case AV_PIX_FMT_BGR0: return MPP_FMT_BGRA8888;
|
||||
case AV_PIX_FMT_ARGB:
|
||||
case AV_PIX_FMT_0RGB: return MPP_FMT_ARGB8888;
|
||||
case AV_PIX_FMT_ABGR:
|
||||
case AV_PIX_FMT_0BGR: return MPP_FMT_ABGR8888;
|
||||
case AV_PIX_FMT_X2RGB10BE: return MPP_FMT_RGB101010;
|
||||
case AV_PIX_FMT_X2BGR10BE: return MPP_FMT_BGR101010;
|
||||
default: return MPP_FMT_BUTT;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t rkmpp_get_drm_afbc_format(MppFrameFormat mpp_fmt)
|
||||
{
|
||||
switch (mpp_fmt & MPP_FRAME_FMT_MASK) {
|
||||
|
|
@ -231,6 +259,13 @@ static int rkmpp_set_enc_cfg_prep(AVCodecContext *avctx, AVFrame *frame)
|
|||
|
||||
pix_desc = av_pix_fmt_desc_get(r->pix_fmt);
|
||||
is_afbc = drm_is_afbc(drm_desc->objects[0].format_modifier);
|
||||
if (is_afbc &&
|
||||
!(avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "AFBC is not supported in codec '%s'\n",
|
||||
avcodec_get_name(avctx->codec_id));
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
if (!is_afbc) {
|
||||
ret = get_byte_stride(&drm_desc->objects[0],
|
||||
&drm_desc->layers[0],
|
||||
|
|
@ -317,7 +352,7 @@ static int rkmpp_set_enc_cfg(AVCodecContext *avctx)
|
|||
|
||||
mpp_enc_cfg_set_s32(cfg, "rc:gop", FFMAX(avctx->gop_size, 1));
|
||||
|
||||
rc_mode = r->rc_mode;
|
||||
rc_mode = avctx->codec_id == AV_CODEC_ID_MJPEG ? MPP_ENC_RC_MODE_FIXQP : r->rc_mode;
|
||||
if (rc_mode == MPP_ENC_RC_MODE_BUTT) {
|
||||
if (r->qp_init >= 0)
|
||||
rc_mode = MPP_ENC_RC_MODE_FIXQP;
|
||||
|
|
@ -342,7 +377,6 @@ static int rkmpp_set_enc_cfg(AVCodecContext *avctx)
|
|||
switch (rc_mode) {
|
||||
case MPP_ENC_RC_MODE_FIXQP:
|
||||
/* do not setup bitrate on FIXQP mode */
|
||||
min_bps = max_bps = avctx->bit_rate;
|
||||
break;
|
||||
case MPP_ENC_RC_MODE_VBR:
|
||||
case MPP_ENC_RC_MODE_AVBR:
|
||||
|
|
@ -359,12 +393,15 @@ static int rkmpp_set_enc_cfg(AVCodecContext *avctx)
|
|||
min_bps = avctx->bit_rate * 15 / 16;
|
||||
break;
|
||||
}
|
||||
mpp_enc_cfg_set_u32(cfg, "rc:bps_target", avctx->bit_rate);
|
||||
mpp_enc_cfg_set_s32(cfg, "rc:bps_max", max_bps);
|
||||
mpp_enc_cfg_set_s32(cfg, "rc:bps_min", min_bps);
|
||||
|
||||
av_log(avctx, AV_LOG_VERBOSE, "Bitrate Target/Min/Max is set to %ld/%d/%d\n",
|
||||
avctx->bit_rate, min_bps, max_bps);
|
||||
if (rc_mode == MPP_ENC_RC_MODE_CBR ||
|
||||
rc_mode == MPP_ENC_RC_MODE_VBR ||
|
||||
rc_mode == MPP_ENC_RC_MODE_AVBR) {
|
||||
mpp_enc_cfg_set_u32(cfg, "rc:bps_target", avctx->bit_rate);
|
||||
mpp_enc_cfg_set_s32(cfg, "rc:bps_max", max_bps);
|
||||
mpp_enc_cfg_set_s32(cfg, "rc:bps_min", min_bps);
|
||||
av_log(avctx, AV_LOG_VERBOSE, "Bitrate Target/Min/Max is set to %ld/%d/%d\n",
|
||||
avctx->bit_rate, min_bps, max_bps);
|
||||
}
|
||||
|
||||
if (avctx->rc_buffer_size > 0 &&
|
||||
(rc_mode == MPP_ENC_RC_MODE_CBR ||
|
||||
|
|
@ -409,6 +446,17 @@ static int rkmpp_set_enc_cfg(AVCodecContext *avctx)
|
|||
mpp_enc_cfg_set_s32(cfg, "rc:qp_min_i", qp_min_i);
|
||||
}
|
||||
break;
|
||||
case AV_CODEC_ID_MJPEG:
|
||||
{
|
||||
qp_init = r->qp_init >= 1 ? r->qp_init : 80;
|
||||
qp_max = r->qp_max >= 1 ? r->qp_max : 99;
|
||||
qp_min = r->qp_min >= 1 ? r->qp_min : 1;
|
||||
/* jpeg use special codec config to control qtable */
|
||||
mpp_enc_cfg_set_s32(cfg, "jpeg:q_factor", qp_init);
|
||||
mpp_enc_cfg_set_s32(cfg, "jpeg:qf_max", qp_max);
|
||||
mpp_enc_cfg_set_s32(cfg, "jpeg:qf_min", qp_min);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
|
@ -464,6 +512,8 @@ static int rkmpp_set_enc_cfg(AVCodecContext *avctx)
|
|||
av_log(avctx, AV_LOG_VERBOSE, "Level is set to %d\n", avctx->level / 3);
|
||||
}
|
||||
break;
|
||||
case AV_CODEC_ID_MJPEG:
|
||||
break;
|
||||
default:
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
|
@ -473,15 +523,15 @@ static int rkmpp_set_enc_cfg(AVCodecContext *avctx)
|
|||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
sei_mode = MPP_ENC_SEI_MODE_DISABLE;
|
||||
if ((ret = r->mapi->control(r->mctx, MPP_ENC_SET_SEI_CFG, &sei_mode)) != MPP_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to set SEI config: %d\n", ret);
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
header_mode = MPP_ENC_HEADER_MODE_EACH_IDR;
|
||||
if (avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC) {
|
||||
sei_mode = MPP_ENC_SEI_MODE_DISABLE;
|
||||
if ((ret = r->mapi->control(r->mctx, MPP_ENC_SET_SEI_CFG, &sei_mode)) != MPP_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to set SEI config: %d\n", ret);
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
header_mode = MPP_ENC_HEADER_MODE_EACH_IDR;
|
||||
if ((ret = r->mapi->control(r->mctx, MPP_ENC_SET_HEADER_MODE, &header_mode)) != MPP_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to set header mode: %d\n", ret);
|
||||
return AVERROR_EXTERNAL;
|
||||
|
|
@ -572,6 +622,13 @@ static MPPEncFrame *rkmpp_submit_frame(AVCodecContext *avctx, AVFrame *frame)
|
|||
plane0 = &layer->planes[0];
|
||||
|
||||
is_afbc = drm_is_afbc(drm_desc->objects[0].format_modifier);
|
||||
if (is_afbc &&
|
||||
!(avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "AFBC is not supported in codec '%s'\n",
|
||||
avcodec_get_name(avctx->codec_id));
|
||||
goto exit;
|
||||
}
|
||||
if (is_afbc) {
|
||||
uint32_t drm_afbc_fmt = rkmpp_get_drm_afbc_format(mpp_fmt);
|
||||
int afbc_offset_y = 0;
|
||||
|
|
@ -654,7 +711,9 @@ static int rkmpp_send_frame(AVCodecContext *avctx, MPPEncFrame *mpp_enc_frame)
|
|||
if (frame && (ret = rkmpp_set_enc_cfg_prep(avctx, frame)) < 0)
|
||||
goto exit;
|
||||
|
||||
if (frame && frame->pict_type == AV_PICTURE_TYPE_I) {
|
||||
if ((avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC) &&
|
||||
frame && frame->pict_type == AV_PICTURE_TYPE_I) {
|
||||
if ((ret = r->mapi->control(r->mctx, MPP_ENC_SET_IDR_FRAME, NULL)) != MPP_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to set IDR frame: %d\n", ret);
|
||||
ret = AVERROR_EXTERNAL;
|
||||
|
|
@ -765,10 +824,13 @@ static int rkmpp_encode_frame(AVCodecContext *avctx, AVPacket *packet,
|
|||
RKMPPEncContext *r = avctx->priv_data;
|
||||
MPPEncFrame *mpp_enc_frame = NULL;
|
||||
int ret;
|
||||
int timeout = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
|
||||
? MPP_TIMEOUT_BLOCK : MPP_TIMEOUT_NON_BLOCK;
|
||||
int timeout = (avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC ||
|
||||
avctx->codec_id == AV_CODEC_ID_MJPEG) &&
|
||||
!(avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
|
||||
? MPP_TIMEOUT_NON_BLOCK : MPP_TIMEOUT_BLOCK;
|
||||
|
||||
if (get_used_frame_count(r->frame_list) > H26X_ASYNC_FRAMES)
|
||||
if (get_used_frame_count(r->frame_list) > r->async_frames)
|
||||
goto get;
|
||||
|
||||
mpp_enc_frame = rkmpp_submit_frame(avctx, (AVFrame *)frame);
|
||||
|
|
@ -804,6 +866,7 @@ static int rkmpp_encode_close(AVCodecContext *avctx)
|
|||
RKMPPEncContext *r = avctx->priv_data;
|
||||
|
||||
r->cfg_init = 0;
|
||||
r->async_frames = 0;
|
||||
|
||||
if (r->mapi) {
|
||||
r->mapi->reset(r->mctx);
|
||||
|
|
@ -859,13 +922,18 @@ static int rkmpp_encode_init(AVCodecContext *avctx)
|
|||
int output_timeout = MPP_TIMEOUT_NON_BLOCK;
|
||||
int ret;
|
||||
|
||||
r->cfg_init = 0;
|
||||
r->async_frames = 0;
|
||||
|
||||
if ((coding_type = rkmpp_get_coding_type(avctx)) == MPP_VIDEO_CodingUnused) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unknown codec id: %d\n", avctx->codec_id);
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
pix_fmt = avctx->pix_fmt == AV_PIX_FMT_DRM_PRIME ? avctx->sw_pix_fmt : avctx->pix_fmt;
|
||||
mpp_fmt = rkmpp_get_mpp_fmt(pix_fmt) & MPP_FRAME_FMT_MASK;
|
||||
mpp_fmt = avctx->codec_id == AV_CODEC_ID_MJPEG
|
||||
? rkmpp_get_mpp_fmt_mjpeg(pix_fmt) : rkmpp_get_mpp_fmt_h26x(pix_fmt);
|
||||
mpp_fmt &= MPP_FRAME_FMT_MASK;
|
||||
|
||||
if (mpp_fmt == MPP_FMT_BUTT) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported input pixel format '%s'\n",
|
||||
|
|
@ -920,6 +988,12 @@ static int rkmpp_encode_init(AVCodecContext *avctx)
|
|||
if ((ret = rkmpp_set_enc_cfg(avctx)) < 0)
|
||||
goto fail;
|
||||
|
||||
if (avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC)
|
||||
r->async_frames = H26X_ASYNC_FRAMES;
|
||||
else if (avctx->codec_id == AV_CODEC_ID_MJPEG)
|
||||
r->async_frames = MJPEG_ASYNC_FRAMES;
|
||||
|
||||
if (avctx->codec_id == AV_CODEC_ID_H264 ||
|
||||
avctx->codec_id == AV_CODEC_ID_HEVC) {
|
||||
RK_U8 enc_hdr_buf[H26X_HEADER_SIZE];
|
||||
|
|
@ -929,7 +1003,7 @@ static int rkmpp_encode_init(AVCodecContext *avctx)
|
|||
memset(enc_hdr_buf, 0, H26X_HEADER_SIZE);
|
||||
|
||||
if ((ret = mpp_packet_init(&mpp_pkt,
|
||||
(void *)enc_hdr_buf,
|
||||
(void *)enc_hdr_buf,
|
||||
H26X_HEADER_SIZE)) != MPP_OK || !mpp_pkt) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to init extra info packet: %d\n", ret);
|
||||
ret = AVERROR_EXTERNAL;
|
||||
|
|
@ -1006,8 +1080,11 @@ fail:
|
|||
}
|
||||
|
||||
#if CONFIG_H264_RKMPP_ENCODER
|
||||
DEFINE_RKMPP_ENCODER(h264, H264)
|
||||
DEFINE_RKMPP_ENCODER(h264, H264, h26x)
|
||||
#endif
|
||||
#if CONFIG_HEVC_RKMPP_ENCODER
|
||||
DEFINE_RKMPP_ENCODER(hevc, HEVC)
|
||||
DEFINE_RKMPP_ENCODER(hevc, HEVC, h26x)
|
||||
#endif
|
||||
#if CONFIG_MJPEG_RKMPP_ENCODER
|
||||
DEFINE_RKMPP_ENCODER(mjpeg, MJPEG, mjpeg)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,8 +38,9 @@
|
|||
#include "libavutil/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
|
||||
#define H26X_HEADER_SIZE 1024
|
||||
#define H26X_ASYNC_FRAMES 4
|
||||
#define H26X_HEADER_SIZE 1024
|
||||
#define H26X_ASYNC_FRAMES 4
|
||||
#define MJPEG_ASYNC_FRAMES 8
|
||||
#define ALIGN_DOWN(a, b) ((a) & ~((b)-1))
|
||||
|
||||
typedef struct MPPEncFrame {
|
||||
|
|
@ -64,6 +65,7 @@ typedef struct RKMPPEncContext {
|
|||
enum AVPixelFormat pix_fmt;
|
||||
|
||||
MPPEncFrame *frame_list;
|
||||
int async_frames;
|
||||
|
||||
int rc_mode;
|
||||
int qp_init;
|
||||
|
|
@ -171,7 +173,17 @@ static const AVOption hevc_options[] = {
|
|||
{ NULL }
|
||||
};
|
||||
|
||||
static const enum AVPixelFormat rkmpp_enc_pix_fmts[] = {
|
||||
static const AVOption mjpeg_options[] = {
|
||||
{ "qp_init", "Set the initial QP/Q_Factor value", OFFSET(qp_init), AV_OPT_TYPE_INT, \
|
||||
{ .i64 = -1 }, -1, 99, VE, "qmin" }, \
|
||||
{ "qp_max", "Set the max QP/Q_Factor value", OFFSET(qp_max), AV_OPT_TYPE_INT, \
|
||||
{ .i64 = -1 }, -1, 99, VE, "qp_max" }, \
|
||||
{ "qp_min", "Set the min QP/Q_Factor value", OFFSET(qp_min), AV_OPT_TYPE_INT, \
|
||||
{ .i64 = -1 }, -1, 99, VE, "qp_min" }, \
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static const enum AVPixelFormat rkmpp_enc_pix_fmts_h26x[] = {
|
||||
AV_PIX_FMT_GRAY8,
|
||||
AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P,
|
||||
|
|
@ -197,6 +209,31 @@ static const enum AVPixelFormat rkmpp_enc_pix_fmts[] = {
|
|||
AV_PIX_FMT_NONE,
|
||||
};
|
||||
|
||||
static const enum AVPixelFormat rkmpp_enc_pix_fmts_mjpeg[] = {
|
||||
AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_NV12,
|
||||
AV_PIX_FMT_YUYV422,
|
||||
AV_PIX_FMT_UYVY422,
|
||||
AV_PIX_FMT_RGB444BE,
|
||||
AV_PIX_FMT_BGR444BE,
|
||||
AV_PIX_FMT_RGB555BE,
|
||||
AV_PIX_FMT_BGR555BE,
|
||||
AV_PIX_FMT_RGB565BE,
|
||||
AV_PIX_FMT_BGR565BE,
|
||||
AV_PIX_FMT_RGBA,
|
||||
AV_PIX_FMT_RGB0,
|
||||
AV_PIX_FMT_BGRA,
|
||||
AV_PIX_FMT_BGR0,
|
||||
AV_PIX_FMT_ARGB,
|
||||
AV_PIX_FMT_0RGB,
|
||||
AV_PIX_FMT_ABGR,
|
||||
AV_PIX_FMT_0BGR,
|
||||
AV_PIX_FMT_X2RGB10BE,
|
||||
AV_PIX_FMT_X2BGR10BE,
|
||||
AV_PIX_FMT_DRM_PRIME,
|
||||
AV_PIX_FMT_NONE,
|
||||
};
|
||||
|
||||
static const AVCodecHWConfigInternal *const rkmpp_enc_hw_configs[] = {
|
||||
HW_CONFIG_ENCODER_DEVICE(NONE, RKMPP),
|
||||
HW_CONFIG_ENCODER_FRAMES(DRM_PRIME, RKMPP),
|
||||
|
|
@ -210,7 +247,7 @@ static const FFCodecDefault rkmpp_enc_defaults[] = {
|
|||
{ NULL }
|
||||
};
|
||||
|
||||
#define DEFINE_RKMPP_ENCODER(x, X) \
|
||||
#define DEFINE_RKMPP_ENCODER(x, X, xx) \
|
||||
static const AVClass x##_rkmpp_encoder_class = { \
|
||||
.class_name = #x "_rkmpp_encoder", \
|
||||
.item_name = av_default_item_name, \
|
||||
|
|
@ -230,7 +267,7 @@ const FFCodec ff_##x##_rkmpp_encoder = { \
|
|||
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
|
||||
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \
|
||||
FF_CODEC_CAP_INIT_CLEANUP, \
|
||||
.p.pix_fmts = rkmpp_enc_pix_fmts, \
|
||||
.p.pix_fmts = rkmpp_enc_pix_fmts_##xx, \
|
||||
.hw_configs = rkmpp_enc_hw_configs, \
|
||||
.defaults = rkmpp_enc_defaults, \
|
||||
.p.wrapper_name = "rkmpp", \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue