Go to the documentation of this file.
22 #ifndef FFTOOLS_CMDUTILS_H
23 #define FFTOOLS_CMDUTILS_H
92 double min,
double max,
double *dst);
109 #define HAS_ARG 0x0001
110 #define OPT_BOOL 0x0002
111 #define OPT_EXPERT 0x0004
112 #define OPT_STRING 0x0008
113 #define OPT_VIDEO 0x0010
114 #define OPT_AUDIO 0x0020
115 #define OPT_INT 0x0080
116 #define OPT_FLOAT 0x0100
117 #define OPT_SUBTITLE 0x0200
118 #define OPT_INT64 0x0400
119 #define OPT_EXIT 0x0800
120 #define OPT_DATA 0x1000
121 #define OPT_PERFILE 0x2000
123 #define OPT_OFFSET 0x4000
124 #define OPT_SPEC 0x8000
127 #define OPT_TIME 0x10000
128 #define OPT_DOUBLE 0x20000
129 #define OPT_INPUT 0x40000
130 #define OPT_OUTPUT 0x80000
150 int rej_flags,
int alt_flags);
177 int (* parse_arg_function)(
void *optctx,
const char*));
290 const char *optname);
377 const char *preset_name,
int is_path,
const char *codec_name);
404 #define GROW_ARRAY(array, nb_elems)\
405 grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
407 #define GET_PIX_FMT_NAME(pix_fmt)\
408 const char *name = av_get_pix_fmt_name(pix_fmt);
410 #define GET_CODEC_NAME(id)\
411 const char *name = avcodec_descriptor_get(id)->name;
413 #define GET_SAMPLE_FMT_NAME(sample_fmt)\
414 const char *name = av_get_sample_fmt_name(sample_fmt)
416 #define GET_SAMPLE_RATE_NAME(rate)\
418 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().
int parse_number(const char *context, const char *numstr, int type, double min, double max, double *dst)
Parse a string and return its corresponding value as a double.
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
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/...
void uninit_opts(void)
Uninitialize the cmdutils option system, in particular free the *_opts contexts and their contents.
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...
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.
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.
int parse_optgroup(void *optctx, OptionGroup *g)
Parse an options group and write results into optctx.
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.
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 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
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 * 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.
int(* func_arg)(void *, const char *, const char *)
void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags, int alt_flags)
Print help for all options matching specified flags.
const int program_birth_year
program birth year, defined by the program for show_banner()