#endif
struct SwsContext *sws_opts;
-AVDictionary *format_opts, *codec_opts;
+AVDictionary *format_opts, *codec_opts, *resample_opts;
static const int this_year = 2013;
#endif
av_dict_free(&format_opts);
av_dict_free(&codec_opts);
+ av_dict_free(&resample_opts);
}
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
char opt_stripped[128];
const char *p;
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
+#if CONFIG_AVRESAMPLE
+ const AVClass *rc = avresample_get_class();
+#endif
#if CONFIG_SWSCALE
const AVClass *sc = sws_get_class();
#endif
else if ((o = av_opt_find(&fc, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
av_dict_set(&format_opts, opt, arg, FLAGS);
+#if CONFIG_AVRESAMPLE
+ else if ((o = av_opt_find(&rc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
+ av_dict_set(&resample_opts, opt, arg, FLAGS);
+#endif
#if CONFIG_SWSCALE
else if ((o = av_opt_find(&sc, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
#endif
g->codec_opts = codec_opts;
g->format_opts = format_opts;
+ g->resample_opts = resample_opts;
codec_opts = NULL;
format_opts = NULL;
+ resample_opts = NULL;
#if CONFIG_SWSCALE
sws_opts = NULL;
#endif
av_freep(&l->groups[j].opts);
av_dict_free(&l->groups[j].codec_opts);
av_dict_free(&l->groups[j].format_opts);
+ av_dict_free(&l->groups[j].resample_opts);
#if CONFIG_SWSCALE
sws_freeContext(l->groups[j].sws_opts);
#endif
return AVERROR_OPTION_NOT_FOUND;
}
- if (octx->cur_group.nb_opts || codec_opts || format_opts)
+ if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
"commandline.\n");
int read_yesno(void)
{
int c = getchar();
- int yesno = (toupper(c) == 'Y');
+ int yesno = (av_toupper(c) == 'Y');
while (c != '\n' && c != EOF)
c = getchar();
if (!codec)
codec = s->oformat ? avcodec_find_encoder(codec_id)
: avcodec_find_decoder(codec_id);
- if (!codec)
- return NULL;
- switch (codec->type) {
+ switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
prefix = 'v';
flags |= AV_OPT_FLAG_VIDEO_PARAM;
av_freep(&buf);
return ret;
}
- /* XXX this shouldn't be needed, but some tests break without this line
- * those decoders are buggy and need to be fixed.
- * the following tests fail:
- */
- memset(buf->base[0], 128, ret);
av_pix_fmt_get_chroma_sub_sample(s->pix_fmt,
&h_chroma_shift, &v_chroma_shift);