Prefer zero-copy formats for non-hwaccel hardware decoders

SpacemiT K1's BSP has a version of FFmpeg that contains both
v4l2m2m and their own *_stcodec decoders. Not only is their
V4L2 driver for their mvx decoder seemingly totally broken
(output buffers are all zeros), but it doesn't have any of
the DRM_PRIME support work that is maintained out of tree.

The result is we use a broken copyback decoder instead of
a (mostly) working zero-copy decoder because we didn't
include any logic to rank non-hwaccel decoders by pixfmt
like we have with device type for hwaccel decoders.
This commit is contained in:
Cameron Gutman
2024-07-12 18:45:46 -05:00
parent d5a198b764
commit 952ebcd0d2
2 changed files with 82 additions and 34 deletions
+7
View File
@@ -48,6 +48,9 @@ private:
static
bool isDecoderIgnored(const AVCodec* decoder);
static
bool isZeroCopyFormat(AVPixelFormat format);
static
int getAVCodecCapabilities(const AVCodec *codec);
@@ -55,6 +58,10 @@ private:
int pass,
QSet<const AVCodec*>& terminallyFailedHardwareDecoders);
bool tryInitializeNonHwAccelDecoder(PDECODER_PARAMETERS params,
bool requireZeroCopyFormat,
QSet<const AVCodec*>& terminallyFailedHardwareDecoders);
bool tryInitializeRendererForUnknownDecoder(const AVCodec* decoder,
PDECODER_PARAMETERS params,
bool tryHwAccel);