Add h264_omx and hevc_omx decoders used by the Vision Five 2

This commit is contained in:
Cameron Gutman 2023-04-02 17:17:25 -05:00
parent 7cf77211b0
commit fb39ad896e
2 changed files with 10 additions and 0 deletions

View file

@ -135,6 +135,14 @@ bool DrmRenderer::prepareDecoderContext(AVCodecContext* context, AVDictionary**
// buffers that we get back. We only support NV12 buffers now.
av_dict_set_int(options, "pixel_format", AV_PIX_FMT_NV12, 0);
// This option controls the pixel format for the h264_omx and hevc_omx decoders
// used by the JH7110 multimedia stack. This decoder gives us software frames,
// so we need a format supported by our DRM dumb buffer code (NV12/NV21/P010).
//
// https://doc-en.rvspace.org/VisionFive2/DG_Multimedia/JH7110_SDK/h264_omx.html
// https://doc-en.rvspace.org/VisionFive2/DG_Multimedia/JH7110_SDK/hevc_omx.html
av_dict_set(options, "omx_pix_fmt", "nv12", 0);
if (m_HwAccelBackend) {
context->hw_device_ctx = av_buffer_ref(m_HwContext);
}

View file

@ -56,11 +56,13 @@ static const struct {
{"h264_nvv4l2", 0},
{"h264_nvmpi", 0},
{"h264_v4l2m2m", 0},
{"h264_omx", 0},
{"hevc_rkmpp", 0},
{"hevc_nvv4l2", CAPABILITY_REFERENCE_FRAME_INVALIDATION_HEVC},
{"hevc_nvmpi", 0},
{"hevc_v4l2m2m", 0},
{"hevc_omx", 0},
};
bool FFmpegVideoDecoder::isHardwareAccelerated()