diff mbox series

[FFmpeg-devel] avcodec: remove pointless lowres deprecation wrappers

Message ID 20210213163223.2618-1-jamrial@gmail.com
State Accepted
Commit 7b30dad3a696cc5423218ba0c11a48b6009a121b
Headers show
Series [FFmpeg-devel] avcodec: remove pointless lowres deprecation wrappers | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

James Almer Feb. 13, 2021, 4:32 p.m. UTC
Neither the feature, public fields, or AVOptions were ever truly deprecated,
and will also not be removed if this FF_API_ define was left in place, so
remove it as it's misleading.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/avcodec.h | 13 -------------
 libavcodec/version.h |  3 ---
 libavformat/utils.c  |  2 --
 3 files changed, 18 deletions(-)

Comments

James Almer Feb. 20, 2021, 2:12 p.m. UTC | #1
On 2/13/2021 1:32 PM, James Almer wrote:
> Neither the feature, public fields, or AVOptions were ever truly deprecated,
> and will also not be removed if this FF_API_ define was left in place, so
> remove it as it's misleading.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   libavcodec/avcodec.h | 13 -------------
>   libavcodec/version.h |  3 ---
>   libavformat/utils.c  |  2 --
>   3 files changed, 18 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 7dbf083a24..5df6a8aedc 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1741,14 +1741,12 @@ typedef struct AVCodecContext {
>        */
>       int bits_per_raw_sample;
>   
> -#if FF_API_LOWRES
>       /**
>        * low resolution decoding, 1-> 1/2 size, 2->1/4 size
>        * - encoding: unused
>        * - decoding: Set by user.
>        */
>        int lowres;
> -#endif
>   
>   #if FF_API_CODED_FRAME
>       /**
> @@ -2084,15 +2082,6 @@ typedef struct AVCodecContext {
>        */
>       const AVCodecDescriptor *codec_descriptor;
>   
> -#if !FF_API_LOWRES
> -    /**
> -     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
> -     * - encoding: unused
> -     * - decoding: Set by user.
> -     */
> -     int lowres;
> -#endif
> -
>       /**
>        * Current statistics for PTS correction.
>        * - decoding: maintained and used by libavcodec, not intended to be used by user apps
> @@ -2366,12 +2355,10 @@ void                     av_codec_set_codec_descriptor(AVCodecContext *avctx, co
>   attribute_deprecated
>   unsigned av_codec_get_codec_properties(const AVCodecContext *avctx);
>   
> -#if FF_API_LOWRES
>   attribute_deprecated
>   int  av_codec_get_lowres(const AVCodecContext *avctx);
>   attribute_deprecated
>   void av_codec_set_lowres(AVCodecContext *avctx, int val);
> -#endif
>   
>   attribute_deprecated
>   int  av_codec_get_seek_preroll(const AVCodecContext *avctx);
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 83dbd1ad63..1eb140a6c9 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -51,9 +51,6 @@
>    * at once through the bump. This improves the git bisect-ability of the change.
>    */
>   
> -#ifndef FF_API_LOWRES
> -#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 59)
> -#endif
>   #ifndef FF_API_AVCTX_TIMEBASE
>   #define FF_API_AVCTX_TIMEBASE    (LIBAVCODEC_VERSION_MAJOR < 59)
>   #endif
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 3e955b85bc..5d40678325 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -4130,7 +4130,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
>           if (ret < 0)
>               goto find_stream_info_err;
>   
> -#if FF_API_LOWRES
>           // The old API (AVStream.codec) "requires" the resolution to be adjusted
>           // by the lowres factor.
>           if (st->internal->avctx->lowres && st->internal->avctx->width) {
> @@ -4138,7 +4137,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
>               st->codec->width = st->internal->avctx->width;
>               st->codec->height = st->internal->avctx->height;
>           }
> -#endif
>   
>           if (st->codec->codec_tag != MKTAG('t','m','c','d')) {
>               st->codec->time_base = st->internal->avctx->time_base;

Will apply soon.
diff mbox series

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7dbf083a24..5df6a8aedc 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1741,14 +1741,12 @@  typedef struct AVCodecContext {
      */
     int bits_per_raw_sample;
 
-#if FF_API_LOWRES
     /**
      * low resolution decoding, 1-> 1/2 size, 2->1/4 size
      * - encoding: unused
      * - decoding: Set by user.
      */
      int lowres;
-#endif
 
 #if FF_API_CODED_FRAME
     /**
@@ -2084,15 +2082,6 @@  typedef struct AVCodecContext {
      */
     const AVCodecDescriptor *codec_descriptor;
 
-#if !FF_API_LOWRES
-    /**
-     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int lowres;
-#endif
-
     /**
      * Current statistics for PTS correction.
      * - decoding: maintained and used by libavcodec, not intended to be used by user apps
@@ -2366,12 +2355,10 @@  void                     av_codec_set_codec_descriptor(AVCodecContext *avctx, co
 attribute_deprecated
 unsigned av_codec_get_codec_properties(const AVCodecContext *avctx);
 
-#if FF_API_LOWRES
 attribute_deprecated
 int  av_codec_get_lowres(const AVCodecContext *avctx);
 attribute_deprecated
 void av_codec_set_lowres(AVCodecContext *avctx, int val);
-#endif
 
 attribute_deprecated
 int  av_codec_get_seek_preroll(const AVCodecContext *avctx);
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 83dbd1ad63..1eb140a6c9 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -51,9 +51,6 @@ 
  * at once through the bump. This improves the git bisect-ability of the change.
  */
 
-#ifndef FF_API_LOWRES
-#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_AVCTX_TIMEBASE
 #define FF_API_AVCTX_TIMEBASE    (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3e955b85bc..5d40678325 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4130,7 +4130,6 @@  FF_DISABLE_DEPRECATION_WARNINGS
         if (ret < 0)
             goto find_stream_info_err;
 
-#if FF_API_LOWRES
         // The old API (AVStream.codec) "requires" the resolution to be adjusted
         // by the lowres factor.
         if (st->internal->avctx->lowres && st->internal->avctx->width) {
@@ -4138,7 +4137,6 @@  FF_DISABLE_DEPRECATION_WARNINGS
             st->codec->width = st->internal->avctx->width;
             st->codec->height = st->internal->avctx->height;
         }
-#endif
 
         if (st->codec->codec_tag != MKTAG('t','m','c','d')) {
             st->codec->time_base = st->internal->avctx->time_base;