22 #ifndef LIBAV_CMDUTILS_H
23 #define LIBAV_CMDUTILS_H
94 double min,
double max);
127 #define HAS_ARG 0x0001
128 #define OPT_BOOL 0x0002
129 #define OPT_EXPERT 0x0004
130 #define OPT_STRING 0x0008
131 #define OPT_VIDEO 0x0010
132 #define OPT_AUDIO 0x0020
133 #define OPT_GRAB 0x0040
134 #define OPT_INT 0x0080
135 #define OPT_FLOAT 0x0100
136 #define OPT_SUBTITLE 0x0200
137 #define OPT_INT64 0x0400
138 #define OPT_EXIT 0x0800
139 #define OPT_DATA 0x1000
140 #define OPT_FUNC2 0x2000
141 #define OPT_OFFSET 0x4000
142 #define OPT_SPEC 0x8000
145 #define OPT_TIME 0x10000
146 #define OPT_DOUBLE 0x20000
149 int (*func_arg)(
const char *,
const char *);
150 int (*func2_arg)(
void *,
const char *,
const char *);
177 void (* parse_arg_function)(
void *optctx,
const char*));
184 int parse_option(
void *optctx,
const char *opt,
const char *arg,
362 const char *preset_name,
int is_path,
const char *codec_name);
393 void *
grow_array(
void *array,
int elem_size,
int *
size,
int new_size);
int64_t num_faulty_dts
Number of incorrect PTS values so far.
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
AVCodecContext * avcodec_opts[AVMEDIA_TYPE_NB]
int64_t last_pts
Number of incorrect DTS values so far.
void show_bsfs(void)
Print a listing containing all the bit stream filters supported by the program.
AVDictionary * format_opts
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
Parse a string and return its corresponding value as a double.
void show_version(void)
Print the version of the program to stdout.
void parse_loglevel(int argc, char **argv, const OptionDef *options)
Find the '-loglevel' option in the command line args and apply it.
external api for the swscale stuff
void uninit_opts(void)
Uninitialize the cmdutils option system, in particular free the *_opts contexts and their contents...
static const uint16_t mask[17]
struct SwsContext * sws_opts
void init_opts(void)
Initialize the cmdutils option system, in particular allocate the *_opts contexts.
const int program_birth_year
program birth year, defined by the program for show_banner()
AVDictionary ** setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
Setup AVCodecContext options for avformat_find_stream_info().
void init_pts_correction(PtsCorrectionContext *ctx)
Reset the state of the PtsCorrectionContext.
AVDictionary * filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, AVFormatContext *s, AVStream *st)
Filter out options for given codec.
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 opt_loglevel(const char *opt, const char *arg)
Set the libav* libraries log level.
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
char * specifier
stream/chapter/program/...
void show_filters(void)
Print a listing containing all the filters supported by the program.
int opt_default(const char *opt, const char *arg)
Fallback for options that are not explicitly handled, these will be parsed through AVOptions...
void show_banner(void)
Print the program banner to stderr.
void show_help_options(const OptionDef *options, const char *msg, int mask, int value)
A reference to an AVFilterBuffer.
static const OptionDef options[]
main external API structure.
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
Parse a string specifying a time and return its corresponding value as a number of microseconds...
AVDictionary * codec_opts
int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame, AVFilterBufferRef **picref, AVRational *pts_tb)
Extract a frame from sink.
Describe the class of an AVClass context structure.
rational number numerator/denominator
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
Read the file with name filename, and put its content in a newly allocated 0-terminated buffer...
struct SpecifierOpt SpecifierOpt
int64_t last_dts
PTS of the last frame.
void show_license(void)
Print the license of the program to stdout.
void show_formats(void)
Print a listing containing all the formats supported by the program.
void parse_options(void *optctx, int argc, char **argv, const OptionDef *options, void(*parse_arg_function)(void *optctx, const char *))
Parse the command line arguments.
void show_protocols(void)
Print a listing containing all the protocols supported by the program.
int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t pts, int64_t dts)
Attempt to guess proper monotonic timestamps for decoded video frames which might have incorrect time...
int show_sample_fmts(const char *opt, const char *arg)
Print a listing containing all the sample formats supported by the program.
AVFormatContext * avformat_opts
void * grow_array(void *array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size.
CodecID
Identify the syntax and semantics of the bitstream.
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_codecs(void)
Print a listing containing all the codecs supported by the program.
void show_pix_fmts(void)
Print a listing containing all the pixel formats supported by the program.
void exit_program(int ret)
Do all the necessary cleanup and abort.
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
Trivial log callback.
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 opt_timelimit(const char *opt, const char *arg)
Limit the execution time.
int read_yesno(void)
Return a positive value if a line read from standard input starts with [yY], otherwise return 0...
const char program_name[]
program name, defined by the program for show_version().