aboutsummaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer2012-08-31 12:04:17 +0200
committerMichael Niedermayer2012-08-31 13:01:30 +0200
commit98298eb1034bddb4557fa689553dae793c2b0092 (patch)
treed35dcd981b6647c9f538bc9b346ab806864bc359 /cmdutils.c
parentf3683349aecf3be4c9c875186a812c0cde8ecf41 (diff)
parentec36aa69448f20a78d8c4588265022e0b2272ab5 (diff)
Merge commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5'
* commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5': x86: Fix linking with some or all of yasm, mmx, optimizations disabled configure: Add more fine-grained SSE CPU capabilities flags avfilter: x86: Use more precise compile template names x86: cosmetics: Comment some #endifs for better readability g723_1: add comfort noise generation utvideoenc: Switch to dsputils' median prediction utvideoenc: Avoid writing into the input picture avtools: remove the distinction between func_arg and func2_arg. avconv: make the -passlogfile option per-stream. avconv: make the -pass option per-stream. cmdutils: make -codecs print lossy/lossless flags. lavc: add lossy/lossless codec properties. Conflicts: Changelog cmdutils.c configure doc/APIchanges ffmpeg.h ffmpeg_opt.c ffprobe.c libavcodec/codec_desc.c libavcodec/g723_1.c libavcodec/utvideoenc.c libavcodec/version.h libavcodec/x86/mpegaudiodec.c libavcodec/x86/rv40dsp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c63
1 files changed, 33 insertions, 30 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 619a4a81e5..a0ad3ef747 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -316,8 +316,7 @@ int parse_option(void *optctx, const char *opt, const char *arg,
} else if (po->flags & OPT_DOUBLE) {
*(double *)dst = parse_number_or_die(opt, arg, OPT_DOUBLE, -INFINITY, INFINITY);
} else if (po->u.func_arg) {
- int ret = po->flags & OPT_FUNC2 ? po->u.func2_arg(optctx, opt, arg)
- : po->u.func_arg(opt, arg);
+ int ret = po->u.func_arg(optctx, opt, arg);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR,
"Failed to set value '%s' for option '%s'\n", arg, opt);
@@ -416,7 +415,7 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
if (!idx)
idx = locate_option(argc, argv, options, "v");
if (idx && argv[idx + 1])
- opt_loglevel("loglevel", argv[idx + 1]);
+ opt_loglevel(NULL, "loglevel", argv[idx + 1]);
idx = locate_option(argc, argv, options, "report");
if (idx || getenv("FFREPORT")) {
opt_report("report");
@@ -433,7 +432,7 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
}
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
-int opt_default(const char *opt, const char *arg)
+int opt_default(void *optctx, const char *opt, const char *arg)
{
const AVOption *o;
char opt_stripped[128];
@@ -482,7 +481,7 @@ int opt_default(const char *opt, const char *arg)
return AVERROR_OPTION_NOT_FOUND;
}
-int opt_loglevel(const char *opt, const char *arg)
+int opt_loglevel(void *optctx, const char *opt, const char *arg)
{
const struct { const char *name; int level; } log_levels[] = {
{ "quiet" , AV_LOG_QUIET },
@@ -549,7 +548,7 @@ int opt_report(const char *opt)
return 0;
}
-int opt_max_alloc(const char *opt, const char *arg)
+int opt_max_alloc(void *optctx, const char *opt, const char *arg)
{
char *tail;
size_t max;
@@ -563,7 +562,7 @@ int opt_max_alloc(const char *opt, const char *arg)
return 0;
}
-int opt_cpuflags(const char *opt, const char *arg)
+int opt_cpuflags(void *optctx, const char *opt, const char *arg)
{
int ret;
unsigned flags = av_get_cpu_flags();
@@ -575,13 +574,13 @@ int opt_cpuflags(const char *opt, const char *arg)
return 0;
}
-int opt_codec_debug(const char *opt, const char *arg)
+int opt_codec_debug(void *optctx, const char *opt, const char *arg)
{
av_log_set_level(AV_LOG_DEBUG);
- return opt_default(opt, arg);
+ return opt_default(NULL, opt, arg);
}
-int opt_timelimit(const char *opt, const char *arg)
+int opt_timelimit(void *optctx, const char *opt, const char *arg)
{
#if HAVE_SETRLIMIT
int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
@@ -680,7 +679,7 @@ void show_banner(int argc, char **argv, const OptionDef *options)
print_all_libs_info(INDENT|SHOW_VERSION, AV_LOG_INFO);
}
-int show_version(const char *opt, const char *arg)
+int show_version(void *optctx, const char *opt, const char *arg)
{
av_log_set_callback(log_callback_help);
print_program_info (0 , AV_LOG_INFO);
@@ -689,7 +688,7 @@ int show_version(const char *opt, const char *arg)
return 0;
}
-int show_license(const char *opt, const char *arg)
+int show_license(void *optctx, const char *opt, const char *arg)
{
printf(
#if CONFIG_NONFREE
@@ -760,7 +759,7 @@ int show_license(const char *opt, const char *arg)
return 0;
}
-int show_formats(const char *opt, const char *arg)
+int show_formats(void *optctx, const char *opt, const char *arg)
{
AVInputFormat *ifmt = NULL;
AVOutputFormat *ofmt = NULL;
@@ -902,18 +901,20 @@ static void print_codecs_for_id(enum AVCodecID id, int encoder)
printf(")");
}
-int show_codecs(const char *opt, const char *arg)
+int show_codecs(void *optctx, const char *opt, const char *arg)
{
const AVCodecDescriptor *desc = NULL;
printf("Codecs:\n"
- " D... = Decoding supported\n"
- " .E.. = Encoding supported\n"
- " ..V. = Video codec\n"
- " ..A. = Audio codec\n"
- " ..S. = Subtitle codec\n"
- " ...I = Intra frame-only codec\n"
- " -----\n");
+ " D..... = Decoding supported\n"
+ " .E.... = Encoding supported\n"
+ " ..V... = Video codec\n"
+ " ..A... = Audio codec\n"
+ " ..S... = Subtitle codec\n"
+ " ...I.. = Intra frame-only codec\n"
+ " ....L. = Lossy compression\n"
+ " .....S = Lossless compression\n"
+ " -------\n");
while ((desc = avcodec_descriptor_next(desc))) {
const AVCodec *codec = NULL;
@@ -923,6 +924,8 @@ int show_codecs(const char *opt, const char *arg)
printf("%c", get_media_type_char(desc->type));
printf((desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : ".");
+ printf((desc->props & AV_CODEC_PROP_LOSSY) ? "L" : ".");
+ printf((desc->props & AV_CODEC_PROP_LOSSLESS) ? "S" : ".");
printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : "");
@@ -982,19 +985,19 @@ static void print_codecs(int encoder)
}
}
-int show_decoders(const char *opt, const char *arg)
+int show_decoders(void *optctx, const char *opt, const char *arg)
{
print_codecs(0);
return 0;
}
-int show_encoders(const char *opt, const char *arg)
+int show_encoders(void *optctx, const char *opt, const char *arg)
{
print_codecs(1);
return 0;
}
-int show_bsfs(const char *opt, const char *arg)
+int show_bsfs(void *optctx, const char *opt, const char *arg)
{
AVBitStreamFilter *bsf = NULL;
@@ -1005,7 +1008,7 @@ int show_bsfs(const char *opt, const char *arg)
return 0;
}
-int show_protocols(const char *opt, const char *arg)
+int show_protocols(void *optctx, const char *opt, const char *arg)
{
void *opaque = NULL;
const char *name;
@@ -1020,7 +1023,7 @@ int show_protocols(const char *opt, const char *arg)
return 0;
}
-int show_filters(const char *opt, const char *arg)
+int show_filters(void *optctx, const char *opt, const char *arg)
{
AVFilter av_unused(**filter) = NULL;
char descr[64], *descr_cur;
@@ -1052,7 +1055,7 @@ int show_filters(const char *opt, const char *arg)
return 0;
}
-int show_pix_fmts(const char *opt, const char *arg)
+int show_pix_fmts(void *optctx, const char *opt, const char *arg)
{
enum PixelFormat pix_fmt;
@@ -1087,7 +1090,7 @@ int show_pix_fmts(const char *opt, const char *arg)
return 0;
}
-int show_layouts(const char *opt, const char *arg)
+int show_layouts(void *optctx, const char *opt, const char *arg)
{
int i = 0;
uint64_t layout, j;
@@ -1116,7 +1119,7 @@ int show_layouts(const char *opt, const char *arg)
return 0;
}
-int show_sample_fmts(const char *opt, const char *arg)
+int show_sample_fmts(void *optctx, const char *opt, const char *arg)
{
int i;
char fmt_str[128];
@@ -1211,7 +1214,7 @@ static void show_help_muxer(const char *name)
show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
}
-int show_help(const char *opt, const char *arg)
+int show_help(void *optctx, const char *opt, const char *arg)
{
char *topic, *par;
av_log_set_callback(log_callback_help);