Skip to content

Commit

Permalink
Merge commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5'
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
michaelni committed Aug 31, 2012
2 parents f368334 + ec36aa6 commit 98298eb
Show file tree
Hide file tree
Showing 33 changed files with 928 additions and 296 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ version next:
- edge detection filter
- framestep filter
- ffmpeg -shortest option is now per-output file
-pass and -passlogfile are now per-output stream
- volume measurement filter
- Ut Video encoder
- Matroska demuxer now identifies SRT subtitles as AV_CODEC_ID_SUBRIP
Expand Down
63 changes: 33 additions & 30 deletions cmdutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand All @@ -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];
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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 : "");

Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
44 changes: 22 additions & 22 deletions cmdutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@ void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
* Fallback for options that are not explicitly handled, these will be
* parsed through AVOptions.
*/
int opt_default(const char *opt, const char *arg);
int opt_default(void *optctx, const char *opt, const char *arg);

/**
* Set the libav* libraries log level.
*/
int opt_loglevel(const char *opt, const char *arg);
int opt_loglevel(void *optctx, const char *opt, const char *arg);

int opt_report(const char *opt);

int opt_max_alloc(const char *opt, const char *arg);
int opt_max_alloc(void *optctx, const char *opt, const char *arg);

int opt_cpuflags(const char *opt, const char *arg);
int opt_cpuflags(void *optctx, const char *opt, const char *arg);

int opt_codec_debug(const char *opt, const char *arg);
int opt_codec_debug(void *optctx, const char *opt, const char *arg);

/**
* Limit the execution time.
*/
int opt_timelimit(const char *opt, const char *arg);
int opt_timelimit(void *optctx, const char *opt, const char *arg);

/**
* Parse a string and return its corresponding value as a double.
Expand Down Expand Up @@ -154,7 +154,8 @@ typedef struct {
#define OPT_INT64 0x0400
#define OPT_EXIT 0x0800
#define OPT_DATA 0x1000
#define OPT_FUNC2 0x2000
#define OPT_PERFILE 0x2000 /* the option is per-file (currently ffmpeg-only).
implied by OPT_OFFSET or OPT_SPEC */
#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */
#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt.
Implies OPT_OFFSET. Next element after the offset is
Expand All @@ -163,8 +164,7 @@ typedef struct {
#define OPT_DOUBLE 0x20000
union {
void *dst_ptr;
int (*func_arg)(const char *, const char *);
int (*func2_arg)(void *, const char *, const char *);
int (*func_arg)(void *, const char *, const char *);
size_t off;
} u;
const char *help;
Expand Down Expand Up @@ -198,7 +198,7 @@ void show_help_default(const char *opt, const char *arg);
/**
* Generic -h handler common to all avtools.
*/
int show_help(const char *opt, const char *arg);
int show_help(void *optctx, const char *opt, const char *arg);

/**
* Parse the command line arguments.
Expand Down Expand Up @@ -296,81 +296,81 @@ void show_banner(int argc, char **argv, const OptionDef *options);
* libraries.
* This option processing function does not utilize the arguments.
*/
int show_version(const char *opt, const char *arg);
int show_version(void *optctx, const char *opt, const char *arg);

/**
* Print the license of the program to stdout. The license depends on
* the license of the libraries compiled into the program.
* This option processing function does not utilize the arguments.
*/
int show_license(const char *opt, const char *arg);
int show_license(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the formats supported by the
* program.
* This option processing function does not utilize the arguments.
*/
int show_formats(const char *opt, const char *arg);
int show_formats(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the codecs supported by the
* program.
* This option processing function does not utilize the arguments.
*/
int show_codecs(const char *opt, const char *arg);
int show_codecs(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the decoders supported by the
* program.
*/
int show_decoders(const char *opt, const char *arg);
int show_decoders(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the encoders supported by the
* program.
*/
int show_encoders(const char *opt, const char *arg);
int show_encoders(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the filters supported by the
* program.
* This option processing function does not utilize the arguments.
*/
int show_filters(const char *opt, const char *arg);
int show_filters(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the bit stream filters supported by the
* program.
* This option processing function does not utilize the arguments.
*/
int show_bsfs(const char *opt, const char *arg);
int show_bsfs(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the protocols supported by the
* program.
* This option processing function does not utilize the arguments.
*/
int show_protocols(const char *opt, const char *arg);
int show_protocols(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the pixel formats supported by the
* program.
* This option processing function does not utilize the arguments.
*/
int show_pix_fmts(const char *opt, const char *arg);
int show_pix_fmts(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the standard channel layouts supported by
* the program.
* This option processing function does not utilize the arguments.
*/
int show_layouts(const char *opt, const char *arg);
int show_layouts(void *optctx, const char *opt, const char *arg);

/**
* Print a listing containing all the sample formats supported by the
* program.
*/
int show_sample_fmts(const char *opt, const char *arg);
int show_sample_fmts(void *optctx, const char *opt, const char *arg);

/**
* Return a positive value if a line read from standard input
Expand Down
Loading

0 comments on commit 98298eb

Please sign in to comment.