Commit 0fafc7b8 authored by michael's avatar michael

add av_opt_set_defaults2() which sets just defaults from AVOptions whos flags...

add av_opt_set_defaults2() which sets just defaults from AVOptions whos flags match a user specified & mask = flags


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8280 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2d10e245
...@@ -343,10 +343,12 @@ int av_opt_show(void *obj, void *av_log_obj){ ...@@ -343,10 +343,12 @@ int av_opt_show(void *obj, void *av_log_obj){
* *
* @param s AVCodecContext or AVFormatContext for which the defaults will be set * @param s AVCodecContext or AVFormatContext for which the defaults will be set
*/ */
void av_opt_set_defaults(void *s) void av_opt_set_defaults2(void *s, int mask, int flags)
{ {
const AVOption *opt = NULL; const AVOption *opt = NULL;
while ((opt = av_next_option(s, opt)) != NULL) { while ((opt = av_next_option(s, opt)) != NULL) {
if((opt->flags & mask) != flags)
continue;
switch(opt->type) { switch(opt->type) {
case FF_OPT_TYPE_CONST: case FF_OPT_TYPE_CONST:
/* Nothing to be done here */ /* Nothing to be done here */
...@@ -379,3 +381,7 @@ void av_opt_set_defaults(void *s) ...@@ -379,3 +381,7 @@ void av_opt_set_defaults(void *s)
} }
} }
void av_opt_set_defaults(void *s){
av_opt_set_defaults2(s, 0, 0);
}
...@@ -80,5 +80,6 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c ...@@ -80,5 +80,6 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
const AVOption *av_next_option(void *obj, const AVOption *last); const AVOption *av_next_option(void *obj, const AVOption *last);
int av_opt_show(void *obj, void *av_log_obj); int av_opt_show(void *obj, void *av_log_obj);
void av_opt_set_defaults(void *s); void av_opt_set_defaults(void *s);
void av_opt_set_defaults2(void *s, int mask, int flags);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment