From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3E166487DB for ; Mon, 18 Dec 2023 09:59:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E744868D2B1; Mon, 18 Dec 2023 11:58:12 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CABD068D1F2 for ; Mon, 18 Dec 2023 11:58:00 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 6B0981CC2 for ; Mon, 18 Dec 2023 10:57:57 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id vF4iXWJ5Dhvv for ; Mon, 18 Dec 2023 10:57:57 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 9610B3E17 for ; Mon, 18 Dec 2023 10:57:51 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id C7A853A097D for ; Mon, 18 Dec 2023 10:57:44 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Dec 2023 10:57:21 +0100 Message-ID: <20231218095722.25879-19-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231218095722.25879-1-anton@khirnov.net> References: <20231218095722.25879-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 19/20] fftools/ffmpeg: mark -vsync for future removal X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: It has already been deprecated over a year ago. --- fftools/ffmpeg.h | 1 + fftools/ffmpeg_mux_init.c | 4 ++++ fftools/ffmpeg_opt.c | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 1a8254d422..7d55e384d3 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -61,6 +61,7 @@ #define FFMPEG_OPT_TOP 1 #define FFMPEG_OPT_FORCE_KF_SOURCE_NO_DROP 1 #define FFMPEG_OPT_VSYNC_DROP 1 +#define FFMPEG_OPT_VSYNC 1 #define FFMPEG_ERROR_RATE_EXCEEDED FFERRTAG('E', 'R', 'E', 'D') diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 5ab3f14a01..f5e92de8a9 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -755,7 +755,11 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, av_log(ost, AV_LOG_WARNING, "-top is deprecated, use the setfield filter instead\n"); #endif +#if FFMPEG_OPT_VSYNC ost->vsync_method = video_sync_method; +#else + ost->vsync_method = VSYNC_AUTO; +#endif MATCH_PER_STREAM_OPT(fps_mode, str, fps_mode, oc, st); if (fps_mode) { ret = parse_and_set_vsync(fps_mode, &ost->vsync_method, ost->file->index, ost->index, 0); diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index d6de997af8..2984c494cd 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -62,7 +62,9 @@ float audio_drift_threshold = 0.1; float dts_delta_threshold = 10; float dts_error_threshold = 3600*30; +#if FFMPEG_OPT_VSYNC enum VideoSyncMethod video_sync_method = VSYNC_AUTO; +#endif float frame_drop_threshold = 0; int do_benchmark = 0; int do_benchmark_all = 0; @@ -205,6 +207,7 @@ int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_id return AVERROR(EINVAL); } +#if FFMPEG_OPT_VSYNC if (is_global && *vsync_var == VSYNC_AUTO) { int ret; double num; @@ -217,6 +220,8 @@ int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_id av_log(NULL, AV_LOG_WARNING, "Passing a number to -vsync is deprecated," " use a string argument as described in the manual.\n"); } +#endif + return 0; } @@ -1136,11 +1141,13 @@ static int opt_audio_filters(void *optctx, const char *opt, const char *arg) return parse_option(o, "filter:a", arg, options); } +#if FFMPEG_OPT_VSYNC static int opt_vsync(void *optctx, const char *opt, const char *arg) { av_log(NULL, AV_LOG_WARNING, "-vsync is deprecated. Use -fps_mode\n"); return parse_and_set_vsync(arg, &video_sync_method, -1, -1, 1); } +#endif static int opt_timecode(void *optctx, const char *opt, const char *arg) { @@ -1563,9 +1570,6 @@ const OptionDef options[] = { { .func_arg = opt_target }, "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" " "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")", "type" }, - { "vsync", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, - { .func_arg = opt_vsync }, - "set video sync method globally; deprecated, use -fps_mode", "" }, { "frame_drop_threshold", OPT_TYPE_FLOAT, OPT_EXPERT, { &frame_drop_threshold }, "frame drop threshold", "" }, @@ -2003,6 +2007,11 @@ const OptionDef options[] = { { .func_arg = opt_qphist }, "deprecated, does nothing" }, #endif +#if FFMPEG_OPT_VSYNC + { "vsync", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, + { .func_arg = opt_vsync }, + "set video sync method globally; deprecated, use -fps_mode", "" }, +#endif { NULL, }, }; -- 2.42.0 _______________________________________________ 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".