From patchwork Thu Dec 14 19:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45139 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp5185775pzf; Thu, 14 Dec 2023 11:33:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/9lrOSSBp900nSLSA3+kEIw+uJwJF3ljPmwxfu1ZHbo5niBNlpoIANiIQUdTJhAfDGRut X-Received: by 2002:a17:906:aac8:b0:a1c:d0f7:3f7a with SMTP id kt8-20020a170906aac800b00a1cd0f73f7amr4770931ejb.43.1702582397373; Thu, 14 Dec 2023 11:33:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702582397; cv=none; d=google.com; s=arc-20160816; b=xgTAV8xJjWEQy+zIz+0iE4WiHHH7hPPqmsUJ3J2JhNaIuCEOubqu6Xmz230qnerIZK zOVj6aCOxaxoVfNhIxPhdodkVI2H1NMNROC9d/qzBjXEk39iUCffbQQwxJzOBvIBkmAR HmBmmwvvOoMUyXvntFANLRp/mzHUg9iqMR9kyg/XoaOsU0EhjQD1sZlzJk/KBK54bU4b 0FSNOl7AOyFeQy6taT4FuJz6OkJu6m0VPEyEC328ziTqDX6BghF2VV333GnTXfW6vI10 YMfdM0eegmNrRODKxS2PFEYgjUFlnLMLe45/x9cBX4YN6g1XlwND+GWNnAZN5WBO3RZR pFcQ== 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=c6ys6A7U7DocUTD7R+d7zP2FTwDS+BZ3qTfzzAzdwV8=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=lxOWCQW1r7fGsZPjpzy8rzTJRXvXLla71omYpXmUhx4Gd38SAbk8zjxUIuzcFOHp7B jJ0YvImaDy+RXi+BnPEo31KMi+l26sNkMF2VYIKkRfGMoo1jiKtinmVZtF+alaVzEX+v l+P8l56pt87cJ5KPR6N+Tsfx1zChvyEoRbKE97XkwXKgCLZbsQshz9pC5JuN1AZrZcsk 6c1ZO1xd6z57wfxHzX3CvMDGz/7ArSzfL973BcJeCXyo3SUhfU/BcNgFN402BvclOuXd Tp/Ro90SnD3hiITVHCt1LYCrtg0re9Em8W296xPLSaE14GnOQP5J1/Pd8KYq1J9Qr8X7 dQXA== 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 q26-20020a1709064c9a00b00a1f78a5b5c1si6129168eju.613.2023.12.14.11.33.16; Thu, 14 Dec 2023 11:33:17 -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 7A09868D294; Thu, 14 Dec 2023 21:32:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1995668D28F for ; Thu, 14 Dec 2023 21:32:44 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B1C671CBD for ; Thu, 14 Dec 2023 20:32:43 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id X29mnpYJQL-Z for ; Thu, 14 Dec 2023 20:32:38 +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 619ED1BA1 for ; Thu, 14 Dec 2023 20:32:38 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 6AEC43A0613 for ; Thu, 14 Dec 2023 20:32:31 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 14 Dec 2023 20:31:33 +0100 Message-ID: <20231214193138.2503-4-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231214193138.2503-1-anton@khirnov.net> References: <20231214193138.2503-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/9] fftools/cmdutils: change option flags to (1 << N) style 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: DD93PXa/0huv It is easier to read. --- fftools/cmdutils.h | 47 ++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h index 8b67d827cc..85479f90e4 100644 --- a/fftools/cmdutils.h +++ b/fftools/cmdutils.h @@ -106,28 +106,31 @@ typedef struct SpecifierOpt { typedef struct OptionDef { const char *name; int flags; -#define HAS_ARG 0x0001 -#define OPT_BOOL 0x0002 -#define OPT_EXPERT 0x0004 -#define OPT_STRING 0x0008 -#define OPT_VIDEO 0x0010 -#define OPT_AUDIO 0x0020 -#define OPT_INT 0x0080 -#define OPT_FLOAT 0x0100 -#define OPT_SUBTITLE 0x0200 -#define OPT_INT64 0x0400 -#define OPT_EXIT 0x0800 -#define OPT_DATA 0x1000 -#define OPT_PERFILE 0x2000 /* the option is per-file (currently ffmpeg-only). - implied by OPT_OFFSET or OPT_SPEC */ -#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */ -#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt. - Implies OPT_OFFSET. Next element after the offset is - an int containing element count in the array. */ -#define OPT_TIME 0x10000 -#define OPT_DOUBLE 0x20000 -#define OPT_INPUT 0x40000 -#define OPT_OUTPUT 0x80000 +#define HAS_ARG (1 << 0) +#define OPT_BOOL (1 << 1) +#define OPT_EXPERT (1 << 2) +#define OPT_STRING (1 << 3) +#define OPT_VIDEO (1 << 4) +#define OPT_AUDIO (1 << 5) +#define OPT_INT (1 << 6) +#define OPT_FLOAT (1 << 7) +#define OPT_SUBTITLE (1 << 8) +#define OPT_INT64 (1 << 9) +#define OPT_EXIT (1 << 10) +#define OPT_DATA (1 << 11) +/* The option is per-file (currently ffmpeg-only). + implied by OPT_OFFSET or OPT_SPEC */ +#define OPT_PERFILE (1 << 12) +/* Option is specified as an offset in a passed optctx */ +#define OPT_OFFSET (1 << 13) +/* Option is to be stored in an array of SpecifierOpt. Implies OPT_OFFSET. + Next element after the offset is an int containing element count in the + array. */ +#define OPT_SPEC (1 << 14) +#define OPT_TIME (1 << 15) +#define OPT_DOUBLE (1 << 16) +#define OPT_INPUT (1 << 17) +#define OPT_OUTPUT (1 << 18) union { void *dst_ptr; int (*func_arg)(void *, const char *, const char *);