diff mbox series

[FFmpeg-devel,06/24] avcodec: remove deprecated FF_API_VT_HWACCEL_CONTEXT

Message ID 20240125134425.374-7-jamrial@gmail.com
State Accepted
Commit 7bca8ce42251a6bff9d482d46f52c9a8e280f112
Headers show
Series Major library version bump | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Jan. 25, 2024, 1:43 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/version_major.h |  1 -
 libavcodec/videotoolbox.c  | 31 ---------------------
 libavcodec/videotoolbox.h  | 56 --------------------------------------
 3 files changed, 88 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 88cc975713..79c6f6dd05 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 */
-
 /**
  * @}
  */