44 #ifndef FFTOOLS_CMDUTILS_H
45 #define FFTOOLS_CMDUTILS_H
49 #include "libavcodec/avcodec.h"
50 #include "libavfilter/avfilter.h"
51 #include "libavformat/avformat.h"
52 #include "libswscale/swscale.h"
61 #define AV_LOG_STDERR -16
73 extern __thread AVCodecContext *
avcodec_opts[AVMEDIA_TYPE_NB];
75 extern __thread AVDictionary *
sws_dict;
76 extern __thread AVDictionary *
swr_opts;
116 int opt_cpuflags(
void *optctx,
const char *opt,
const char *arg);
122 int opt_default(
void *optctx,
const char *opt,
const char *arg);
127 int opt_loglevel(
void *optctx,
const char *opt,
const char *arg);
129 int opt_report(
void *optctx,
const char *opt,
const char *arg);
131 int opt_max_alloc(
void *optctx,
const char *opt,
const char *arg);
138 int opt_timelimit(
void *optctx,
const char *opt,
const char *arg);
154 double min,
double max);
188 #define HAS_ARG 0x0001
189 #define OPT_BOOL 0x0002
190 #define OPT_EXPERT 0x0004
191 #define OPT_STRING 0x0008
192 #define OPT_VIDEO 0x0010
193 #define OPT_AUDIO 0x0020
194 #define OPT_INT 0x0080
195 #define OPT_FLOAT 0x0100
196 #define OPT_SUBTITLE 0x0200
197 #define OPT_INT64 0x0400
198 #define OPT_EXIT 0x0800
199 #define OPT_DATA 0x1000
200 #define OPT_PERFILE 0x2000
202 #define OPT_OFFSET 0x4000
203 #define OPT_SPEC 0x8000
206 #define OPT_TIME 0x10000
207 #define OPT_DOUBLE 0x20000
208 #define OPT_INPUT 0x40000
209 #define OPT_OUTPUT 0x80000
229 int rej_flags,
int alt_flags);
247 int show_help(
void *optctx,
const char *opt,
const char *arg);
262 void (* parse_arg_function)(
void *optctx,
const char*));
269 int parse_option(
void *optctx,
const char *opt,
const char *arg,
377 const char *optname);
405 AVFormatContext *s, AVStream *st, AVCodec *codec);
445 int show_version(
void *optctx,
const char *opt,
const char *arg);
452 int show_buildconf(
void *optctx,
const char *opt,
const char *arg);
459 int show_license(
void *optctx,
const char *opt,
const char *arg);
466 int show_formats(
void *optctx,
const char *opt,
const char *arg);
473 int show_muxers(
void *optctx,
const char *opt,
const char *arg);
480 int show_demuxers(
void *optctx,
const char *opt,
const char *arg);
487 int show_devices(
void *optctx,
const char *opt,
const char *arg);
494 int show_sinks(
void *optctx,
const char *opt,
const char *arg);
500 int show_sources(
void *optctx,
const char *opt,
const char *arg);
508 int show_codecs(
void *optctx,
const char *opt,
const char *arg);
514 int show_decoders(
void *optctx,
const char *opt,
const char *arg);
520 int show_encoders(
void *optctx,
const char *opt,
const char *arg);
527 int show_filters(
void *optctx,
const char *opt,
const char *arg);
534 int show_bsfs(
void *optctx,
const char *opt,
const char *arg);
541 int show_protocols(
void *optctx,
const char *opt,
const char *arg);
548 int show_pix_fmts(
void *optctx,
const char *opt,
const char *arg);
555 int show_layouts(
void *optctx,
const char *opt,
const char *arg);
567 int show_colors(
void *optctx,
const char *opt,
const char *arg);
594 const char *preset_name,
int is_path,
const char *codec_name);
606 void *
grow_array(
void *array,
int elem_size,
int *size,
int new_size);
608 #define media_type_string av_get_media_type_string
610 #define GROW_ARRAY(array, nb_elems)\
611 array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
613 #define GET_PIX_FMT_NAME(pix_fmt)\
614 const char *name = av_get_pix_fmt_name(pix_fmt);
616 #define GET_CODEC_NAME(id)\
617 const char *name = avcodec_descriptor_get(id)->name;
619 #define GET_SAMPLE_FMT_NAME(sample_fmt)\
620 const char *name = av_get_sample_fmt_name(sample_fmt)
622 #define GET_SAMPLE_RATE_NAME(rate)\
624 snprintf(name, sizeof(name), "%d", rate);
626 #define GET_CH_LAYOUT_NAME(ch_layout)\
628 snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
630 #define GET_CH_LAYOUT_DESC(ch_layout)\
632 av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
int(* func_arg)(void *, const char *, const char *)
const OptionGroupDef * group_def
AVDictionary * codec_opts
AVDictionary * format_opts
AVDictionary * resample_opts
const OptionGroupDef * group_def