From patchwork Wed Dec 4 10:57:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 16586 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1EB0344773B for ; Wed, 4 Dec 2019 12:58:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ECF7F68B2DB; Wed, 4 Dec 2019 12:58:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from qq.com (smtpbg419.qq.com [183.3.226.243]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 073A968B1CE for ; Wed, 4 Dec 2019 12:58:28 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1575457075; bh=ZuCsqXU1qCswfwb8rlE7SXBHOBgg2kWP845d7quHx+Y=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=tW3FhHQDjg4j+zIgT8PJSqH8dVGfo83QUvcYanbSKoVhJtq2RE5MUCmXi5LkBilAs ws6+cgz12myW1wNt00H9wR19jOVsGEur8DxBZHdu2nJJts+L0kmNdlP6v2DNlHxhvG SDyDPhDiFJE0IKGLdKor2VvBI2bkKIoo0T6BGms4= X-QQ-mid: esmtp3t1575457074tam47zkn0 Received: from ZHILIZHAO-MB1.tencent.com (unknown [14.17.22.53]) by esmtp4.qq.com (ESMTP) with id ; Wed, 04 Dec 2019 18:57:53 +0800 (CST) X-QQ-SSF: 01000000000000N0VG3006000000002 X-QQ-FEAT: EUGmOqWjSYLRR8ADnJ/FP6SGxO7BkjsGOBalCbTXBtqYGTx1yASESPLrqQSKB OZvgUPxZk7Jf0PT8Nd/Pq10FYpK0oAqeN+YCzt0jVnqBEW5gBPvJtvG/W0P3pEgEubQCQc3 lLwVitSvxMj7Rs107o3BOYFYsqyHnh7o2BkimZAaan4Opl+1reuLIb4VQ/DUgu2TvFzOjh0 juHy6Pgt/v9v8jTXFnwtvMbSyTKb2qow37SyWikFZ2p7ODJiUOwJKALXb8MhYgt2MR8Pw+E 5r7hflUlxoYCppHbkXBzTLH+Gff97+xJ6bQU21ZirJn+k1 X-QQ-GoodBg: 0 From: quinkblack@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Dec 2019 18:57:53 +0800 Message-Id: <20191204105753.67041-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191204094533.noufmhf4b62hwigt@phare.normalesup.org> References: <20191204094533.noufmhf4b62hwigt@phare.normalesup.org> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign11 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v4] avfilter/buffersrc: deprecate sws_param option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Zhao Zhili --- 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