diff mbox series

[FFmpeg-devel,6/9] lavf: deprecate av_format_inject_global_side_data()

Message ID 20241013112418.12070-6-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/9] lavf/internal: remove a prototype for non-existent function | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Anton Khirnov Oct. 13, 2024, 11:24 a.m. UTC
This function would otherwise fail to build on the next major bump, as
inject_global_side_data is marked for removal.

It should also never be needed, as there is now a mechanism for
supplying global side data to decoders directly.
---
 libavformat/avformat.h    | 5 +++++
 libavformat/demux_utils.c | 2 ++
 2 files changed, 7 insertions(+)

Comments

Marvin Scholz Oct. 13, 2024, 1:41 p.m. UTC | #1
On 13 Oct 2024, at 13:24, Anton Khirnov wrote:

> This function would otherwise fail to build on the next major bump, as
> inject_global_side_data is marked for removal.
>
> It should also never be needed, as there is now a mechanism for
> supplying global side data to decoders directly.
> ---
>  libavformat/avformat.h    | 5 +++++
>  libavformat/demux_utils.c | 2 ++
>  2 files changed, 7 insertions(+)
>
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 2e5f2dc795..3508697d42 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1929,6 +1929,7 @@ typedef struct AVFormatContext {
>      int64_t duration_probesize;
>  } AVFormatContext;
>
> +#if FF_API_AVSTREAM_SIDE_DATA
>  /**
>   * This function will cause global side data to be injected in the next packet
>   * of each stream as well as after any subsequent seek.
> @@ -1938,8 +1939,12 @@ typedef struct AVFormatContext {
>   *       in a @ref AVCodecContext.coded_side_data "decoder's side data" array if
>   *       initialized with said stream's codecpar.
>   * @see av_packet_side_data_get()
> + *
> + * @deprecated this function should never be needed

You might want to mention why/what to use instead here.

>   */
> +attribute_deprecated
>  void av_format_inject_global_side_data(AVFormatContext *s);
> +#endif
>
>  #if FF_API_GET_DUR_ESTIMATE_METHOD
>  /**
> diff --git a/libavformat/demux_utils.c b/libavformat/demux_utils.c
> index fd0424524b..9aae521c6c 100644
> --- a/libavformat/demux_utils.c
> +++ b/libavformat/demux_utils.c
> @@ -81,6 +81,7 @@ AVChapter *avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_ba
>      return chapter;
>  }
>
> +#if FF_API_AVSTREAM_SIDE_DATA
>  void av_format_inject_global_side_data(AVFormatContext *s)
>  {
>      FFFormatContext *const si = ffformatcontext(s);
> @@ -90,6 +91,7 @@ void av_format_inject_global_side_data(AVFormatContext *s)
>          ffstream(st)->inject_global_side_data = 1;
>      }
>  }
> +#endif
>
>  int avformat_queue_attached_pictures(AVFormatContext *s)
>  {
> -- 
> 2.43.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 2e5f2dc795..3508697d42 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1929,6 +1929,7 @@  typedef struct AVFormatContext {
     int64_t duration_probesize;
 } AVFormatContext;
 
+#if FF_API_AVSTREAM_SIDE_DATA
 /**
  * This function will cause global side data to be injected in the next packet
  * of each stream as well as after any subsequent seek.
@@ -1938,8 +1939,12 @@  typedef struct AVFormatContext {
  *       in a @ref AVCodecContext.coded_side_data "decoder's side data" array if
  *       initialized with said stream's codecpar.
  * @see av_packet_side_data_get()
+ *
+ * @deprecated this function should never be needed
  */
+attribute_deprecated
 void av_format_inject_global_side_data(AVFormatContext *s);
+#endif
 
 #if FF_API_GET_DUR_ESTIMATE_METHOD
 /**
diff --git a/libavformat/demux_utils.c b/libavformat/demux_utils.c
index fd0424524b..9aae521c6c 100644
--- a/libavformat/demux_utils.c
+++ b/libavformat/demux_utils.c
@@ -81,6 +81,7 @@  AVChapter *avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_ba
     return chapter;
 }
 
+#if FF_API_AVSTREAM_SIDE_DATA
 void av_format_inject_global_side_data(AVFormatContext *s)
 {
     FFFormatContext *const si = ffformatcontext(s);
@@ -90,6 +91,7 @@  void av_format_inject_global_side_data(AVFormatContext *s)
         ffstream(st)->inject_global_side_data = 1;
     }
 }
+#endif
 
 int avformat_queue_attached_pictures(AVFormatContext *s)
 {