22#ifndef FFTOOLS_CMDUTILS_H
23#define FFTOOLS_CMDUTILS_H
152 int allow_remainder,
void *logctx);
205#define OPT_FUNC_ARG (1 << 0)
207#define OPT_EXIT (1 << 1)
211#define OPT_EXPERT (1 << 2)
212#define OPT_VIDEO (1 << 3)
213#define OPT_AUDIO (1 << 4)
214#define OPT_SUBTITLE (1 << 5)
215#define OPT_DATA (1 << 6)
219#define OPT_PERFILE (1 << 7)
223#define OPT_FLAG_OFFSET (1 << 8)
224#define OPT_OFFSET (OPT_FLAG_OFFSET | OPT_PERFILE)
228#define OPT_FLAG_SPEC (1 << 9)
229#define OPT_SPEC (OPT_FLAG_SPEC | OPT_OFFSET)
232#define OPT_FLAG_PERSTREAM (1 << 10)
233#define OPT_PERSTREAM (OPT_FLAG_PERSTREAM | OPT_SPEC)
237#define OPT_INPUT (1 << 11)
238#define OPT_OUTPUT (1 << 12)
242#define OPT_HAS_ALT (1 << 13)
245#define OPT_HAS_CANON (1 << 14)
248#define OPT_DECODER (1 << 15)
252 int (*
func_arg)(
void *,
const char *,
const char *);
304 int (* parse_arg_function)(
void *optctx,
const char*));
417 const char *optname);
509 const char *preset_name,
int is_path,
const char *codec_name);
536#define GROW_ARRAY(array, nb_elems)\
537 grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
557 const char *
name,
const char *indent,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Libavcodec external API header.
Main libavfilter public API header.
#define flags(name, subs,...)
#define ss(width, name, subs,...)
AVDictionary * format_opts
AVDictionary * codec_opts
unsigned stream_group_specifier_match(const StreamSpecifier *ss, const AVFormatContext *s, const AVStreamGroup *stg, void *logctx)
const char program_name[]
program name, defined by the program for show_version().
int parse_optgroup(void *optctx, OptionGroup *g, const OptionDef *defs)
Parse an options group and write results into optctx.
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children.
void init_dynload(void)
Initialize dynamic library loading.
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
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.
int check_avoptions(AVDictionary *m)
int setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts, AVDictionary ***dst)
Setup AVCodecContext options for avformat_find_stream_info().
void dump_dictionary(void *ctx, const AVDictionary *m, const char *name, const char *indent, int log_level)
This does the same as libavformat/dump.c corresponding function and should probably be kept in sync w...
int read_yesno(void)
Return a positive value if a line read from standard input starts with [yY], otherwise return 0.
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 cmdutils_isalnum(char c)
int stream_specifier_parse(StreamSpecifier *ss, const char *spec, int allow_remainder, void *logctx)
Parse a stream specifier string into a form suitable for matching.
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
void parse_loglevel(int argc, char **argv, const OptionDef *options)
Find the '-loglevel' option in the command line args and apply it.
void show_help_default(const char *opt, const char *arg)
Per-fftool specific help handler.
void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags)
Print help for all options matching specified flags.
void uninit_parse_context(OptionParseContext *octx)
Free all allocated memory in an OptionParseContext.
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.
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
Trivial log callback.
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...
void show_banner(int argc, char **argv, const OptionDef *options)
Print the program banner to stderr.
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time.
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec, AVDictionary **dst, AVDictionary **opts_used)
Filter out options for given codec.
char * read_file_to_string(const char *filename)
void remove_avoptions(AVDictionary **a, AVDictionary *b)
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.
unsigned stream_specifier_match(const StreamSpecifier *ss, const AVFormatContext *s, const AVStream *st, void *logctx)
void uninit_opts(void)
Uninitialize the cmdutils option system, in particular free the *_opts contexts and their contents.
double get_rotation(const int32_t *displaymatrix)
int grow_array(void **array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size.
const int program_birth_year
program birth year, defined by the program for show_banner()
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 stream_specifier_uninit(StreamSpecifier *ss)
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.
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.
static const OptionGroupDef groups[]
AVCodecID
Identify the syntax and semantics of the bitstream.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define u(width, name, range_min, range_max)
Describe the class of an AVClass context structure.
const char *const * names_alt
union OptionDef::@302341376237271032103161277113207234376351006005 u1
int(* func_arg)(void *, const char *, const char *)
const char * name
group name
const char * sep
Option to be used as group separator.
int flags
Option flags that must be set on each option that is applied to this group.
A list of option groups that all have the same group type (e.g.
const OptionGroupDef * group_def
const OptionGroupDef * group_def
AVDictionary * codec_opts
AVDictionary * format_opts
An option extracted from the commandline.
const struct OptionDef * opt_canon
StreamSpecifier stream_spec
enum AVMediaType media_type
enum StreamList stream_list
static int array[MAX_W *MAX_W]
static AVFormatContext * ctx
static AVDictionary * opts