00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef AVUTIL_OPT_H
00023 #define AVUTIL_OPT_H
00024 
00030 #include "rational.h"
00031 #include "avutil.h"
00032 #include "dict.h"
00033 #include "log.h"
00034 
00218 enum AVOptionType{
00219     AV_OPT_TYPE_FLAGS,
00220     AV_OPT_TYPE_INT,
00221     AV_OPT_TYPE_INT64,
00222     AV_OPT_TYPE_DOUBLE,
00223     AV_OPT_TYPE_FLOAT,
00224     AV_OPT_TYPE_STRING,
00225     AV_OPT_TYPE_RATIONAL,
00226     AV_OPT_TYPE_BINARY,  
00227     AV_OPT_TYPE_CONST = 128,
00228 #if FF_API_OLD_AVOPTIONS
00229     FF_OPT_TYPE_FLAGS = 0,
00230     FF_OPT_TYPE_INT,
00231     FF_OPT_TYPE_INT64,
00232     FF_OPT_TYPE_DOUBLE,
00233     FF_OPT_TYPE_FLOAT,
00234     FF_OPT_TYPE_STRING,
00235     FF_OPT_TYPE_RATIONAL,
00236     FF_OPT_TYPE_BINARY,  
00237     FF_OPT_TYPE_CONST=128,
00238 #endif
00239 };
00240 
00244 typedef struct AVOption {
00245     const char *name;
00246 
00251     const char *help;
00252 
00257     int offset;
00258     enum AVOptionType type;
00259 
00263     union {
00264         double dbl;
00265         const char *str;
00266         
00267         int64_t i64;
00268         AVRational q;
00269     } default_val;
00270     double min;                 
00271     double max;                 
00272 
00273     int flags;
00274 #define AV_OPT_FLAG_ENCODING_PARAM  1   
00275 #define AV_OPT_FLAG_DECODING_PARAM  2   
00276 #define AV_OPT_FLAG_METADATA        4   
00277 #define AV_OPT_FLAG_AUDIO_PARAM     8
00278 #define AV_OPT_FLAG_VIDEO_PARAM     16
00279 #define AV_OPT_FLAG_SUBTITLE_PARAM  32
00280 
00281 
00287     const char *unit;
00288 } AVOption;
00289 
00290 #if FF_API_FIND_OPT
00291 
00305 attribute_deprecated
00306 const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
00307 #endif
00308 
00309 #if FF_API_OLD_AVOPTIONS
00310 
00336 attribute_deprecated
00337 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
00338 
00339 attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
00340 attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
00341 attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
00342 
00343 double av_get_double(void *obj, const char *name, const AVOption **o_out);
00344 AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
00345 int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
00346 attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
00347 attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
00348 #endif
00349 
00359 int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
00360 
00366 void av_opt_set_defaults(void *s);
00367 
00368 #if FF_API_OLD_AVOPTIONS
00369 attribute_deprecated
00370 void av_opt_set_defaults2(void *s, int mask, int flags);
00371 #endif
00372 
00390 int av_set_options_string(void *ctx, const char *opts,
00391                           const char *key_val_sep, const char *pairs_sep);
00392 
00396 void av_opt_free(void *obj);
00397 
00406 int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
00407 
00408 
00409 
00410 
00411 
00412 
00413 
00414 
00415 
00416 
00417 
00418 
00419 
00420 
00421 
00422 int av_opt_set_dict(void *obj, struct AVDictionary **options);
00423 
00438 int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int        *flags_out);
00439 int av_opt_eval_int   (void *obj, const AVOption *o, const char *val, int        *int_out);
00440 int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t    *int64_out);
00441 int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float      *float_out);
00442 int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double     *double_out);
00443 int av_opt_eval_q     (void *obj, const AVOption *o, const char *val, AVRational *q_out);
00448 #define AV_OPT_SEARCH_CHILDREN   0x0001 
00456 #define AV_OPT_SEARCH_FAKE_OBJ   0x0002
00457 
00480 const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
00481                             int opt_flags, int search_flags);
00482 
00504 const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
00505                              int opt_flags, int search_flags, void **target_obj);
00506 
00516 const AVOption *av_opt_next(void *obj, const AVOption *prev);
00517 
00524 void *av_opt_child_next(void *obj, void *prev);
00525 
00532 const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
00533 
00560 int av_opt_set       (void *obj, const char *name, const char *val, int search_flags);
00561 int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
00562 int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
00563 int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
00583 int av_opt_get       (void *obj, const char *name, int search_flags, uint8_t   **out_val);
00584 int av_opt_get_int   (void *obj, const char *name, int search_flags, int64_t    *out_val);
00585 int av_opt_get_double(void *obj, const char *name, int search_flags, double     *out_val);
00586 int av_opt_get_q     (void *obj, const char *name, int search_flags, AVRational *out_val);
00598 void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name);
00603 #endif