--- libavcodec/avcodec.h | 6 ++++++ libavcodec/decode.c | 2 +- libavcodec/internal.h | 2 ++ libavcodec/utils.c | 9 ++++++++- libavcodec/version.h | 3 +++ 5 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 5f4a95287..ce04e737a 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4907,12 +4907,18 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v); */ void av_register_hwaccel(AVHWAccel *hwaccel); +#if FF_API_HWACCEL_NEXT /** * If hwaccel is NULL, returns the first registered hardware accelerator, * if hwaccel is non-NULL, returns the next registered hardware accelerator * after hwaccel, or NULL if hwaccel is the last one. + * + * @deprecated AVHWaccel structures contain no user-servicable parts, so + * this function should not be used. */ +attribute_deprecated AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel); +#endif /** diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 64ff04573..73b6f3e33 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -712,7 +712,7 @@ static int hwaccel_init(AVCodecContext *avctx, AVHWAccel *hwaccel = NULL; int err; - while ((hwaccel = av_hwaccel_next(hwaccel))) + while ((hwaccel = ff_hwaccel_next(hwaccel))) if (hwaccel->id == avctx->codec_id && hwaccel->pix_fmt == pix_fmt) break; diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 9f8273a79..ac9730882 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -301,4 +301,6 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); # define av_export_avcodec #endif +AVHWAccel *ff_hwaccel_next(const AVHWAccel *hwaccel); + #endif /* AVCODEC_INTERNAL_H */ diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 39c4000a7..22fa0f127 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1357,11 +1357,18 @@ void av_register_hwaccel(AVHWAccel *hwaccel) hwaccel->next = NULL; } -AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) +AVHWAccel *ff_hwaccel_next(const AVHWAccel *hwaccel) { return hwaccel ? hwaccel->next : first_hwaccel; } +#if FF_API_USER_HWACCEL +AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) +{ + return ff_hwaccel_next(hwaccel); +} +#endif + int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) { if (lockmgr_cb) { diff --git a/libavcodec/version.h b/libavcodec/version.h index bc5b8304b..fd749c696 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -95,5 +95,8 @@ #ifndef FF_API_VAAPI_CONTEXT #define FF_API_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) #endif +#ifndef FF_API_HWACCEL_NEXT +#define FF_API_HWACCEL_NEXT (LIBAVCODEC_VERSION_MAJOR < 60) +#endif #endif /* AVCODEC_VERSION_H */ -- 2.11.0 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel