comparison opt.c @ 4629:2faa1399dd68 libavcodec

add av_opt_set_defaults2() which sets just defaults from AVOptions whos flags match a user specified & mask = flags
author michael
date Wed, 07 Mar 2007 02:21:35 +0000
parents b0016ed89048
children 66aff3b71861
comparison
equal deleted inserted replaced
4628:b0016ed89048 4629:2faa1399dd68
341 * They are set to the defaults specified in the according AVOption options 341 * They are set to the defaults specified in the according AVOption options
342 * array default_val field. 342 * array default_val field.
343 * 343 *
344 * @param s AVCodecContext or AVFormatContext for which the defaults will be set 344 * @param s AVCodecContext or AVFormatContext for which the defaults will be set
345 */ 345 */
346 void av_opt_set_defaults(void *s) 346 void av_opt_set_defaults2(void *s, int mask, int flags)
347 { 347 {
348 const AVOption *opt = NULL; 348 const AVOption *opt = NULL;
349 while ((opt = av_next_option(s, opt)) != NULL) { 349 while ((opt = av_next_option(s, opt)) != NULL) {
350 if((opt->flags & mask) != flags)
351 continue;
350 switch(opt->type) { 352 switch(opt->type) {
351 case FF_OPT_TYPE_CONST: 353 case FF_OPT_TYPE_CONST:
352 /* Nothing to be done here */ 354 /* Nothing to be done here */
353 break; 355 break;
354 case FF_OPT_TYPE_FLAGS: 356 case FF_OPT_TYPE_FLAGS:
377 av_log(s, AV_LOG_DEBUG, "AVOption type %d of option %s not implemented yet\n", opt->type, opt->name); 379 av_log(s, AV_LOG_DEBUG, "AVOption type %d of option %s not implemented yet\n", opt->type, opt->name);
378 } 380 }
379 } 381 }
380 } 382 }
381 383
384 void av_opt_set_defaults(void *s){
385 av_opt_set_defaults2(s, 0, 0);
386 }
387