aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-28 11:33:38 +0200
committerLynne <dev@lynne.ee>2023-05-29 00:41:25 +0200
commita4611e3170b7f5240f719465d8033ab33a34cd70 (patch)
tree6435cab466cdb5cb39a44e8e2a8a3f239f7508ce
parent62d4110a64e04e481b8ae27e20575bc96fbea792 (diff)
downloadffmpeg-a4611e3170b7f5240f719465d8033ab33a34cd70.tar.gz
lavc/decode: pass AVHWAccel instead of AVCodecHWConfigInternal to hwaccel_init()
The only thing besides the hwaccel that this function uses from AVCodecHWConfigInternal is the pixel format, which should always match the hwaccel one. Will be useful in following commits.
-rw-r--r--libavcodec/decode.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 360837a0ad..18d85cf46f 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1111,12 +1111,10 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx,
}
static int hwaccel_init(AVCodecContext *avctx,
- const AVCodecHWConfigInternal *hw_config)
+ const AVHWAccel *hwaccel)
{
- const AVHWAccel *hwaccel;
int err;
- hwaccel = hw_config->hwaccel;
if (hwaccel->capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL &&
avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n",
@@ -1137,7 +1135,7 @@ static int hwaccel_init(AVCodecContext *avctx,
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed setup for format %s: "
"hwaccel initialisation returned error.\n",
- av_get_pix_fmt_name(hw_config->public.pix_fmt));
+ av_get_pix_fmt_name(hwaccel->pix_fmt));
av_freep(&avctx->internal->hwaccel_priv_data);
avctx->hwaccel = NULL;
return err;
@@ -1271,7 +1269,7 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
if (hw_config->hwaccel) {
av_log(avctx, AV_LOG_DEBUG, "Format %s requires hwaccel "
"initialisation.\n", desc->name);
- err = hwaccel_init(avctx, hw_config);
+ err = hwaccel_init(avctx, hw_config->hwaccel);
if (err < 0)
goto try_again;
}