Go to the documentation of this file.
22 #ifndef FFTOOLS_CMDUTILS_H
23 #define FFTOOLS_CMDUTILS_H
103 double min,
double max,
double *dst);
136 #define OPT_FUNC_ARG (1 << 0)
138 #define OPT_EXIT (1 << 1)
142 #define OPT_EXPERT (1 << 2)
143 #define OPT_VIDEO (1 << 3)
144 #define OPT_AUDIO (1 << 4)
145 #define OPT_SUBTITLE (1 << 5)
146 #define OPT_DATA (1 << 6)
150 #define OPT_PERFILE (1 << 7)
154 #define OPT_FLAG_OFFSET (1 << 8)
155 #define OPT_OFFSET (OPT_FLAG_OFFSET | OPT_PERFILE)
159 #define OPT_FLAG_SPEC (1 << 9)
160 #define OPT_SPEC (OPT_FLAG_SPEC | OPT_OFFSET)
163 #define OPT_FLAG_PERSTREAM (1 << 10)
164 #define OPT_PERSTREAM (OPT_FLAG_PERSTREAM | OPT_SPEC)
168 #define OPT_INPUT (1 << 11)
169 #define OPT_OUTPUT (1 << 12)
173 #define OPT_HAS_ALT (1 << 13)
176 #define OPT_HAS_CANON (1 << 14)
179 #define OPT_DECODER (1 << 15)
235 int (* parse_arg_function)(
void *optctx,
const char*));
348 const char *optname);
438 const char *preset_name,
int is_path,
const char *codec_name);
465 #define GROW_ARRAY(array, nb_elems)\
466 grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
468 #define GET_PIX_FMT_NAME(pix_fmt)\
469 const char *name = av_get_pix_fmt_name(pix_fmt);
471 #define GET_CODEC_NAME(id)\
472 const char *name = avcodec_descriptor_get(id)->name;
474 #define GET_SAMPLE_FMT_NAME(sample_fmt)\
475 const char *name = av_get_sample_fmt_name(sample_fmt)
477 #define GET_SAMPLE_RATE_NAME(rate)\
479 snprintf(name, sizeof(name), "%d", rate);
const OptionGroupDef * group_def
void show_help_default(const char *opt, const char *arg)
Per-fftool specific help handler.
const char program_name[]
program name, defined by the program for show_version().
char * file_read(const char *filename)
AVDictionary * codec_opts
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time.
FILE * get_preset_file(char *filename, size_t filename_size, const char *preset_name, int is_path, const char *codec_name)
Get a file corresponding to a preset file.
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec, AVDictionary **dst)
Filter out options for given codec.
A list of option groups that all have the same group type (e.g.
An option extracted from the commandline.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
const OptionGroupDef * group_def
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * codec_opts
int flags
Option flags that must be set on each option that is applied to this group.
int setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts, AVDictionary ***dst)
Setup AVCodecContext options for avformat_find_stream_info().
char * specifier
stream/chapter/program/...
int parse_number(const char *context, const char *numstr, enum OptionType type, double min, double max, double *dst)
Parse a string and return its corresponding value as a double.
void uninit_opts(void)
Uninitialize the cmdutils option system, in particular free the *_opts contexts and their contents.
void * allocate_array_elem(void *array, size_t elem_size, int *nb_elems)
Atomically add a new element to an array of pointers, i.e.
void init_dynload(void)
Initialize dynamic library loading.
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children.
void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags)
Print help for all options matching specified flags.
const char * name
< group name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
AVDictionary * format_opts
Describe the class of an AVClass context structure.
AVCodecID
Identify the syntax and semantics of the bitstream.
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
int read_yesno(void)
Return a positive value if a line read from standard input starts with [yY], otherwise return 0.
const OptionDef options[]
int grow_array(void **array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
void show_banner(int argc, char **argv, const OptionDef *options)
Print the program banner to stderr.
void uninit_parse_context(OptionParseContext *octx)
Free all allocated memory in an OptionParseContext.
void parse_loglevel(int argc, char **argv, const OptionDef *options)
Find the '-loglevel' option in the command line args and apply it.
int parse_optgroup(void *optctx, OptionGroup *g, const OptionDef *defs)
Parse an options group and write results into optctx.
int opt_default(void *optctx, const char *opt, const char *arg)
Fallback for options that are not explicitly handled, these will be parsed through AVOptions.
AVDictionary * format_opts
const struct OptionDef * opt_canon
int split_commandline(OptionParseContext *octx, int argc, char *argv[], const OptionDef *options, const OptionGroupDef *groups, int nb_groups)
Split the commandline into an intermediate form convenient for further processing.
static int array[MAX_W *MAX_W]
int parse_options(void *optctx, int argc, char **argv, const OptionDef *options, int(*parse_arg_function)(void *optctx, const char *))
Parse the command line arguments.
const char *const * names_alt
const char * sep
Option to be used as group separator.
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
Trivial log callback.
double get_rotation(const int32_t *displaymatrix)
#define flags(name, subs,...)
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
int locate_option(int argc, char **argv, const OptionDef *options, const char *optname)
Return index of option opt in argv or 0 if not found.
static void print_error(const char *filename, int err)
Print an error message to stderr, indicating filename and a human readable description of the error c...
int(* func_arg)(void *, const char *, const char *)
const int program_birth_year
program birth year, defined by the program for show_banner()