[FFmpeg-devel] [PATCH] Add support for RockChip Media Process Platform
LongChair .
longchair at hotmail.com
Mon Sep 11 11:21:09 EEST 2017
Le 10/09/2017 à 19:13, James Almer a écrit :
On 9/9/2017 4:00 AM, LongChair . wrote:
From: LongChair <LongChair at hotmail.com><mailto:LongChair at hotmail.com>
This adds hardware decoding for h264 / HEVC / VP8 using MPP Rockchip API.
Will return frames holding an AVDRMFrameDescriptor struct in buf[0] that allows drm / dmabuf usage.
Was tested on RK3288 (TinkerBoard) and RK3328.
Changes from Previous patch :
- Frame colorspace info is now filled.
- Frame interlacing is now filled (Note : currently had a bug in mpp which will be fixed soon by rockchip, will set the frame to progressive).
- hw_frame_context returns none as format for the rockchip specific 10 bits.
- Added support for MPEG4 codec
- Added support for VP9 codec.
- the ION format has been kept for MPP init (rather than DRM) as this is the only one working right, using DRM format will cause assertions upon close.
- Other minor comments have been taken into account
---
Changelog | 1 +
configure | 16 ++
libavcodec/Makefile | 5 +
libavcodec/allcodecs.c | 5 +
libavcodec/rkmppdec.c | 584 +++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 611 insertions(+)
create mode 100644 libavcodec/rkmppdec.c
+#define RKMPP_DEC(NAME, ID, BSFS) \
+ RKMPP_DEC_CLASS(NAME) \
+ 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), \
+ .init = rkmpp_init_decoder, \
+ .close = rkmpp_close_decoder, \
+ .receive_frame = rkmpp_receive_frame, \
+ .flush = rkmpp_flush, \
+ .priv_class = &rkmpp_##NAME##_dec_class, \
+ .capabilities = AV_CODEC_CAP_DELAY, \
Add AV_CODEC_CAP_AVOID_PROBING as well.
What would that flag change ?
+ .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \
It doesn't look like you're setting pkt_dts anywhere?
True, I can remove that one.
+ .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
+ AV_PIX_FMT_NONE}, \
+ .bsfs = BSFS, \
+ };
+
+RKMPP_DEC(h264, AV_CODEC_ID_H264, "h264_mp4toannexb")
+RKMPP_DEC(hevc, AV_CODEC_ID_HEVC, "hevc_mp4toannexb")
+RKMPP_DEC(mpeg4, AV_CODEC_ID_MPEG4, NULL)
+RKMPP_DEC(vp8, AV_CODEC_ID_VP8, NULL)
+RKMPP_DEC(vp9, AV_CODEC_ID_VP9, NULL)
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org<mailto:ffmpeg-devel at ffmpeg.org>
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list