57#ifndef FFTOOLS_CMDUTILS_H
58#define FFTOOLS_CMDUTILS_H
63#include "libavcodec/avcodec.h"
64#include "libavfilter/avfilter.h"
65#include "libavformat/avformat.h"
66#include "libswscale/swscale.h"
75#define AV_LOG_STDERR -16
87extern __thread AVDictionary *
sws_dict;
88extern __thread AVDictionary *
swr_opts;
124int opt_default(
void *optctx,
const char *opt,
const char *arg);
129int opt_timelimit(
void *optctx,
const char *opt,
const char *arg);
145 double min,
double max);
179#define HAS_ARG 0x0001
180#define OPT_BOOL 0x0002
181#define OPT_EXPERT 0x0004
182#define OPT_STRING 0x0008
183#define OPT_VIDEO 0x0010
184#define OPT_AUDIO 0x0020
185#define OPT_INT 0x0080
186#define OPT_FLOAT 0x0100
187#define OPT_SUBTITLE 0x0200
188#define OPT_INT64 0x0400
189#define OPT_EXIT 0x0800
190#define OPT_DATA 0x1000
191#define OPT_PERFILE 0x2000
193#define OPT_OFFSET 0x4000
194#define OPT_SPEC 0x8000
197#define OPT_TIME 0x10000
198#define OPT_DOUBLE 0x20000
199#define OPT_INPUT 0x40000
200#define OPT_OUTPUT 0x80000
220 int rej_flags,
int alt_flags);
238int show_help(
void *optctx,
const char *opt,
const char *arg);
253 void (* parse_arg_function)(
void *optctx,
const char*));
260int parse_option(
void *optctx,
const char *opt,
const char *arg,
367 const char *optname);
395 AVFormatContext *s, AVStream *st,
const AVCodec *codec);
454 const char *preset_name,
int is_path,
const char *codec_name);
466void *
grow_array(
void *array,
int elem_size,
int *size,
int new_size);
482#define GROW_ARRAY(array, nb_elems)\
483 array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
485#define ALLOC_ARRAY_ELEM(array, nb_elems)\
486 allocate_array_elem(&array, sizeof(*array[0]), &nb_elems)
488#define GET_PIX_FMT_NAME(pix_fmt)\
489 const char *name = av_get_pix_fmt_name(pix_fmt);
491#define GET_CODEC_NAME(id)\
492 const char *name = avcodec_descriptor_get(id)->name;
494#define GET_SAMPLE_FMT_NAME(sample_fmt)\
495 const char *name = av_get_sample_fmt_name(sample_fmt)
497#define GET_SAMPLE_RATE_NAME(rate)\
499 snprintf(name, sizeof(name), "%d", rate);
int(* func_arg)(void *, const char *, const char *)
const OptionGroupDef * group_def
AVDictionary * codec_opts
AVDictionary * format_opts
const OptionGroupDef * group_def