Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 4/9] fftools/cmdutils: change option flags to (1 << N) style
Date: Thu, 14 Dec 2023 20:31:33 +0100
Message-ID: <20231214193138.2503-4-anton@khirnov.net> (raw)
In-Reply-To: <20231214193138.2503-1-anton@khirnov.net>

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 *);
-- 
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".

  parent reply	other threads:[~2023-12-14 19:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 19:31 [FFmpeg-devel] [PATCH 1/9] fftools/ffmpeg_mux: stop logging to AVFormatContext Anton Khirnov
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 2/9] fftools/ffmpeg: deprecate -fps_mode/vsync drop Anton Khirnov
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 3/9] fftools/ffmpeg_mux: factor timestamps processing out of write_packet() Anton Khirnov
2023-12-14 19:31 ` Anton Khirnov [this message]
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 5/9] fftools/ffmpeg_mux_init: change 1-bit bitfields from int to unsigned Anton Khirnov
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 6/9] fftools/ffmpeg: print keyframe information with -stats_* Anton Khirnov
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 7/9] doc/ffmpeg: drop misleading claims from -stats_*_fmt Anton Khirnov
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 8/9] fftools/ffmpeg_mux: deduplicate uniniting EncStats Anton Khirnov
2023-12-14 19:31 ` [FFmpeg-devel] [PATCH 9/9] fftools/ffmpeg: use a mutex for enc_stats_write() Anton Khirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231214193138.2503-4-anton@khirnov.net \
    --to=anton@khirnov.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git