FFmpeg
Loading...
Searching...
No Matches
opt_common.h
Go to the documentation of this file.
1/*
2 * Option handlers shared between the tools.
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef FFTOOLS_OPT_COMMON_H
22#define FFTOOLS_OPT_COMMON_H
23
24#include "config.h"
25
26#include "cmdutils.h"
27
28#if CONFIG_AVDEVICE
29/**
30 * Print a listing containing autodetected sinks of the output device.
31 * Device name with options may be passed as an argument to limit results.
32 */
33int show_sinks(void *optctx, const char *opt, const char *arg);
34
35/**
36 * Print a listing containing autodetected sources of the input device.
37 * Device name with options may be passed as an argument to limit results.
38 */
39int show_sources(void *optctx, const char *opt, const char *arg);
40#endif
41
42#if CONFIG_AVDEVICE
43#define CMDUTILS_COMMON_OPTIONS_AVDEVICE \
44 { "sources" , OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_sources }, \
45 "list sources of the input device", "device" }, \
46 { "sinks" , OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_sinks }, \
47 "list sinks of the output device", "device" }, \
48
49#else
50#define CMDUTILS_COMMON_OPTIONS_AVDEVICE
51#endif
52
53/**
54 * Print the license of the program to stdout. The license depends on
55 * the license of the libraries compiled into the program.
56 * This option processing function does not utilize the arguments.
57 */
58int show_license(void *optctx, const char *opt, const char *arg);
59
60/**
61 * Generic -h handler common to all fftools.
62 */
63int show_help(void *optctx, const char *opt, const char *arg);
64
65/**
66 * Print the version of the program to stdout. The version message
67 * depends on the current versions of the repository and of the libav*
68 * libraries.
69 * This option processing function does not utilize the arguments.
70 */
71int show_version(void *optctx, const char *opt, const char *arg);
72
73/**
74 * Print the build configuration of the program to stdout. The contents
75 * depend on the definition of FFMPEG_CONFIGURATION.
76 * This option processing function does not utilize the arguments.
77 */
78int show_buildconf(void *optctx, const char *opt, const char *arg);
79
80/**
81 * Print a listing containing all the formats supported by the
82 * program (including devices).
83 * This option processing function does not utilize the arguments.
84 */
85int show_formats(void *optctx, const char *opt, const char *arg);
86
87/**
88 * Print a listing containing all the muxers supported by the
89 * program (including devices).
90 * This option processing function does not utilize the arguments.
91 */
92int show_muxers(void *optctx, const char *opt, const char *arg);
93
94/**
95 * Print a listing containing all the demuxer supported by the
96 * program (including devices).
97 * This option processing function does not utilize the arguments.
98 */
99int show_demuxers(void *optctx, const char *opt, const char *arg);
100
101/**
102 * Print a listing containing all the devices supported by the
103 * program.
104 * This option processing function does not utilize the arguments.
105 */
106int show_devices(void *optctx, const char *opt, const char *arg);
107
108/**
109 * Print a listing containing all the codecs supported by the
110 * program.
111 * This option processing function does not utilize the arguments.
112 */
113int show_codecs(void *optctx, const char *opt, const char *arg);
114
115/**
116 * Print a listing containing all the decoders supported by the
117 * program.
118 */
119int show_decoders(void *optctx, const char *opt, const char *arg);
120
121/**
122 * Print a listing containing all the encoders supported by the
123 * program.
124 */
125int show_encoders(void *optctx, const char *opt, const char *arg);
126
127/**
128 * Print a listing containing all the bit stream filters supported by the
129 * program.
130 * This option processing function does not utilize the arguments.
131 */
132int show_bsfs(void *optctx, const char *opt, const char *arg);
133
134/**
135 * Print a listing containing all the protocols supported by the
136 * program.
137 * This option processing function does not utilize the arguments.
138 */
139int show_protocols(void *optctx, const char *opt, const char *arg);
140
141/**
142 * Print a listing containing all the filters supported by the
143 * program.
144 * This option processing function does not utilize the arguments.
145 */
146int show_filters(void *optctx, const char *opt, const char *arg);
147
148/**
149 * Print a listing containing all the pixel formats supported by the
150 * program.
151 * This option processing function does not utilize the arguments.
152 */
153int show_pix_fmts(void *optctx, const char *opt, const char *arg);
154
155/**
156 * Print a listing containing all the standard channel layouts supported by
157 * the program.
158 * This option processing function does not utilize the arguments.
159 */
160int show_layouts(void *optctx, const char *opt, const char *arg);
161
162/**
163 * Print a listing containing all the sample formats supported by the
164 * program.
165 */
166int show_sample_fmts(void *optctx, const char *opt, const char *arg);
167
168/**
169 * Print a listing containing all supported stream dispositions.
170 */
171int show_dispositions(void *optctx, const char *opt, const char *arg);
172
173/**
174 * Print a listing containing all the color names and values recognized
175 * by the program.
176 */
177int show_colors(void *optctx, const char *opt, const char *arg);
178
179/**
180 * Set the libav* libraries log level.
181 */
182int opt_loglevel(void *optctx, const char *opt, const char *arg);
183
184int opt_report(void *optctx, const char *opt, const char *arg);
185int init_report(const char *env, FILE **file);
186
187int opt_max_alloc(void *optctx, const char *opt, const char *arg);
188
189/**
190 * Override the cpuflags.
191 */
192int opt_cpuflags(void *optctx, const char *opt, const char *arg);
193
194/**
195 * Override the cpucount.
196 */
197int opt_cpucount(void *optctx, const char *opt, const char *arg);
198
199#define CMDUTILS_COMMON_OPTIONS \
200 { "L", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_license }, "show license" }, \
201 { "license", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_license }, "show license" }, \
202 { "h", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_help }, "show help", "topic" }, \
203 { "?", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_help }, "show help", "topic" }, \
204 { "help", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_help }, "show help", "topic" }, \
205 { "-help", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_help }, "show help", "topic" }, \
206 { "version", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_version }, "show version" }, \
207 { "buildconf", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_buildconf }, "show build configuration" }, \
208 { "formats", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_formats }, "show available formats" }, \
209 { "muxers", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_muxers }, "show available muxers" }, \
210 { "demuxers", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_demuxers }, "show available demuxers" }, \
211 { "devices", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_devices }, "show available devices" }, \
212 { "codecs", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_codecs }, "show available codecs" }, \
213 { "decoders", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_decoders }, "show available decoders" }, \
214 { "encoders", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_encoders }, "show available encoders" }, \
215 { "bsfs", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_bsfs }, "show available bit stream filters" }, \
216 { "protocols", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_protocols }, "show available protocols" }, \
217 { "filters", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_filters }, "show available filters" }, \
218 { "pix_fmts", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_pix_fmts }, "show available pixel formats" }, \
219 { "layouts", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_layouts }, "show standard channel layouts" }, \
220 { "sample_fmts", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_sample_fmts }, "show available audio sample formats" }, \
221 { "dispositions", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_dispositions}, "show available stream dispositions" }, \
222 { "colors", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_colors }, "show available color names" }, \
223 { "loglevel", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_loglevel }, "set logging level", "loglevel" }, \
224 { "v", OPT_TYPE_FUNC, OPT_FUNC_ARG, { .func_arg = opt_loglevel }, "set logging level", "loglevel" }, \
225 { "report", OPT_TYPE_FUNC, OPT_EXPERT, { .func_arg = opt_report }, "generate a report" }, \
226 { "max_alloc", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_max_alloc }, "set maximum size of a single allocated block", "bytes" }, \
227 { "cpuflags", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" }, \
228 { "cpucount", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_cpucount }, "force specific cpu count", "count" }, \
229 { "hide_banner", OPT_TYPE_BOOL, OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" }, \
230 CMDUTILS_COMMON_OPTIONS_AVDEVICE \
231
232#endif /* FFTOOLS_OPT_COMMON_H */
const char * arg
Definition jacosubdec.c:65
int show_decoders(void *optctx, const char *opt, const char *arg)
Print a listing containing all the decoders supported by the program.
Definition opt_common.c:786
int opt_loglevel(void *optctx, const char *opt, const char *arg)
Set the libav* libraries log level.
int opt_cpuflags(void *optctx, const char *opt, const char *arg)
Override the cpuflags.
int show_help(void *optctx, const char *opt, const char *arg)
Generic -h handler common to all fftools.
Definition opt_common.c:590
int show_filters(void *optctx, const char *opt, const char *arg)
Print a listing containing all the filters supported by the program.
Definition opt_common.c:808
int show_sample_fmts(void *optctx, const char *opt, const char *arg)
Print a listing containing all the sample formats supported by the program.
int show_muxers(void *optctx, const char *opt, const char *arg)
Print a listing containing all the muxers supported by the program (including devices).
Definition opt_common.c:943
int show_bsfs(void *optctx, const char *opt, const char *arg)
Print a listing containing all the bit stream filters supported by the program.
Definition opt_common.c:796
int show_dispositions(void *optctx, const char *opt, const char *arg)
Print a listing containing all supported stream dispositions.
int show_layouts(void *optctx, const char *opt, const char *arg)
Print a listing containing all the standard channel layouts supported by the program.
int show_encoders(void *optctx, const char *opt, const char *arg)
Print a listing containing all the encoders supported by the program.
Definition opt_common.c:791
int show_version(void *optctx, const char *opt, const char *arg)
Print the version of the program to stdout.
Definition opt_common.c:251
int opt_cpucount(void *optctx, const char *opt, const char *arg)
Override the cpucount.
int show_license(void *optctx, const char *opt, const char *arg)
Print the license of the program to stdout.
Definition opt_common.c:79
int show_codecs(void *optctx, const char *opt, const char *arg)
Print a listing containing all the codecs supported by the program.
Definition opt_common.c:681
int show_buildconf(void *optctx, const char *opt, const char *arg)
Print the build configuration of the program to stdout.
Definition opt_common.c:260
int show_devices(void *optctx, const char *opt, const char *arg)
Print a listing containing all the devices supported by the program.
Definition opt_common.c:953
int init_report(const char *env, FILE **file)
int show_formats(void *optctx, const char *opt, const char *arg)
Print a listing containing all the formats supported by the program (including devices).
Definition opt_common.c:938
int show_protocols(void *optctx, const char *opt, const char *arg)
Print a listing containing all the protocols supported by the program.
Definition opt_common.c:958
int opt_max_alloc(void *optctx, const char *opt, const char *arg)
int opt_report(void *optctx, const char *opt, const char *arg)
int show_colors(void *optctx, const char *opt, const char *arg)
Print a listing containing all the color names and values recognized by the program.
Definition opt_common.c:973
int show_pix_fmts(void *optctx, const char *opt, const char *arg)
Print a listing containing all the pixel formats supported by the program.
Definition opt_common.c:987
int show_demuxers(void *optctx, const char *opt, const char *arg)
Print a listing containing all the demuxer supported by the program (including devices).
Definition opt_common.c:948