Skip to content

Commit b010843

Browse files
committed
Merge commit '122de16dd8108a59a55d30543c9f28b5f61b02d1'
* commit '122de16dd8108a59a55d30543c9f28b5f61b02d1': Replace cmdutils_common_opts.h by a macro Merged-by: Clément Bœsch <[email protected]>
2 parents cea5e73 + 122de16 commit b010843

File tree

8 files changed

+58
-45
lines changed

8 files changed

+58
-45
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ FFLIBS := avutil
5959
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
6060
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
6161

62-
SKIPHEADERS = cmdutils_common_opts.h \
63-
compat/w32pthreads.h
62+
SKIPHEADERS = compat/w32pthreads.h
6463

6564
# first so "all" becomes default target
6665
all: all-yes

cmdutils.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,59 @@ typedef struct OptionDef {
206206
void show_help_options(const OptionDef *options, const char *msg, int req_flags,
207207
int rej_flags, int alt_flags);
208208

209+
#if CONFIG_OPENCL
210+
#define CMDUTILS_COMMON_OPTIONS_OPENCL \
211+
{ "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, \
212+
"run benchmark on all OpenCL devices and show results" }, \
213+
{ "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, \
214+
"set OpenCL environment options" }, \
215+
216+
#else
217+
#define CMDUTILS_COMMON_OPTIONS_OPENCL
218+
#endif
219+
220+
#if CONFIG_AVDEVICE
221+
#define CMDUTILS_COMMON_OPTIONS_AVDEVICE \
222+
{ "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources }, \
223+
"list sources of the input device", "device" }, \
224+
{ "sinks" , OPT_EXIT | HAS_ARG, { .func_arg = show_sinks }, \
225+
"list sinks of the output device", "device" }, \
226+
227+
#else
228+
#define CMDUTILS_COMMON_OPTIONS_AVDEVICE
229+
#endif
230+
231+
#define CMDUTILS_COMMON_OPTIONS \
232+
{ "L", OPT_EXIT, { .func_arg = show_license }, "show license" }, \
233+
{ "h", OPT_EXIT, { .func_arg = show_help }, "show help", "topic" }, \
234+
{ "?", OPT_EXIT, { .func_arg = show_help }, "show help", "topic" }, \
235+
{ "help", OPT_EXIT, { .func_arg = show_help }, "show help", "topic" }, \
236+
{ "-help", OPT_EXIT, { .func_arg = show_help }, "show help", "topic" }, \
237+
{ "version", OPT_EXIT, { .func_arg = show_version }, "show version" }, \
238+
{ "buildconf", OPT_EXIT, { .func_arg = show_buildconf }, "show build configuration" }, \
239+
{ "formats", OPT_EXIT, { .func_arg = show_formats }, "show available formats" }, \
240+
{ "muxers", OPT_EXIT, { .func_arg = show_muxers }, "show available muxers" }, \
241+
{ "demuxers", OPT_EXIT, { .func_arg = show_demuxers }, "show available demuxers" }, \
242+
{ "devices", OPT_EXIT, { .func_arg = show_devices }, "show available devices" }, \
243+
{ "codecs", OPT_EXIT, { .func_arg = show_codecs }, "show available codecs" }, \
244+
{ "decoders", OPT_EXIT, { .func_arg = show_decoders }, "show available decoders" }, \
245+
{ "encoders", OPT_EXIT, { .func_arg = show_encoders }, "show available encoders" }, \
246+
{ "bsfs", OPT_EXIT, { .func_arg = show_bsfs }, "show available bit stream filters" }, \
247+
{ "protocols", OPT_EXIT, { .func_arg = show_protocols }, "show available protocols" }, \
248+
{ "filters", OPT_EXIT, { .func_arg = show_filters }, "show available filters" }, \
249+
{ "pix_fmts", OPT_EXIT, { .func_arg = show_pix_fmts }, "show available pixel formats" }, \
250+
{ "layouts", OPT_EXIT, { .func_arg = show_layouts }, "show standard channel layouts" }, \
251+
{ "sample_fmts", OPT_EXIT, { .func_arg = show_sample_fmts }, "show available audio sample formats" }, \
252+
{ "colors", OPT_EXIT, { .func_arg = show_colors }, "show available color names" }, \
253+
{ "loglevel", HAS_ARG, { .func_arg = opt_loglevel }, "set logging level", "loglevel" }, \
254+
{ "v", HAS_ARG, { .func_arg = opt_loglevel }, "set logging level", "loglevel" }, \
255+
{ "report", 0, { (void*)opt_report }, "generate a report" }, \
256+
{ "max_alloc", HAS_ARG, { .func_arg = opt_max_alloc }, "set maximum size of a single allocated block", "bytes" }, \
257+
{ "cpuflags", HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" }, \
258+
{ "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" }, \
259+
CMDUTILS_COMMON_OPTIONS_OPENCL \
260+
CMDUTILS_COMMON_OPTIONS_AVDEVICE \
261+
209262
/**
210263
* Show help for all options with given flags in class and all its
211264
* children.

cmdutils_common_opts.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

ffmpeg_opt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3291,7 +3291,7 @@ static int opt_progress(void *optctx, const char *opt, const char *arg)
32913291
#define OFFSET(x) offsetof(OptionsContext, x)
32923292
const OptionDef options[] = {
32933293
/* main options */
3294-
#include "cmdutils_common_opts.h"
3294+
CMDUTILS_COMMON_OPTIONS
32953295
{ "f", HAS_ARG | OPT_STRING | OPT_OFFSET |
32963296
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(format) },
32973297
"force format", "fmt" },

ffplay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3512,7 +3512,7 @@ static int opt_codec(void *optctx, const char *opt, const char *arg)
35123512
static int dummy;
35133513

35143514
static const OptionDef options[] = {
3515-
#include "cmdutils_common_opts.h"
3515+
CMDUTILS_COMMON_OPTIONS
35163516
{ "x", HAS_ARG, { .func_arg = opt_width }, "force displayed width", "width" },
35173517
{ "y", HAS_ARG, { .func_arg = opt_height }, "force displayed height", "height" },
35183518
{ "s", HAS_ARG | OPT_VIDEO, { .func_arg = opt_frame_size }, "set frame size (WxH or abbreviation)", "size" },

ffprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3379,7 +3379,7 @@ DEFINE_OPT_SHOW_SECTION(streams, STREAMS)
33793379
DEFINE_OPT_SHOW_SECTION(programs, PROGRAMS)
33803380

33813381
static const OptionDef real_options[] = {
3382-
#include "cmdutils_common_opts.h"
3382+
CMDUTILS_COMMON_OPTIONS
33833383
{ "f", HAS_ARG, {.func_arg = opt_format}, "force format", "format" },
33843384
{ "unit", OPT_BOOL, {&show_value_unit}, "show unit of the displayed values" },
33853385
{ "prefix", OPT_BOOL, {&use_value_prefix}, "use SI prefixes for the displayed values" },

ffserver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3950,7 +3950,7 @@ void show_help_default(const char *opt, const char *arg)
39503950
}
39513951

39523952
static const OptionDef options[] = {
3953-
#include "cmdutils_common_opts.h"
3953+
CMDUTILS_COMMON_OPTIONS
39543954
{ "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
39553955
{ "d", 0, {(void*)opt_debug}, "enable debug mode" },
39563956
{ "f", HAS_ARG | OPT_STRING, {(void*)&config.filename }, "use configfile instead of /etc/ffserver.conf", "configfile" },

tests/ref/fate/source

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Files without standard license headers:
2-
cmdutils_common_opts.h
32
compat/avisynth/windowsPorts/basicDataTypeConversions.h
43
compat/avisynth/windowsPorts/windows2linux.h
54
libavcodec/file_open.c
@@ -16,7 +15,6 @@ libswscale/log2_tab.c
1615
tools/uncoded_frame.c
1716
tools/yuvcmp.c
1817
Headers without standard inclusion guards:
19-
cmdutils_common_opts.h
2018
compat/avisynth/avisynth_c.h
2119
compat/avisynth/avs/capi.h
2220
compat/avisynth/avs/config.h

0 commit comments

Comments
 (0)