avcodec: remove deprecated FF_API_VT_HWACCEL_CONTEXT

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-01-20 10:29:55 -03:00
parent c4498aae7c
commit 7bca8ce422
3 changed files with 0 additions and 88 deletions

View File

@ -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)

View File

@ -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 */

View File

@ -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 */
/**
* @}
*/