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
73extern __thread AVCodecContext *
avcodec_opts[AVMEDIA_TYPE_NB];
75extern __thread AVDictionary *
sws_dict;
76extern __thread AVDictionary *
swr_opts;
116int opt_cpuflags(
void *optctx,
const char *opt,
const char *arg);
121int opt_cpucount(
void *optctx,
const char *opt,
const char *arg);
127int opt_default(
void *optctx,
const char *opt,
const char *arg);
132int opt_loglevel(
void *optctx,
const char *opt,
const char *arg);
134int opt_report(
void *optctx,
const char *opt,
const char *arg);
136int opt_max_alloc(
void *optctx,
const char *opt,
const char *arg);
143int opt_timelimit(
void *optctx,
const char *opt,
const char *arg);
159 double min,
double max);
193#define HAS_ARG 0x0001
194#define OPT_BOOL 0x0002
195#define OPT_EXPERT 0x0004
196#define OPT_STRING 0x0008
197#define OPT_VIDEO 0x0010
198#define OPT_AUDIO 0x0020
199#define OPT_INT 0x0080
200#define OPT_FLOAT 0x0100
201#define OPT_SUBTITLE 0x0200
202#define OPT_INT64 0x0400
203#define OPT_EXIT 0x0800
204#define OPT_DATA 0x1000
205#define OPT_PERFILE 0x2000
207#define OPT_OFFSET 0x4000
208#define OPT_SPEC 0x8000
211#define OPT_TIME 0x10000
212#define OPT_DOUBLE 0x20000
213#define OPT_INPUT 0x40000
214#define OPT_OUTPUT 0x80000
234 int rej_flags,
int alt_flags);
252int show_help(
void *optctx,
const char *opt,
const char *arg);
267 void (* parse_arg_function)(
void *optctx,
const char*));
274int parse_option(
void *optctx,
const char *opt,
const char *arg,
382 const char *optname);
410 AVFormatContext *s, AVStream *st,
const AVCodec *codec);
450int show_version(
void *optctx,
const char *opt,
const char *arg);
457int show_buildconf(
void *optctx,
const char *opt,
const char *arg);
464int show_license(
void *optctx,
const char *opt,
const char *arg);
471int show_formats(
void *optctx,
const char *opt,
const char *arg);
478int show_muxers(
void *optctx,
const char *opt,
const char *arg);
485int show_demuxers(
void *optctx,
const char *opt,
const char *arg);
492int show_devices(
void *optctx,
const char *opt,
const char *arg);
499int show_sinks(
void *optctx,
const char *opt,
const char *arg);
505int show_sources(
void *optctx,
const char *opt,
const char *arg);
513int show_codecs(
void *optctx,
const char *opt,
const char *arg);
519int show_decoders(
void *optctx,
const char *opt,
const char *arg);
525int show_encoders(
void *optctx,
const char *opt,
const char *arg);
532int show_filters(
void *optctx,
const char *opt,
const char *arg);
539int show_bsfs(
void *optctx,
const char *opt,
const char *arg);
546int show_protocols(
void *optctx,
const char *opt,
const char *arg);
553int show_pix_fmts(
void *optctx,
const char *opt,
const char *arg);
560int show_layouts(
void *optctx,
const char *opt,
const char *arg);
572int show_colors(
void *optctx,
const char *opt,
const char *arg);
599 const char *preset_name,
int is_path,
const char *codec_name);
611void *
grow_array(
void *array,
int elem_size,
int *size,
int new_size);
613#define media_type_string av_get_media_type_string
615#define GROW_ARRAY(array, nb_elems)\
616 array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
618#define GET_PIX_FMT_NAME(pix_fmt)\
619 const char *name = av_get_pix_fmt_name(pix_fmt);
621#define GET_CODEC_NAME(id)\
622 const char *name = avcodec_descriptor_get(id)->name;
624#define GET_SAMPLE_FMT_NAME(sample_fmt)\
625 const char *name = av_get_sample_fmt_name(sample_fmt)
627#define GET_SAMPLE_RATE_NAME(rate)\
629 snprintf(name, sizeof(name), "%d", rate);
631#define GET_CH_LAYOUT_NAME(ch_layout)\
633 snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
635#define GET_CH_LAYOUT_DESC(ch_layout)\
637 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