From patchwork Sat Dec 4 17:41:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 31963 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp2276038iog; Sat, 4 Dec 2021 09:42:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJydha0u4gBHPBxUOArqJkoF5pHtonI91t/h/TNfpG4GyoS4cfuI5gAlGMrB4jl9DULpOBX1 X-Received: by 2002:a17:906:3b54:: with SMTP id h20mr32653149ejf.468.1638639760050; Sat, 04 Dec 2021 09:42:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638639760; cv=none; d=google.com; s=arc-20160816; b=0hsZA6FRN/gTiEWBI1u04ZMpcrgRsAWT/Z7pUE8sTQsfsdTr04Z2IGzHZRazQZMMhf TroTscIvh8sG0r9tIzT63RuqZdmjBGBL5NAZmxTmBvTd/ilUVbqkQwtDxr168fKwTV0Z dpoFTCZIXMvxan+ebHbTqxNYGutqQffc1TaAGOR4+XUUtFbnZVwkK0/pQUGFc0R96i2g NZCUyvfrw14jnJ3J9KO0Oyofe6YqS0kqvGNm3o5JmiligAwoVfyo7BzFB4jZpov8MFaD SbpLmBue4JW73oI0t1mNMAeSU2JiVTi2LC/QA4bvUgjpu+Cc1CwlMQycoPWqZD5AMZPN pK0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=5Ze84qj7GwnbA9+ODgYFFd1lnRewrQj5E6UBDJBbSSQ=; b=UXfbhyMsFkMT15uUOhVt6G6cH25ZyBe83DjfCHAI9z/6SSTKpxUv5xwXetc/a7orgs XUtcfFTn+ZxTKvaLgdd31kn7e9JtyE7MDrOdbckGN1FCg1cZiI+j64QqZxtbDlB7fkyt i6qpXvPf1iHcz3Lxx+uzbk/ekjJoDztGHS1cG+DS4gojl3vfewVEauzJaIMqoZX5/jOR 47i7BuisOO+7gPYQlJpGlDqzPPi0TDEj3xI010+H2yv7jVm9Cf3Yq29fx5poZygsRUB3 Lk/qrgrCmtIIUY/UUH3yTje+PHnce9+e4WMGxgfthVqJL/2w4e7V7EFB3zZeG70oGn6C mBMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f3si8489484ejd.672.2021.12.04.09.42.39; Sat, 04 Dec 2021 09:42:40 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAF2268AEA3; Sat, 4 Dec 2021 19:41:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A37E068AE87 for ; Sat, 4 Dec 2021 19:41:47 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 9173B240506 for ; Sat, 4 Dec 2021 18:41:44 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id v1gXSQsCE7Rq for ; Sat, 4 Dec 2021 18:41:41 +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 mail0.khirnov.net (Postfix) with ESMTPS id 281A724017A for ; Sat, 4 Dec 2021 18:41:41 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 276BE3A02CB; Sat, 4 Dec 2021 18:41:41 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Dec 2021 18:41:14 +0100 Message-Id: <20211204174118.19085-2-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204174118.19085-1-anton@khirnov.net> References: <20211204174118.19085-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] ffmpeg: change vsync value to an enum 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UhPeEDLrxj+8 Stop explicitly defining VSCFR and DROP values, which were never documented. --- fftools/ffmpeg.c | 3 ++- fftools/ffmpeg.h | 16 +++++++++------- fftools/ffmpeg_opt.c | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 1814941266..b1549a1096 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1142,7 +1142,8 @@ static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *next_picture) { - int ret, format_video_sync; + int ret; + enum VideoSyncMethod format_video_sync; AVPacket *pkt = ost->pkt; AVCodecContext *enc = ost->enc_ctx; AVRational frame_rate; diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index cc7ba9bdca..83e37cbed7 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -47,12 +47,14 @@ #include "libswresample/swresample.h" -#define VSYNC_AUTO -1 -#define VSYNC_PASSTHROUGH 0 -#define VSYNC_CFR 1 -#define VSYNC_VFR 2 -#define VSYNC_VSCFR 0xfe -#define VSYNC_DROP 0xff +enum VideoSyncMethod { + VSYNC_AUTO = -1, + VSYNC_PASSTHROUGH, + VSYNC_CFR, + VSYNC_VFR, + VSYNC_VSCFR, + VSYNC_DROP, +}; #define MAX_STREAMS 1024 /* arbitrary sanity check value */ @@ -605,7 +607,7 @@ extern float dts_error_threshold; extern int audio_volume; extern int audio_sync_method; -extern int video_sync_method; +extern enum VideoSyncMethod video_sync_method; extern float frame_drop_threshold; extern int do_benchmark; extern int do_benchmark_all; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 6c2eb53290..585e1018a3 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -146,7 +146,7 @@ float dts_error_threshold = 3600*30; int audio_volume = 256; int audio_sync_method = 0; -int video_sync_method = VSYNC_AUTO; +enum VideoSyncMethod video_sync_method = VSYNC_AUTO; float frame_drop_threshold = 0; int do_benchmark = 0; int do_benchmark_all = 0;