[FFmpeg-cvslog] avcodec/proresdec: Disable HWAccel at compile-time when possible
Andreas Rheinhardt
git at videolan.org
Thu Feb 27 16:55:02 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Feb 24 11:51:09 2025 +0100| [802e4f4a53b11eeb0b28d7e74ab8d655ca894a17] | committer: Andreas Rheinhardt
avcodec/proresdec: Disable HWAccel at compile-time when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=802e4f4a53b11eeb0b28d7e74ab8d655ca894a17
---
libavcodec/proresdec.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c
index 75cc2dcb6a..18cfc25279 100644
--- a/libavcodec/proresdec.c
+++ b/libavcodec/proresdec.c
@@ -254,6 +254,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
if (pix_fmt != ctx->pix_fmt) {
#define HWACCEL_MAX (CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL)
+#if HWACCEL_MAX
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
int ret;
@@ -269,6 +270,9 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
return ret;
avctx->pix_fmt = ret;
+#else
+ avctx->pix_fmt = ctx->pix_fmt = pix_fmt;
+#endif
}
ctx->frame->color_primaries = buf[14];
@@ -789,7 +793,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
return ret;
ff_thread_finish_setup(avctx);
- if (avctx->hwaccel) {
+ if (HWACCEL_MAX && avctx->hwaccel) {
const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel);
ret = hwaccel->start_frame(avctx, NULL, 0);
if (ret < 0)
@@ -862,10 +866,12 @@ const FFCodec ff_prores_decoder = {
UPDATE_THREAD_CONTEXT(update_thread_context),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles),
+#if HWACCEL_MAX
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL
HWACCEL_VIDEOTOOLBOX(prores),
#endif
NULL
},
+#endif
};
More information about the ffmpeg-cvslog
mailing list