AVFormatContext *avformat_opts;
struct SwsContext *sws_opts;
-const int this_year = 2011;
+static const int this_year = 2011;
void init_opts(void)
{
for (i = 0; i < AVMEDIA_TYPE_NB; i++)
avcodec_opts[i] = avcodec_alloc_context2(i);
avformat_opts = avformat_alloc_context();
+#if CONFIG_SWSCALE
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC, NULL, NULL, NULL);
+#endif
}
void uninit_opts(void)
av_freep(&avcodec_opts[i]);
av_freep(&avformat_opts->key);
av_freep(&avformat_opts);
+#if CONFIG_SWSCALE
av_freep(&sws_opts);
+#endif
}
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl)
} else if (po->flags & OPT_INT64) {
*po->u.int64_arg = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
} else if (po->flags & OPT_FLOAT) {
- *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
+ *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
} else if (po->flags & OPT_FUNC2) {
if (po->u.func2_arg(opt, arg) < 0) {
fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
}
if (!o) {
AVCodec *p = NULL;
+ AVOutputFormat *oformat = NULL;
while ((p=av_codec_next(p))){
AVClass *c= p->priv_class;
if(c && av_find_opt(&c, opt, NULL, 0, 0))
break;
}
- if(!p){
- fprintf(stderr, "Unrecognized option '%s'\n", opt);
- exit(1);
+ if (!p) {
+ while ((oformat = av_oformat_next(oformat))) {
+ const AVClass *c = oformat->priv_class;
+ if (c && av_find_opt(&c, opt, NULL, 0, 0))
+ break;
+ }
+ }
+ if(!p && !oformat){
+ fprintf(stderr, "Unrecognized option '%s'\n", opt);
+ exit(1);
}
}
if(codec && codec->priv_class && avctx->priv_data){
priv_ctx= avctx->priv_data;
}
+ } else if (!strcmp("AVFormatContext", (*(AVClass**)ctx)->class_name)) {
+ AVFormatContext *avctx = ctx;
+ if (avctx->oformat && avctx->oformat->priv_class) {
+ priv_ctx = avctx->priv_data;
+ }
}
+
for(i=0; i<opt_name_count; i++){
char buf[256];
const AVOption *opt;
const char *indent = flags & INDENT? " " : ""; \
if (flags & SHOW_VERSION) { \
unsigned int version = libname##_version(); \
- fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n", \
+ fprintf(outstream, "%slib%-9s %2d.%3d.%2d / %2d.%3d.%2d\n", \
indent, #libname, \
LIB##LIBNAME##_VERSION_MAJOR, \
LIB##LIBNAME##_VERSION_MINOR, \