diff mbox series

[FFmpeg-devel] lswr: take const AVChannelLayout* in swr_alloc_set_opts2()

Message ID 20220805210039.4158-1-rcombs@rcombs.me
State Accepted
Commit 9546b3a1cbcd94e9107f85c8f1d2175efc6cf083
Headers show
Series [FFmpeg-devel] lswr: take const AVChannelLayout* in swr_alloc_set_opts2() | 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

rcombs Aug. 5, 2022, 9 p.m. UTC
This is fully backwards-compatible in both ABI and API,
so it's only a minor bump.
---
 libswresample/swresample.c | 4 ++--
 libswresample/swresample.h | 4 ++--
 libswresample/version.h    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Andreas Rheinhardt Aug. 6, 2022, 11:50 a.m. UTC | #1
rcombs:
> This is fully backwards-compatible in both ABI and API,
> so it's only a minor bump.

It is not fully backwards-compatible API-wise: If you use a function
pointer for swr_alloc_set_opts2 by hardcoding its type, you will get
warnings now (or even errors depending upon your -Werror; it is an error
by default for C++). Given that I do not know about other language
bindings I have so far refrained from applying
https://patchwork.ffmpeg.org/project/ffmpeg/patch/AS1PR01MB95649A21F5F9A45D40E6AC1D8F1F9@AS1PR01MB9564.eurprd01.prod.exchangelabs.com/
This does not mean that I block your patch; to the contrary: If it
breaks nothing, I will apply the above patch after a month or so.

- Andreas

> ---
>  libswresample/swresample.c | 4 ++--
>  libswresample/swresample.h | 4 ++--
>  libswresample/version.h    | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libswresample/swresample.c b/libswresample/swresample.c
> index 9b77ef65bf..123ac65693 100644
> --- a/libswresample/swresample.c
> +++ b/libswresample/swresample.c
> @@ -83,8 +83,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  #endif
>  
>  int swr_alloc_set_opts2(struct SwrContext **ps,
> -                        AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
> -                        AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
> +                        const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
> +                        const AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
>                          int log_offset, void *log_ctx) {
>      struct SwrContext *s = *ps;
>      int ret;
> diff --git a/libswresample/swresample.h b/libswresample/swresample.h
> index 26d42fab8d..980be65783 100644
> --- a/libswresample/swresample.h
> +++ b/libswresample/swresample.h
> @@ -286,8 +286,8 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
>   *         On error, the Swr context is freed and *ps set to NULL.
>   */
>  int swr_alloc_set_opts2(struct SwrContext **ps,
> -                        AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
> -                        AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
> +                        const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
> +                        const AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
>                          int log_offset, void *log_ctx);
>  /**
>   * @}
> diff --git a/libswresample/version.h b/libswresample/version.h
> index 66bac2fa9b..4b9952d914 100644
> --- a/libswresample/version.h
> +++ b/libswresample/version.h
> @@ -30,7 +30,7 @@
>  
>  #include "version_major.h"
>  
> -#define LIBSWRESAMPLE_VERSION_MINOR   8
> +#define LIBSWRESAMPLE_VERSION_MINOR   9
>  #define LIBSWRESAMPLE_VERSION_MICRO 100
>  
>  #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
Anton Khirnov Aug. 6, 2022, 1:15 p.m. UTC | #2
Quoting Andreas Rheinhardt (2022-08-06 13:50:37)
> rcombs:
> > This is fully backwards-compatible in both ABI and API,
> > so it's only a minor bump.
> 
> It is not fully backwards-compatible API-wise: If you use a function
> pointer for swr_alloc_set_opts2 by hardcoding its type, you will get
> warnings now (or even errors depending upon your -Werror; it is an error
> by default for C++). Given that I do not know about other language
> bindings I have so far refrained from applying
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/AS1PR01MB95649A21F5F9A45D40E6AC1D8F1F9@AS1PR01MB9564.eurprd01.prod.exchangelabs.com/
> This does not mean that I block your patch; to the contrary: If it
> breaks nothing, I will apply the above patch after a month or so.

Maybe now could be a good time for a major bump, since we just had a
release. It's also been two releases since the last one.
Anton Khirnov Aug. 6, 2022, 1:19 p.m. UTC | #3
Quoting Anton Khirnov (2022-08-06 15:15:58)
> Quoting Andreas Rheinhardt (2022-08-06 13:50:37)
> > rcombs:
> > > This is fully backwards-compatible in both ABI and API,
> > > so it's only a minor bump.
> > 
> > It is not fully backwards-compatible API-wise: If you use a function
> > pointer for swr_alloc_set_opts2 by hardcoding its type, you will get
> > warnings now (or even errors depending upon your -Werror; it is an error
> > by default for C++). Given that I do not know about other language
> > bindings I have so far refrained from applying
> > https://patchwork.ffmpeg.org/project/ffmpeg/patch/AS1PR01MB95649A21F5F9A45D40E6AC1D8F1F9@AS1PR01MB9564.eurprd01.prod.exchangelabs.com/
> > This does not mean that I block your patch; to the contrary: If it
> > breaks nothing, I will apply the above patch after a month or so.
> 
> Maybe now could be a good time for a major bump, since we just had a
> release. It's also been two releases since the last one.

I would also love to finally get rid of FF_API_THREAD_SAFE_CALLBACKS
diff mbox series

Patch

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 9b77ef65bf..123ac65693 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -83,8 +83,8 @@  FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
 int swr_alloc_set_opts2(struct SwrContext **ps,
-                        AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
-                        AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
+                        const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+                        const AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
                         int log_offset, void *log_ctx) {
     struct SwrContext *s = *ps;
     int ret;
diff --git a/libswresample/swresample.h b/libswresample/swresample.h
index 26d42fab8d..980be65783 100644
--- a/libswresample/swresample.h
+++ b/libswresample/swresample.h
@@ -286,8 +286,8 @@  struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
  *         On error, the Swr context is freed and *ps set to NULL.
  */
 int swr_alloc_set_opts2(struct SwrContext **ps,
-                        AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
-                        AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
+                        const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+                        const AVChannelLayout *in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
                         int log_offset, void *log_ctx);
 /**
  * @}
diff --git a/libswresample/version.h b/libswresample/version.h
index 66bac2fa9b..4b9952d914 100644
--- a/libswresample/version.h
+++ b/libswresample/version.h
@@ -30,7 +30,7 @@ 
 
 #include "version_major.h"
 
-#define LIBSWRESAMPLE_VERSION_MINOR   8
+#define LIBSWRESAMPLE_VERSION_MINOR   9
 #define LIBSWRESAMPLE_VERSION_MICRO 100
 
 #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \