diff mbox series

[FFmpeg-devel,2/2] lavc/videotoolbox: deprecate write-only output_callback

Message ID 20220915135627.32230-2-anton@khirnov.net
State Accepted
Commit 8576c3c5d82188c1313f20666b8760fe4a29444c
Headers show
Series [FFmpeg-devel,1/2] lavc/videotoolbox: do not pass AVCodecContext to decoder output callback | 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

Anton Khirnov Sept. 15, 2022, 1:56 p.m. UTC
This field has never been used for anything, so stop setting it and
deprecate it.
---
 libavcodec/version_major.h | 1 +
 libavcodec/videotoolbox.c  | 2 --
 libavcodec/videotoolbox.h  | 5 +++++
 3 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 1ec815a7bc..d9386792de 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -51,5 +51,6 @@ 
 #define FF_API_IDCT_NONE           (LIBAVCODEC_VERSION_MAJOR < 60)
 #define FF_API_SVTAV1_OPTS         (LIBAVCODEC_VERSION_MAJOR < 60)
 #define FF_API_AYUV_CODECID        (LIBAVCODEC_VERSION_MAJOR < 60)
+#define FF_API_VT_OUTPUT_CALLBACK  (LIBAVCODEC_VERSION_MAJOR < 60)
 
 #endif /* AVCODEC_VERSION_MAJOR_H */
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index d61d310600..1b1be8ddb4 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -1377,8 +1377,6 @@  static AVVideotoolboxContext *av_videotoolbox_alloc_context_with_pix_fmt(enum AV
     AVVideotoolboxContext *ret = av_mallocz(sizeof(*ret));
 
     if (ret) {
-        ret->output_callback = videotoolbox_decoder_callback;
-
         OSType cv_pix_fmt_type = av_map_videotoolbox_format_from_pixfmt2(pix_fmt, full_range);
         if (cv_pix_fmt_type == 0) {
             cv_pix_fmt_type = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
diff --git a/libavcodec/videotoolbox.h b/libavcodec/videotoolbox.h
index af2db0d580..fd8a5b7982 100644
--- a/libavcodec/videotoolbox.h
+++ b/libavcodec/videotoolbox.h
@@ -37,6 +37,8 @@ 
 
 #include "libavcodec/avcodec.h"
 
+#include "libavutil/attributes.h"
+
 /**
  * This struct holds all the information that needs to be passed
  * between the caller and libavcodec for initializing Videotoolbox decoding.
@@ -50,11 +52,14 @@  typedef struct AVVideotoolboxContext {
      */
     VTDecompressionSessionRef session;
 
+#if FF_API_VT_OUTPUT_CALLBACK
     /**
      * The output callback that must be passed to the session.
      * Set by av_videottoolbox_default_init()
      */
+    attribute_deprecated
     VTDecompressionOutputCallback output_callback;
+#endif
 
     /**
      * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.