diff mbox

[FFmpeg-devel,v4] avfilter/buffersrc: deprecate sws_param option

Message ID 20191204105753.67041-1-quinkblack@foxmail.com
State Superseded
Headers show

Commit Message

Zhao Zhili Dec. 4, 2019, 10:57 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

---
patch v4: update doc

 doc/filters.texi        |  8 ++++----
 libavfilter/buffersrc.c | 14 ++++++++++++--
 libavfilter/version.h   |  5 ++++-
 3 files changed, 20 insertions(+), 7 deletions(-)

Comments

Zhao Zhili Dec. 11, 2019, 3:33 p.m. UTC | #1
Ping for review, thanks!

> On Dec 4, 2019, at 6:57 PM, quinkblack@foxmail.com wrote:
> 
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> ---
> patch v4: update doc
> 
> doc/filters.texi        |  8 ++++----
> libavfilter/buffersrc.c | 14 ++++++++++++--
> libavfilter/version.h   |  5 ++++-
> 3 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 5fdec6f015..d15cf74c84 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -21014,9 +21014,9 @@ Specify the frame rate expected for the video stream.
> The sample (pixel) aspect ratio of the input video.
> 
> @item sws_param
> -Specify the optional parameters to be used for the scale filter which
> -is automatically inserted when an input change is detected in the
> -input size or format.
> +This option is deprecated and ignored. Prepend @code{sws_flags=@var{flags};}
> +to the filtergraph description to specify swscale flags for automatically
> +inserted scalers. See @ref{Filtergraph syntax}.
> 
> @item hw_frames_ctx
> When using a hardware pixel format, this should be a reference to an
> @@ -21041,7 +21041,7 @@ buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
> Alternatively, the options can be specified as a flat string, but this
> syntax is deprecated:
> 
> -@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
> +@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}
> 
> @section cellauto
> 
> diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> index bae7d86695..73a7eb82ca 100644
> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -52,7 +52,9 @@ typedef struct BufferSourceContext {
>     int               w, h;
>     enum AVPixelFormat  pix_fmt;
>     AVRational        pixel_aspect;
> +#if FF_API_SWS_PARAM_OPTION
>     char              *sws_param;
> +#endif
> 
>     AVBufferRef *hw_frames_ctx;
> 
> @@ -287,10 +289,16 @@ static av_cold int init_video(AVFilterContext *ctx)
>     if (!(c->fifo = av_fifo_alloc(sizeof(AVFrame*))))
>         return AVERROR(ENOMEM);
> 
> -    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d sws_param:%s\n",
> +    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d\n",
>            c->w, c->h, av_get_pix_fmt_name(c->pix_fmt),
>            c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
> -           c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
> +           c->pixel_aspect.num, c->pixel_aspect.den);
> +
> +#if FF_API_SWS_PARAM_OPTION
> +    if (c->sws_param)
> +        av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
> +#endif
> +
>     return 0;
> }
> 
> @@ -312,7 +320,9 @@ static const AVOption buffer_options[] = {
>     { "pixel_aspect",  "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
>     { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
>     { "frame_rate",    NULL,                     OFFSET(frame_rate),       AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> +#if FF_API_SWS_PARAM_OPTION
>     { "sws_param",     NULL,                     OFFSET(sws_param),        AV_OPT_TYPE_STRING,                    .flags = V },
> +#endif
>     { NULL },
> };
> 
> diff --git a/libavfilter/version.h b/libavfilter/version.h
> index 7e8d849e0c..bf57d64d1f 100644
> --- a/libavfilter/version.h
> +++ b/libavfilter/version.h
> @@ -31,7 +31,7 @@
> 
> #define LIBAVFILTER_VERSION_MAJOR   7
> #define LIBAVFILTER_VERSION_MINOR  67
> -#define LIBAVFILTER_VERSION_MICRO 100
> +#define LIBAVFILTER_VERSION_MICRO 101
> 
> 
> #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> @@ -59,6 +59,9 @@
> #ifndef FF_API_FILTER_GET_SET
> #define FF_API_FILTER_GET_SET               (LIBAVFILTER_VERSION_MAJOR < 8)
> #endif
> +#ifndef FF_API_SWS_PARAM_OPTION
> +#define FF_API_SWS_PARAM_OPTION             (LIBAVFILTER_VERSION_MAJOR < 8)
> +#endif
> #ifndef FF_API_NEXT
> #define FF_API_NEXT                         (LIBAVFILTER_VERSION_MAJOR < 8)
> #endif
> -- 
> 2.22.0
> 
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> ---
> patch v4: update doc
> 
> doc/filters.texi        |  8 ++++----
> libavfilter/buffersrc.c | 14 ++++++++++++--
> libavfilter/version.h   |  5 ++++-
> 3 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 5fdec6f015..d15cf74c84 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -21014,9 +21014,9 @@ Specify the frame rate expected for the video stream.
> The sample (pixel) aspect ratio of the input video.
> 
> @item sws_param
> -Specify the optional parameters to be used for the scale filter which
> -is automatically inserted when an input change is detected in the
> -input size or format.
> +This option is deprecated and ignored. Prepend @code{sws_flags=@var{flags};}
> +to the filtergraph description to specify swscale flags for automatically
> +inserted scalers. See @ref{Filtergraph syntax}.
> 
> @item hw_frames_ctx
> When using a hardware pixel format, this should be a reference to an
> @@ -21041,7 +21041,7 @@ buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
> Alternatively, the options can be specified as a flat string, but this
> syntax is deprecated:
> 
> -@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
> +@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}
> 
> @section cellauto
> 
> diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> index bae7d86695..73a7eb82ca 100644
> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -52,7 +52,9 @@ typedef struct BufferSourceContext {
>     int               w, h;
>     enum AVPixelFormat  pix_fmt;
>     AVRational        pixel_aspect;
> +#if FF_API_SWS_PARAM_OPTION
>     char              *sws_param;
> +#endif
> 
>     AVBufferRef *hw_frames_ctx;
> 
> @@ -287,10 +289,16 @@ static av_cold int init_video(AVFilterContext *ctx)
>     if (!(c->fifo = av_fifo_alloc(sizeof(AVFrame*))))
>         return AVERROR(ENOMEM);
> 
> -    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d sws_param:%s\n",
> +    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d\n",
>            c->w, c->h, av_get_pix_fmt_name(c->pix_fmt),
>            c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
> -           c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
> +           c->pixel_aspect.num, c->pixel_aspect.den);
> +
> +#if FF_API_SWS_PARAM_OPTION
> +    if (c->sws_param)
> +        av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
> +#endif
> +
>     return 0;
> }
> 
> @@ -312,7 +320,9 @@ static const AVOption buffer_options[] = {
>     { "pixel_aspect",  "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
>     { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
>     { "frame_rate",    NULL,                     OFFSET(frame_rate),       AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> +#if FF_API_SWS_PARAM_OPTION
>     { "sws_param",     NULL,                     OFFSET(sws_param),        AV_OPT_TYPE_STRING,                    .flags = V },
> +#endif
>     { NULL },
> };
> 
> diff --git a/libavfilter/version.h b/libavfilter/version.h
> index 7e8d849e0c..bf57d64d1f 100644
> --- a/libavfilter/version.h
> +++ b/libavfilter/version.h
> @@ -31,7 +31,7 @@
> 
> #define LIBAVFILTER_VERSION_MAJOR   7
> #define LIBAVFILTER_VERSION_MINOR  67
> -#define LIBAVFILTER_VERSION_MICRO 100
> +#define LIBAVFILTER_VERSION_MICRO 101
> 
> 
> #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> @@ -59,6 +59,9 @@
> #ifndef FF_API_FILTER_GET_SET
> #define FF_API_FILTER_GET_SET               (LIBAVFILTER_VERSION_MAJOR < 8)
> #endif
> +#ifndef FF_API_SWS_PARAM_OPTION
> +#define FF_API_SWS_PARAM_OPTION             (LIBAVFILTER_VERSION_MAJOR < 8)
> +#endif
> #ifndef FF_API_NEXT
> #define FF_API_NEXT                         (LIBAVFILTER_VERSION_MAJOR < 8)
> #endif
> -- 
> 2.22.0
>
Jun Zhao Dec. 12, 2019, 7:04 a.m. UTC | #2
On Wed, Dec 11, 2019 at 11:33 PM Zhao Zhili <quinkblack@foxmail.com> wrote:
>
> Ping for review, thanks!
>
> > On Dec 4, 2019, at 6:57 PM, quinkblack@foxmail.com wrote:
> >
> > From: Zhao Zhili <zhilizhao@tencent.com>
> >
> > ---
> > patch v4: update doc
> >
> > doc/filters.texi        |  8 ++++----
> > libavfilter/buffersrc.c | 14 ++++++++++++--
> > libavfilter/version.h   |  5 ++++-
> > 3 files changed, 20 insertions(+), 7 deletions(-)
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 5fdec6f015..d15cf74c84 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -21014,9 +21014,9 @@ Specify the frame rate expected for the video stream.
> > The sample (pixel) aspect ratio of the input video.
> >
> > @item sws_param
> > -Specify the optional parameters to be used for the scale filter which
> > -is automatically inserted when an input change is detected in the
> > -input size or format.
> > +This option is deprecated and ignored. Prepend @code{sws_flags=@var{flags};}
> > +to the filtergraph description to specify swscale flags for automatically
> > +inserted scalers. See @ref{Filtergraph syntax}.
> >
> > @item hw_frames_ctx
> > When using a hardware pixel format, this should be a reference to an
> > @@ -21041,7 +21041,7 @@ buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
> > Alternatively, the options can be specified as a flat string, but this
> > syntax is deprecated:
> >
> > -@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
> > +@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}
> >
> > @section cellauto
> >
> > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> > index bae7d86695..73a7eb82ca 100644
> > --- a/libavfilter/buffersrc.c
> > +++ b/libavfilter/buffersrc.c
> > @@ -52,7 +52,9 @@ typedef struct BufferSourceContext {
> >     int               w, h;
> >     enum AVPixelFormat  pix_fmt;
> >     AVRational        pixel_aspect;
> > +#if FF_API_SWS_PARAM_OPTION
> >     char              *sws_param;
> > +#endif
> >
> >     AVBufferRef *hw_frames_ctx;
> >
> > @@ -287,10 +289,16 @@ static av_cold int init_video(AVFilterContext *ctx)
> >     if (!(c->fifo = av_fifo_alloc(sizeof(AVFrame*))))
> >         return AVERROR(ENOMEM);
> >
> > -    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d sws_param:%s\n",
> > +    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d\n",
> >            c->w, c->h, av_get_pix_fmt_name(c->pix_fmt),
> >            c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
> > -           c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
> > +           c->pixel_aspect.num, c->pixel_aspect.den);
> > +
> > +#if FF_API_SWS_PARAM_OPTION
> > +    if (c->sws_param)
> > +        av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
> > +#endif
> > +
> >     return 0;
> > }
> >
> > @@ -312,7 +320,9 @@ static const AVOption buffer_options[] = {
> >     { "pixel_aspect",  "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> >     { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> >     { "frame_rate",    NULL,                     OFFSET(frame_rate),       AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> > +#if FF_API_SWS_PARAM_OPTION
> >     { "sws_param",     NULL,                     OFFSET(sws_param),        AV_OPT_TYPE_STRING,                    .flags = V },
> > +#endif
> >     { NULL },
> > };
> >
> > diff --git a/libavfilter/version.h b/libavfilter/version.h
> > index 7e8d849e0c..bf57d64d1f 100644
> > --- a/libavfilter/version.h
> > +++ b/libavfilter/version.h
> > @@ -31,7 +31,7 @@
> >
> > #define LIBAVFILTER_VERSION_MAJOR   7
> > #define LIBAVFILTER_VERSION_MINOR  67
> > -#define LIBAVFILTER_VERSION_MICRO 100
> > +#define LIBAVFILTER_VERSION_MICRO 101
> >
> >
> > #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> > @@ -59,6 +59,9 @@
> > #ifndef FF_API_FILTER_GET_SET
> > #define FF_API_FILTER_GET_SET               (LIBAVFILTER_VERSION_MAJOR < 8)
> > #endif
> > +#ifndef FF_API_SWS_PARAM_OPTION
> > +#define FF_API_SWS_PARAM_OPTION             (LIBAVFILTER_VERSION_MAJOR < 8)
> > +#endif
> > #ifndef FF_API_NEXT
> > #define FF_API_NEXT                         (LIBAVFILTER_VERSION_MAJOR < 8)
> > #endif
> > --
> > 2.22.0
> >
> > From: Zhao Zhili <zhilizhao@tencent.com>
> >
> > ---
> > patch v4: update doc
> >
> > doc/filters.texi        |  8 ++++----
> > libavfilter/buffersrc.c | 14 ++++++++++++--
> > libavfilter/version.h   |  5 ++++-
> > 3 files changed, 20 insertions(+), 7 deletions(-)
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 5fdec6f015..d15cf74c84 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -21014,9 +21014,9 @@ Specify the frame rate expected for the video stream.
> > The sample (pixel) aspect ratio of the input video.
> >
> > @item sws_param
> > -Specify the optional parameters to be used for the scale filter which
> > -is automatically inserted when an input change is detected in the
> > -input size or format.
> > +This option is deprecated and ignored. Prepend @code{sws_flags=@var{flags};}
> > +to the filtergraph description to specify swscale flags for automatically
> > +inserted scalers. See @ref{Filtergraph syntax}.
> >
> > @item hw_frames_ctx
> > When using a hardware pixel format, this should be a reference to an
> > @@ -21041,7 +21041,7 @@ buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
> > Alternatively, the options can be specified as a flat string, but this
> > syntax is deprecated:
> >
> > -@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
> > +@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}
> >
> > @section cellauto
> >
> > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> > index bae7d86695..73a7eb82ca 100644
> > --- a/libavfilter/buffersrc.c
> > +++ b/libavfilter/buffersrc.c
> > @@ -52,7 +52,9 @@ typedef struct BufferSourceContext {
> >     int               w, h;
> >     enum AVPixelFormat  pix_fmt;
> >     AVRational        pixel_aspect;
> > +#if FF_API_SWS_PARAM_OPTION
> >     char              *sws_param;
> > +#endif
> >
> >     AVBufferRef *hw_frames_ctx;
> >
> > @@ -287,10 +289,16 @@ static av_cold int init_video(AVFilterContext *ctx)
> >     if (!(c->fifo = av_fifo_alloc(sizeof(AVFrame*))))
> >         return AVERROR(ENOMEM);
> >
> > -    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d sws_param:%s\n",
> > +    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d\n",
> >            c->w, c->h, av_get_pix_fmt_name(c->pix_fmt),
> >            c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
> > -           c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
> > +           c->pixel_aspect.num, c->pixel_aspect.den);
> > +
> > +#if FF_API_SWS_PARAM_OPTION
> > +    if (c->sws_param)
> > +        av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
> > +#endif
> > +
> >     return 0;
> > }
> >
> > @@ -312,7 +320,9 @@ static const AVOption buffer_options[] = {
> >     { "pixel_aspect",  "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> >     { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> >     { "frame_rate",    NULL,                     OFFSET(frame_rate),       AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
> > +#if FF_API_SWS_PARAM_OPTION
> >     { "sws_param",     NULL,                     OFFSET(sws_param),        AV_OPT_TYPE_STRING,                    .flags = V },
> > +#endif
> >     { NULL },
> > };
> >
> > diff --git a/libavfilter/version.h b/libavfilter/version.h
> > index 7e8d849e0c..bf57d64d1f 100644
> > --- a/libavfilter/version.h
> > +++ b/libavfilter/version.h
> > @@ -31,7 +31,7 @@
> >
> > #define LIBAVFILTER_VERSION_MAJOR   7
> > #define LIBAVFILTER_VERSION_MINOR  67
> > -#define LIBAVFILTER_VERSION_MICRO 100
> > +#define LIBAVFILTER_VERSION_MICRO 101
> >
> >
> > #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> > @@ -59,6 +59,9 @@
> > #ifndef FF_API_FILTER_GET_SET
> > #define FF_API_FILTER_GET_SET               (LIBAVFILTER_VERSION_MAJOR < 8)
> > #endif
> > +#ifndef FF_API_SWS_PARAM_OPTION
> > +#define FF_API_SWS_PARAM_OPTION             (LIBAVFILTER_VERSION_MAJOR < 8)
> > +#endif
> > #ifndef FF_API_NEXT
> > #define FF_API_NEXT                         (LIBAVFILTER_VERSION_MAJOR < 8)
> > #endif
> > --
> > 2.22.0
> >
>
LGTM, but  need to wait next release cycle?
Nicolas George Dec. 23, 2019, 12:23 p.m. UTC | #3
mypopy@gmail.com (12019-12-12):
> LGTM, but  need to wait next release cycle?

What do you mean? There is all the necessary code to let the option
disappear automatically at the next release.

I shall push soon, unless you point something I have missed.

Regards,
Zhao Zhili Dec. 28, 2019, 1:27 p.m. UTC | #4
Hi Nicolas,

> On Dec 23, 2019, at 8:23 PM, Nicolas George <george@nsup.org> wrote:
> 
> mypopy@gmail.com (12019-12-12):
>> LGTM, but  need to wait next release cycle?
> 
> What do you mean? There is all the necessary code to let the option
> disappear automatically at the next release.
> 
> I shall push soon, unless you point something I have missed.

Could you help apply the patch?

> 
> Regards,
> 
> -- 
>  Nicolas George
> _______________________________________________
> 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".
Nicolas George Dec. 28, 2019, 2:42 p.m. UTC | #5
zhilizhao (12019-12-28):
> Could you help apply the patch?

Since mypopy does not explain themselves, I will apply. But the patch
needs to be rebased and conflicts resolved.

Regards,
Jun Zhao Dec. 30, 2019, 1:41 a.m. UTC | #6
On Mon, Dec 23, 2019 at 8:23 PM Nicolas George <george@nsup.org> wrote:
>
> mypopy@gmail.com (12019-12-12):
> > LGTM, but  need to wait next release cycle?
>
> What do you mean? There is all the necessary code to let the option
> disappear automatically at the next release.
>
> I shall push soon, unless you point something I have missed.
>
I forgot this strategy (disappear automatically at the next release),
pls push, no other comments
diff mbox

Patch

diff --git a/doc/filters.texi b/doc/filters.texi
index 5fdec6f015..d15cf74c84 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -21014,9 +21014,9 @@  Specify the frame rate expected for the video stream.
 The sample (pixel) aspect ratio of the input video.
 
 @item sws_param
-Specify the optional parameters to be used for the scale filter which
-is automatically inserted when an input change is detected in the
-input size or format.
+This option is deprecated and ignored. Prepend @code{sws_flags=@var{flags};}
+to the filtergraph description to specify swscale flags for automatically
+inserted scalers. See @ref{Filtergraph syntax}.
 
 @item hw_frames_ctx
 When using a hardware pixel format, this should be a reference to an
@@ -21041,7 +21041,7 @@  buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
 Alternatively, the options can be specified as a flat string, but this
 syntax is deprecated:
 
-@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}[:@var{sws_param}]
+@var{width}:@var{height}:@var{pix_fmt}:@var{time_base.num}:@var{time_base.den}:@var{pixel_aspect.num}:@var{pixel_aspect.den}
 
 @section cellauto
 
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index bae7d86695..73a7eb82ca 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -52,7 +52,9 @@  typedef struct BufferSourceContext {
     int               w, h;
     enum AVPixelFormat  pix_fmt;
     AVRational        pixel_aspect;
+#if FF_API_SWS_PARAM_OPTION
     char              *sws_param;
+#endif
 
     AVBufferRef *hw_frames_ctx;
 
@@ -287,10 +289,16 @@  static av_cold int init_video(AVFilterContext *ctx)
     if (!(c->fifo = av_fifo_alloc(sizeof(AVFrame*))))
         return AVERROR(ENOMEM);
 
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d sws_param:%s\n",
+    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d\n",
            c->w, c->h, av_get_pix_fmt_name(c->pix_fmt),
            c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
-           c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
+           c->pixel_aspect.num, c->pixel_aspect.den);
+
+#if FF_API_SWS_PARAM_OPTION
+    if (c->sws_param)
+        av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
+#endif
+
     return 0;
 }
 
@@ -312,7 +320,9 @@  static const AVOption buffer_options[] = {
     { "pixel_aspect",  "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
     { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
     { "frame_rate",    NULL,                     OFFSET(frame_rate),       AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
+#if FF_API_SWS_PARAM_OPTION
     { "sws_param",     NULL,                     OFFSET(sws_param),        AV_OPT_TYPE_STRING,                    .flags = V },
+#endif
     { NULL },
 };
 
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 7e8d849e0c..bf57d64d1f 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@ 
 
 #define LIBAVFILTER_VERSION_MAJOR   7
 #define LIBAVFILTER_VERSION_MINOR  67
-#define LIBAVFILTER_VERSION_MICRO 100
+#define LIBAVFILTER_VERSION_MICRO 101
 
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -59,6 +59,9 @@ 
 #ifndef FF_API_FILTER_GET_SET
 #define FF_API_FILTER_GET_SET               (LIBAVFILTER_VERSION_MAJOR < 8)
 #endif
+#ifndef FF_API_SWS_PARAM_OPTION
+#define FF_API_SWS_PARAM_OPTION             (LIBAVFILTER_VERSION_MAJOR < 8)
+#endif
 #ifndef FF_API_NEXT
 #define FF_API_NEXT                         (LIBAVFILTER_VERSION_MAJOR < 8)
 #endif