Add support for the out-of-tree Jetson FFmpeg NVMPI decoders

https://github.com/jocover/jetson-ffmpeg
This commit is contained in:
Cameron Gutman 2020-01-26 19:16:03 -08:00
parent 4c579aa826
commit f0119b1231

View file

@ -670,6 +670,23 @@ bool FFmpegVideoDecoder::initialize(PDECODER_PARAMETERS params)
#endif
#ifdef Q_OS_LINUX
{
AVCodec* nvmpiDecoder;
if (params->videoFormat & VIDEO_FORMAT_MASK_H264) {
nvmpiDecoder = avcodec_find_decoder_by_name("h264_nvmpi");
}
else {
nvmpiDecoder = avcodec_find_decoder_by_name("hevc_nvmpi");
}
if (nvmpiDecoder != nullptr &&
tryInitializeRenderer(nvmpiDecoder, params, nullptr,
[]() -> IFFmpegRenderer* { return new SdlRenderer(); })) {
return true;
}
}
{
AVCodec* v4l2Decoder;