aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/opt.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-24 00:51:40 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-24 00:51:40 +0000
commite44c01563f03bf5cd0b6e59fd32f145db3861b33 (patch)
tree9b2bc01bb182ffd3ac0fb680768c4a1fed40dddd /libavcodec/opt.c
parent47941088f9d157216e942f6172cd39378493f52d (diff)
downloadffmpeg-e44c01563f03bf5cd0b6e59fd32f145db3861b33.tar.gz
Deprecate av_opt_show() in favor of a new function av_opt_show2(),
which allows to specify only a subset of all the options to show. Originally committed as revision 25166 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/opt.c')
-rw-r--r--libavcodec/opt.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/libavcodec/opt.c b/libavcodec/opt.c
index 128d95d1ce..e3b2a0bda7 100644
--- a/libavcodec/opt.c
+++ b/libavcodec/opt.c
@@ -319,12 +319,13 @@ int64_t av_get_int(void *obj, const char *name, const AVOption **o_out){
return num*intnum/den;
}
-static void opt_list(void *obj, void *av_log_obj, const char *unit)
+static void opt_list(void *obj, void *av_log_obj, const char *unit,
+ int req_flags, int rej_flags)
{
const AVOption *opt=NULL;
while((opt= av_next_option(obj, opt))){
- if(!(opt->flags & (AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM)))
+ if (!(opt->flags & req_flags) || (opt->flags & rej_flags))
continue;
/* Don't print CONST's on level one.
@@ -383,22 +384,30 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit)
av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
av_log(av_log_obj, AV_LOG_INFO, "\n");
if (opt->unit && opt->type != FF_OPT_TYPE_CONST) {
- opt_list(obj, av_log_obj, opt->unit);
+ opt_list(obj, av_log_obj, opt->unit, req_flags, rej_flags);
}
}
}
-int av_opt_show(void *obj, void *av_log_obj){
+int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
+{
if(!obj)
return -1;
av_log(av_log_obj, AV_LOG_INFO, "%s AVOptions:\n", (*(AVClass**)obj)->class_name);
- opt_list(obj, av_log_obj, NULL);
+ opt_list(obj, av_log_obj, NULL, req_flags, rej_flags);
return 0;
}
+#if FF_API_OPT_SHOW
+int av_opt_show(void *obj, void *av_log_obj){
+ return av_opt_show2(obj, av_log_obj,
+ AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
+}
+#endif
+
/** Set the values of the AVCodecContext or AVFormatContext structure.
* They are set to the defaults specified in the according AVOption options
* array default_val field.