diff mbox

[FFmpeg-devel] lavr: deprecate the entire library

Message ID 20171225021238.1318-1-atomnuker@gmail.com
State Superseded
Headers show

Commit Message

Rostislav Pehlivanov Dec. 25, 2017, 2:12 a.m. UTC
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
---
 doc/APIchanges             |  5 +++++
 libavresample/avresample.h | 30 +++++++++++++++++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)

Comments

wm4 Dec. 25, 2017, 6:50 a.m. UTC | #1
On Mon, 25 Dec 2017 02:12:38 +0000
Rostislav Pehlivanov <atomnuker@gmail.com> wrote:

> Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
> ---
>  doc/APIchanges             |  5 +++++
>  libavresample/avresample.h | 30 +++++++++++++++++++++++++-----
>  2 files changed, 30 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index df79758e86..96fad416d5 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,11 @@ libavutil:     2017-10-21
>  
>  API changes, most recent first:
>  
> +2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h
> +  Deprecate the entire library. It was unmaintained and redundant
> +  as libswresample did everything it did better, faster, with more
> +  control and with a better, slightly higher level API.
> +

I don't strongly disagree with the wording and also with the
"deprecation", and I think we should build avr by default instead.
Rostislav Pehlivanov Dec. 25, 2017, 10:44 a.m. UTC | #2
On 25 December 2017 at 06:50, wm4 <nfxjfg@googlemail.com> wrote:

> On Mon, 25 Dec 2017 02:12:38 +0000
> Rostislav Pehlivanov <atomnuker@gmail.com> wrote:
>
> > Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
> > ---
> >  doc/APIchanges             |  5 +++++
> >  libavresample/avresample.h | 30 +++++++++++++++++++++++++-----
> >  2 files changed, 30 insertions(+), 5 deletions(-)
> >
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index df79758e86..96fad416d5 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,11 @@ libavutil:     2017-10-21
> >
> >  API changes, most recent first:
> >
> > +2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h
> > +  Deprecate the entire library. It was unmaintained and redundant
> > +  as libswresample did everything it did better, faster, with more
> > +  control and with a better, slightly higher level API.
> > +
>
> I don't strongly disagree with the wording and also with the
> "deprecation", and I think we should build avr by default instead.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Suggest better wording then.
I strongly disagree with your suggestion to make avr the default. That
would undermine all the work that's being and was done on making a better,
faster resampling library just because someone wants to keep compatibility
with a dead project.
For someone who's complaining about the codebase being full of junk you
sure seem lenient towards having 2 resampling libraries and 2 filters to do
resampling, Not to mention its a big security attach surface that's just
waiting to be found. No one wants to work on it, no one has even worked on
it in any capacity in the past 2 or 3 years. Even the original author's
disappeared. And as we've discovered today its also being bitrotten by
lavu. As for the "but many programs do use it!" argument, that's also junk.
You ought to know how much the API's changed over the past years and how
its going to completely break those users in 2 years when the old lavc api
is gone. This is no different, its just another API deprecation. I'd agree
to call it "deprecate the lavr API" if you think its more diplomatic.
Point is, there's no reason to keep it, not political, nor technical. And
many people agree, as the thread last month has shown.
wm4 Dec. 25, 2017, 11:03 a.m. UTC | #3
On Mon, 25 Dec 2017 10:44:40 +0000
Rostislav Pehlivanov <atomnuker@gmail.com> wrote:

> On 25 December 2017 at 06:50, wm4 <nfxjfg@googlemail.com> wrote:
> 
> > On Mon, 25 Dec 2017 02:12:38 +0000
> > Rostislav Pehlivanov <atomnuker@gmail.com> wrote:
> >  
> > > Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
> > > ---
> > >  doc/APIchanges             |  5 +++++
> > >  libavresample/avresample.h | 30 +++++++++++++++++++++++++-----
> > >  2 files changed, 30 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/doc/APIchanges b/doc/APIchanges
> > > index df79758e86..96fad416d5 100644
> > > --- a/doc/APIchanges
> > > +++ b/doc/APIchanges
> > > @@ -15,6 +15,11 @@ libavutil:     2017-10-21
> > >
> > >  API changes, most recent first:
> > >
> > > +2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h
> > > +  Deprecate the entire library. It was unmaintained and redundant
> > > +  as libswresample did everything it did better, faster, with more
> > > +  control and with a better, slightly higher level API.
> > > +  
> >
> > I don't strongly disagree with the wording and also with the
> > "deprecation", and I think we should build avr by default instead.
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >  
> 
> Suggest better wording then.
> I strongly disagree with your suggestion to make avr the default. That

Not the default, just build it by default.

> would undermine all the work that's being and was done on making a better,
> faster resampling library just because someone wants to keep compatibility
> with a dead project.

What you call "dead project" did basically all of the hardware
transcoding improvements that were merged into ffmpeg. How very
insincere of you.

> For someone who's complaining about the codebase being full of junk you
> sure seem lenient towards having 2 resampling libraries and 2 filters to do

Had I been around, I'd have prevented libswresample, which was a bad
NIH of libavresample.

I think you should port all improvements to libavresample, and delete
the redundant libswresample. But that would be a honest act!
Rostislav Pehlivanov Dec. 25, 2017, 11:57 a.m. UTC | #4
On 25 December 2017 at 11:03, wm4 <nfxjfg@googlemail.com> wrote:

> On Mon, 25 Dec 2017 10:44:40 +0000
> Rostislav Pehlivanov <atomnuker@gmail.com> wrote:
>
> > On 25 December 2017 at 06:50, wm4 <nfxjfg@googlemail.com> wrote:
> >
> > > On Mon, 25 Dec 2017 02:12:38 +0000
> > > Rostislav Pehlivanov <atomnuker@gmail.com> wrote:
> > >
> > > > Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
> > > > ---
> > > >  doc/APIchanges             |  5 +++++
> > > >  libavresample/avresample.h | 30 +++++++++++++++++++++++++-----
> > > >  2 files changed, 30 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/doc/APIchanges b/doc/APIchanges
> > > > index df79758e86..96fad416d5 100644
> > > > --- a/doc/APIchanges
> > > > +++ b/doc/APIchanges
> > > > @@ -15,6 +15,11 @@ libavutil:     2017-10-21
> > > >
> > > >  API changes, most recent first:
> > > >
> > > > +2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h
> > > > +  Deprecate the entire library. It was unmaintained and redundant
> > > > +  as libswresample did everything it did better, faster, with more
> > > > +  control and with a better, slightly higher level API.
> > > > +
> > >
> > > I don't strongly disagree with the wording and also with the
> > > "deprecation", and I think we should build avr by default instead.
> > > _______________________________________________
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >
> >
> > Suggest better wording then.
> > I strongly disagree with your suggestion to make avr the default. That
>
> Not the default, just build it by default.
>
> > would undermine all the work that's being and was done on making a
> better,
> > faster resampling library just because someone wants to keep
> compatibility
> > with a dead project.
>
> What you call "dead project" did basically all of the hardware
> transcoding improvements that were merged into ffmpeg. How very
> insincere of you.
>

Didn't mean dead as an offense, just as an honest fact. Have you seen their
ML these past months? 23 times less mails than here just this month. 13
times for the previous month. Similar commits wise.



> > For someone who's complaining about the codebase being full of junk you
> > sure seem lenient towards having 2 resampling libraries and 2 filters to
> do
>
> Had I been around, I'd have prevented libswresample, which was a bad
> NIH of libavresample.
>

Actually it was the opposite, lswr was first and lavr was a NIH which
someone got paid to do. ubitux knows.



> I think you should port all improvements to libavresample, and delete
> the redundant libswresample. But that would be a honest act!
>

I think its more dishonest to try to whatabout about a past merge than it
is to face the truth.
You know what's most honest *and* productive? Constructively pointing out
where lswr sucks, and better yet, sending a patch to improve it.
Clément Bœsch Dec. 25, 2017, 12:59 p.m. UTC | #5
On Mon, Dec 25, 2017 at 11:57:31AM +0000, Rostislav Pehlivanov wrote:
[...]
> > What you call "dead project" did basically all of the hardware
> > transcoding improvements that were merged into ffmpeg. How very
> > insincere of you.
> >
> 
> Didn't mean dead as an offense, just as an honest fact. Have you seen their
> ML these past months? 23 times less mails than here just this month. 13
> times for the previous month. Similar commits wise.
> 

Not actively developed doesn't mean unmaintained.

[...]

I suggested an alternative wording in another thread, something along the
lines "libavresample is not maintained *in FFmpeg* and duplicates
functionalities with libswresample". You could follow with "lavr has been
copied in our source tree years ago and left untouched for compatibility
with the Libav project but maintaining both libswresample and
libavresample is not good for the durability and consistency of the FFmpeg
project. We decided to keep our implementation since it's overall
considered better from our point of view."

No need to keep up the bad vibes. It served its purpose and dropping
libavresample will cause enough problems to our users, we don't need to be
dicks in our political statements.

So again, I support the patch, but not its announce form. I'd advise to be
wise with how we take political stands, being aggressive will not deserve
us.

Regards,
diff mbox

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index df79758e86..96fad416d5 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,11 @@  libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2017-xx-xx - xxxxxxx - lavr 4.0.0 - avresample.h
+  Deprecate the entire library. It was unmaintained and redundant
+  as libswresample did everything it did better, faster, with more
+  control and with a better, slightly higher level API.
+
 2017-12-xx - xxxxxxx - lavu 56.7.100 - cpu.h
   AVX-512 flags added.
 
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index 193443e2a6..57889c572c 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -103,10 +103,10 @@ 
 
 #define AVRESAMPLE_MAX_CHANNELS 32
 
-typedef struct AVAudioResampleContext AVAudioResampleContext;
+typedef attribute_deprecated struct AVAudioResampleContext AVAudioResampleContext;
 
 /** Mixing Coefficient Types */
-enum AVMixCoeffType {
+enum attribute_deprecated AVMixCoeffType {
     AV_MIX_COEFF_TYPE_Q8,   /** 16-bit 8.8 fixed-point                      */
     AV_MIX_COEFF_TYPE_Q15,  /** 32-bit 17.15 fixed-point                    */
     AV_MIX_COEFF_TYPE_FLT,  /** floating-point                              */
@@ -114,13 +114,13 @@  enum AVMixCoeffType {
 };
 
 /** Resampling Filter Types */
-enum AVResampleFilterType {
+enum attribute_deprecated AVResampleFilterType {
     AV_RESAMPLE_FILTER_TYPE_CUBIC,              /**< Cubic */
     AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
     AV_RESAMPLE_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
 };
 
-enum AVResampleDitherMethod {
+enum attribute_deprecated AVResampleDitherMethod {
     AV_RESAMPLE_DITHER_NONE,            /**< Do not use dithering */
     AV_RESAMPLE_DITHER_RECTANGULAR,     /**< Rectangular Dither */
     AV_RESAMPLE_DITHER_TRIANGULAR,      /**< Triangular Dither*/
@@ -132,17 +132,20 @@  enum AVResampleDitherMethod {
 /**
  * Return the LIBAVRESAMPLE_VERSION_INT constant.
  */
+attribute_deprecated
 unsigned avresample_version(void);
 
 /**
  * Return the libavresample build-time configuration.
  * @return  configure string
  */
+attribute_deprecated
 const char *avresample_configuration(void);
 
 /**
  * Return the libavresample license.
  */
+attribute_deprecated
 const char *avresample_license(void);
 
 /**
@@ -155,6 +158,7 @@  const char *avresample_license(void);
  *
  * @return AVClass for AVAudioResampleContext
  */
+attribute_deprecated
 const AVClass *avresample_get_class(void);
 
 /**
@@ -162,6 +166,7 @@  const AVClass *avresample_get_class(void);
  *
  * @return  allocated audio resample context, or NULL on failure
  */
+attribute_deprecated
 AVAudioResampleContext *avresample_alloc_context(void);
 
 /**
@@ -178,6 +183,7 @@  AVAudioResampleContext *avresample_alloc_context(void);
  * @param avr  audio resample context
  * @return     0 on success, negative AVERROR code on failure
  */
+attribute_deprecated
 int avresample_open(AVAudioResampleContext *avr);
 
 /**
@@ -186,6 +192,7 @@  int avresample_open(AVAudioResampleContext *avr);
  * @param avr AVAudioResampleContext to check
  * @return 1 if avr is open, 0 if avr is closed.
  */
+attribute_deprecated
 int avresample_is_open(AVAudioResampleContext *avr);
 
 /**
@@ -201,6 +208,7 @@  int avresample_is_open(AVAudioResampleContext *avr);
  *
  * @param avr  audio resample context
  */
+attribute_deprecated
 void avresample_close(AVAudioResampleContext *avr);
 
 /**
@@ -210,6 +218,7 @@  void avresample_close(AVAudioResampleContext *avr);
  *
  * @param avr  audio resample context
  */
+attribute_deprecated
 void avresample_free(AVAudioResampleContext **avr);
 
 /**
@@ -234,6 +243,7 @@  void avresample_free(AVAudioResampleContext **avr);
  * @param matrix_encoding     matrixed stereo downmix mode (e.g. dplii)
  * @return                    0 on success, negative AVERROR code on failure
  */
+attribute_deprecated
 int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
                             double center_mix_level, double surround_mix_level,
                             double lfe_mix_level, int normalize, double *matrix,
@@ -251,6 +261,7 @@  int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
  * @param stride  distance between adjacent input channels in the matrix array
  * @return        0 on success, negative AVERROR code on failure
  */
+attribute_deprecated
 int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
                           int stride);
 
@@ -272,6 +283,7 @@  int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
  * @param stride  distance between adjacent input channels in the matrix array
  * @return        0 on success, negative AVERROR code on failure
  */
+attribute_deprecated
 int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
                           int stride);
 
@@ -302,6 +314,7 @@  int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
  * @param channel_map customized input channel mapping
  * @return            0 on success, negative AVERROR code on failure
  */
+attribute_deprecated
 int avresample_set_channel_mapping(AVAudioResampleContext *avr,
                                    const int *channel_map);
 
@@ -318,6 +331,7 @@  int avresample_set_channel_mapping(AVAudioResampleContext *avr,
  * @param compensation_distance  compensation distance, in samples
  * @return                       0 on success, negative AVERROR code on failure
  */
+attribute_deprecated
 int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
                                 int compensation_distance);
 
@@ -331,7 +345,7 @@  int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
  * @return              number of samples or AVERROR(EINVAL) if the value
  *                      would exceed INT_MAX
  */
-
+attribute_deprecated
 int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
 
 /**
@@ -376,6 +390,7 @@  int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
  *                        not including converted samples added to the internal
  *                        output FIFO
  */
+attribute_deprecated
 int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
                        int out_plane_size, int out_samples,
                        uint8_t * const *input, int in_plane_size,
@@ -394,6 +409,7 @@  int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
  * @param avr  audio resample context
  * @return     number of samples currently in the resampling delay buffer
  */
+attribute_deprecated
 int avresample_get_delay(AVAudioResampleContext *avr);
 
 /**
@@ -411,6 +427,7 @@  int avresample_get_delay(AVAudioResampleContext *avr);
  * @param avr  audio resample context
  * @return     number of samples available for reading
  */
+attribute_deprecated
 int avresample_available(AVAudioResampleContext *avr);
 
 /**
@@ -430,6 +447,7 @@  int avresample_available(AVAudioResampleContext *avr);
  * @param nb_samples  number of samples to read from the FIFO
  * @return            the number of samples written to output
  */
+attribute_deprecated
 int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
 
 /**
@@ -476,6 +494,7 @@  int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_sample
  * @return                0 on success, AVERROR on failure or nonmatching
  *                        configuration.
  */
+attribute_deprecated
 int avresample_convert_frame(AVAudioResampleContext *avr,
                              AVFrame *output, AVFrame *input);
 
@@ -494,6 +513,7 @@  int avresample_convert_frame(AVAudioResampleContext *avr,
  * @param in              input AVFrame
  * @return                0 on success, AVERROR on failure.
  */
+attribute_deprecated
 int avresample_config(AVAudioResampleContext *avr, AVFrame *out, AVFrame *in);
 
 /**