diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h index 0c6091310b..06c7f349d8 100644 --- a/libavcodec/version_major.h +++ b/libavcodec/version_major.h @@ -38,7 +38,6 @@ */ #define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61) -#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_SLICE_OFFSET (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_SUBFRAMES (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index f2269766a2..f4da80640d 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -1398,35 +1398,4 @@ const FFHWAccel ff_prores_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; - - -#if FF_API_VT_HWACCEL_CONTEXT -AVVideotoolboxContext *av_videotoolbox_alloc_context(void) -{ - return videotoolbox_alloc_context_with_pix_fmt(AV_PIX_FMT_NONE, false); -} - -int av_videotoolbox_default_init(AVCodecContext *avctx) -{ - return av_videotoolbox_default_init2(avctx, NULL); -} - -int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx) -{ - enum AVPixelFormat pix_fmt = videotoolbox_best_pixel_format(avctx); - bool full_range = avctx->color_range == AVCOL_RANGE_JPEG; - avctx->hwaccel_context = vtctx ?: videotoolbox_alloc_context_with_pix_fmt(pix_fmt, full_range); - if (!avctx->hwaccel_context) - return AVERROR(ENOMEM); - return 0; -} - -void av_videotoolbox_default_free(AVCodecContext *avctx) -{ - - videotoolbox_stop(avctx); - av_freep(&avctx->hwaccel_context); -} -#endif /* FF_API_VT_HWACCEL_CONTEXT */ - #endif /* CONFIG_VIDEOTOOLBOX */ diff --git a/libavcodec/videotoolbox.h b/libavcodec/videotoolbox.h index 11b5315f7d..d68d76e400 100644 --- a/libavcodec/videotoolbox.h +++ b/libavcodec/videotoolbox.h @@ -78,62 +78,6 @@ typedef struct AVVideotoolboxContext { int cm_codec_type; } AVVideotoolboxContext; -#if FF_API_VT_HWACCEL_CONTEXT - -/** - * Allocate and initialize a Videotoolbox context. - * - * This function should be called from the get_format() callback when the caller - * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create - * the decoder object (using the output callback provided by libavcodec) that - * will be used for Videotoolbox-accelerated decoding. - * - * When decoding with Videotoolbox is finished, the caller must destroy the decoder - * object and free the Videotoolbox context using av_free(). - * - * @return the newly allocated context or NULL on failure - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -AVVideotoolboxContext *av_videotoolbox_alloc_context(void); - -/** - * This is a convenience function that creates and sets up the Videotoolbox context using - * an internal implementation. - * - * @param avctx the corresponding codec context - * - * @return >= 0 on success, a negative AVERROR code on failure - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -int av_videotoolbox_default_init(AVCodecContext *avctx); - -/** - * This is a convenience function that creates and sets up the Videotoolbox context using - * an internal implementation. - * - * @param avctx the corresponding codec context - * @param vtctx the Videotoolbox context to use - * - * @return >= 0 on success, a negative AVERROR code on failure - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); - -/** - * This function must be called to free the Videotoolbox context initialized with - * av_videotoolbox_default_init(). - * - * @param avctx the corresponding codec context - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -void av_videotoolbox_default_free(AVCodecContext *avctx); - -#endif /* FF_API_VT_HWACCEL_CONTEXT */ - /** * @} */