diff mbox

[FFmpeg-devel] avcodec/imgconvert: remove deprecation guards for a function that's not declared as such

Message ID 20170824234311.8096-1-jamrial@gmail.com
State Superseded
Headers show

Commit Message

James Almer Aug. 24, 2017, 11:43 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
The deprecation seems to have been imported from libav but never made effective.

 libavcodec/imgconvert.c | 2 --
 libavcodec/version.h    | 3 ---
 2 files changed, 5 deletions(-)

Comments

Paul B Mahol Aug. 25, 2017, 6:53 a.m. UTC | #1
On 8/25/17, James Almer <jamrial@gmail.com> wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> The deprecation seems to have been imported from libav but never made
> effective.
>
>  libavcodec/imgconvert.c | 2 --
>  libavcodec/version.h    | 3 ---
>  2 files changed, 5 deletions(-)
>

OK
wm4 Aug. 25, 2017, 8:06 a.m. UTC | #2
On Thu, 24 Aug 2017 20:43:11 -0300
James Almer <jamrial@gmail.com> wrote:

> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> The deprecation seems to have been imported from libav but never made effective.
> 
>  libavcodec/imgconvert.c | 2 --
>  libavcodec/version.h    | 3 ---
>  2 files changed, 5 deletions(-)
> 
> diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
> index 1547f18966..a349e2a083 100644
> --- a/libavcodec/imgconvert.c
> +++ b/libavcodec/imgconvert.c
> @@ -34,7 +34,6 @@
>  #include "libavutil/internal.h"
>  #include "libavutil/imgutils.h"
>  
> -#if FF_API_GETCHROMA
>  void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
>  {
>      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> @@ -42,7 +41,6 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int
>      *h_shift = desc->log2_chroma_w;
>      *v_shift = desc->log2_chroma_h;
>  }
> -#endif
>  
>  int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
>                               enum AVPixelFormat src_pix_fmt,
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 7473000579..f41b9caa2d 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -60,9 +60,6 @@
>  #ifndef FF_API_AVCODEC_RESAMPLE
>  #define FF_API_AVCODEC_RESAMPLE  FF_API_AUDIO_CONVERT
>  #endif
> -#ifndef FF_API_GETCHROMA
> -#define FF_API_GETCHROMA         (LIBAVCODEC_VERSION_MAJOR < 58)
> -#endif
>  #ifndef FF_API_MISSING_SAMPLE
>  #define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 58)
>  #endif

I don't agree with this.
Paul B Mahol Aug. 25, 2017, 8:15 a.m. UTC | #3
On 8/25/17, wm4 <nfxjfg@googlemail.com> wrote:
> On Thu, 24 Aug 2017 20:43:11 -0300
> James Almer <jamrial@gmail.com> wrote:
>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> The deprecation seems to have been imported from libav but never made
>> effective.
>>
>>  libavcodec/imgconvert.c | 2 --
>>  libavcodec/version.h    | 3 ---
>>  2 files changed, 5 deletions(-)
>>
>> diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
>> index 1547f18966..a349e2a083 100644
>> --- a/libavcodec/imgconvert.c
>> +++ b/libavcodec/imgconvert.c
>> @@ -34,7 +34,6 @@
>>  #include "libavutil/internal.h"
>>  #include "libavutil/imgutils.h"
>>
>> -#if FF_API_GETCHROMA
>>  void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int
>> *h_shift, int *v_shift)
>>  {
>>      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
>> @@ -42,7 +41,6 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat
>> pix_fmt, int *h_shift, int
>>      *h_shift = desc->log2_chroma_w;
>>      *v_shift = desc->log2_chroma_h;
>>  }
>> -#endif
>>
>>  int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
>>                               enum AVPixelFormat src_pix_fmt,
>> diff --git a/libavcodec/version.h b/libavcodec/version.h
>> index 7473000579..f41b9caa2d 100644
>> --- a/libavcodec/version.h
>> +++ b/libavcodec/version.h
>> @@ -60,9 +60,6 @@
>>  #ifndef FF_API_AVCODEC_RESAMPLE
>>  #define FF_API_AVCODEC_RESAMPLE  FF_API_AUDIO_CONVERT
>>  #endif
>> -#ifndef FF_API_GETCHROMA
>> -#define FF_API_GETCHROMA         (LIBAVCODEC_VERSION_MAJOR < 58)
>> -#endif
>>  #ifndef FF_API_MISSING_SAMPLE
>>  #define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 58)
>>  #endif
>
> I don't agree with this.

Why?
wm4 Aug. 25, 2017, 11:04 a.m. UTC | #4
On Fri, 25 Aug 2017 10:15:05 +0200
Paul B Mahol <onemda@gmail.com> wrote:

> On 8/25/17, wm4 <nfxjfg@googlemail.com> wrote:
> > On Thu, 24 Aug 2017 20:43:11 -0300
> > James Almer <jamrial@gmail.com> wrote:
> >  
> >> Signed-off-by: James Almer <jamrial@gmail.com>
> >> ---
> >> The deprecation seems to have been imported from libav but never made
> >> effective.
> >>
> >>  libavcodec/imgconvert.c | 2 --
> >>  libavcodec/version.h    | 3 ---
> >>  2 files changed, 5 deletions(-)
> >>
> >> diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
> >> index 1547f18966..a349e2a083 100644
> >> --- a/libavcodec/imgconvert.c
> >> +++ b/libavcodec/imgconvert.c
> >> @@ -34,7 +34,6 @@
> >>  #include "libavutil/internal.h"
> >>  #include "libavutil/imgutils.h"
> >>
> >> -#if FF_API_GETCHROMA
> >>  void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int
> >> *h_shift, int *v_shift)
> >>  {
> >>      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> >> @@ -42,7 +41,6 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat
> >> pix_fmt, int *h_shift, int
> >>      *h_shift = desc->log2_chroma_w;
> >>      *v_shift = desc->log2_chroma_h;
> >>  }
> >> -#endif
> >>
> >>  int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
> >>                               enum AVPixelFormat src_pix_fmt,
> >> diff --git a/libavcodec/version.h b/libavcodec/version.h
> >> index 7473000579..f41b9caa2d 100644
> >> --- a/libavcodec/version.h
> >> +++ b/libavcodec/version.h
> >> @@ -60,9 +60,6 @@
> >>  #ifndef FF_API_AVCODEC_RESAMPLE
> >>  #define FF_API_AVCODEC_RESAMPLE  FF_API_AUDIO_CONVERT
> >>  #endif
> >> -#ifndef FF_API_GETCHROMA
> >> -#define FF_API_GETCHROMA         (LIBAVCODEC_VERSION_MAJOR < 58)
> >> -#endif
> >>  #ifndef FF_API_MISSING_SAMPLE
> >>  #define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 58)
> >>  #endif  
> >
> > I don't agree with this.  
> 
> Why?

The function should be removed.
Ronald S. Bultje Aug. 25, 2017, 11:10 a.m. UTC | #5
Hi,

On Thu, Aug 24, 2017 at 7:43 PM, James Almer <jamrial@gmail.com> wrote:

> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> The deprecation seems to have been imported from libav but never made
> effective.


Hm, but do we really want this function? Shouldn't all users be ported to
the function this wraps?

Ronald
James Almer Aug. 25, 2017, 2:04 p.m. UTC | #6
On 8/25/2017 8:10 AM, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, Aug 24, 2017 at 7:43 PM, James Almer <jamrial@gmail.com> wrote:
> 
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> The deprecation seems to have been imported from libav but never made
>> effective.
> 
> 
> Hm, but do we really want this function? Shouldn't all users be ported to
> the function this wraps?

I don't know. The Doxy even acknowledges there's an alternative but
mentions its use case is apparently different, which is probably why
the deprecation wasn't made effective.

If the function really needs to go, then the deprecated attribute should
be added to the header. And from that point the ~2 years deprecation
period starts.

> 
> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
Ronald S. Bultje Aug. 25, 2017, 2:39 p.m. UTC | #7
Hi,

On Fri, Aug 25, 2017 at 10:04 AM, James Almer <jamrial@gmail.com> wrote:

> On 8/25/2017 8:10 AM, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Thu, Aug 24, 2017 at 7:43 PM, James Almer <jamrial@gmail.com> wrote:
> >
> >> Signed-off-by: James Almer <jamrial@gmail.com>
> >> ---
> >> The deprecation seems to have been imported from libav but never made
> >> effective.
> >
> >
> > Hm, but do we really want this function? Shouldn't all users be ported to
> > the function this wraps?
>
> I don't know. The Doxy even acknowledges there's an alternative but
> mentions its use case is apparently different, which is probably why
> the deprecation wasn't made effective.
>

We should all acknowledge fully that there is a use case for
memcpy_inverted(source, destination, size), yet libc does not define it. I
don't know why. It's silly. I feel libc is being racist.

Silliness aside, let's not have multiple APIs that do the same thing.

If the function really needs to go, then the deprecated attribute should
> be added to the header. And from that point the ~2 years deprecation
> period starts.


Sure, operationally I don't really care, as long as the end product is that
it goes away.

Fork nastiness aside, I feel that one thing Libav does have a much better
handle on than us is API cleanliness.

Ronald
James Almer Aug. 25, 2017, 3:12 p.m. UTC | #8
On 8/25/2017 11:39 AM, Ronald S. Bultje wrote:
> Hi,
> 
> On Fri, Aug 25, 2017 at 10:04 AM, James Almer <jamrial@gmail.com> wrote:
> 
>> On 8/25/2017 8:10 AM, Ronald S. Bultje wrote:
>>> Hi,
>>>
>>> On Thu, Aug 24, 2017 at 7:43 PM, James Almer <jamrial@gmail.com> wrote:
>>>
>>>> Signed-off-by: James Almer <jamrial@gmail.com>
>>>> ---
>>>> The deprecation seems to have been imported from libav but never made
>>>> effective.
>>>
>>>
>>> Hm, but do we really want this function? Shouldn't all users be ported to
>>> the function this wraps?
>>
>> I don't know. The Doxy even acknowledges there's an alternative but
>> mentions its use case is apparently different, which is probably why
>> the deprecation wasn't made effective.
>>
> 
> We should all acknowledge fully that there is a use case for
> memcpy_inverted(source, destination, size), yet libc does not define it. I
> don't know why. It's silly. I feel libc is being racist.
> 
> Silliness aside, let's not have multiple APIs that do the same thing.
> 
> If the function really needs to go, then the deprecated attribute should
>> be added to the header. And from that point the ~2 years deprecation
>> period starts.
> 
> 
> Sure, operationally I don't really care, as long as the end product is that
> it goes away.

Ok, patch dropped and a new one sent that effectively deprecates the
function.

> 
> Fork nastiness aside, I feel that one thing Libav does have a much better
> handle on than us is API cleanliness.
> 
> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
diff mbox

Patch

diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 1547f18966..a349e2a083 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -34,7 +34,6 @@ 
 #include "libavutil/internal.h"
 #include "libavutil/imgutils.h"
 
-#if FF_API_GETCHROMA
 void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
 {
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
@@ -42,7 +41,6 @@  void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int
     *h_shift = desc->log2_chroma_w;
     *v_shift = desc->log2_chroma_h;
 }
-#endif
 
 int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
                              enum AVPixelFormat src_pix_fmt,
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 7473000579..f41b9caa2d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -60,9 +60,6 @@ 
 #ifndef FF_API_AVCODEC_RESAMPLE
 #define FF_API_AVCODEC_RESAMPLE  FF_API_AUDIO_CONVERT
 #endif
-#ifndef FF_API_GETCHROMA
-#define FF_API_GETCHROMA         (LIBAVCODEC_VERSION_MAJOR < 58)
-#endif
 #ifndef FF_API_MISSING_SAMPLE
 #define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 58)
 #endif