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 AV_OPT_TYPE_IMAGE_SIZE = MKBETAG('S','I','Z','E'),
00229 #if FF_API_OLD_AVOPTIONS
00230 FF_OPT_TYPE_FLAGS = 0,
00231 FF_OPT_TYPE_INT,
00232 FF_OPT_TYPE_INT64,
00233 FF_OPT_TYPE_DOUBLE,
00234 FF_OPT_TYPE_FLOAT,
00235 FF_OPT_TYPE_STRING,
00236 FF_OPT_TYPE_RATIONAL,
00237 FF_OPT_TYPE_BINARY,
00238 FF_OPT_TYPE_CONST=128,
00239 #endif
00240 };
00241
00245 typedef struct AVOption {
00246 const char *name;
00247
00252 const char *help;
00253
00258 int offset;
00259 enum AVOptionType type;
00260
00264 union {
00265 double dbl;
00266 const char *str;
00267
00268 int64_t i64;
00269 AVRational q;
00270 } default_val;
00271 double min;
00272 double max;
00273
00274 int flags;
00275 #define AV_OPT_FLAG_ENCODING_PARAM 1
00276 #define AV_OPT_FLAG_DECODING_PARAM 2
00277 #define AV_OPT_FLAG_METADATA 4
00278 #define AV_OPT_FLAG_AUDIO_PARAM 8
00279 #define AV_OPT_FLAG_VIDEO_PARAM 16
00280 #define AV_OPT_FLAG_SUBTITLE_PARAM 32
00281
00282
00288 const char *unit;
00289 } AVOption;
00290
00291 #if FF_API_FIND_OPT
00292
00306 attribute_deprecated
00307 const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
00308 #endif
00309
00310 #if FF_API_OLD_AVOPTIONS
00311
00337 attribute_deprecated
00338 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
00339
00340 attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
00341 attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
00342 attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
00343
00344 double av_get_double(void *obj, const char *name, const AVOption **o_out);
00345 AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
00346 int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
00347 attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
00348 attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
00349 #endif
00350
00360 int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
00361
00367 void av_opt_set_defaults(void *s);
00368
00369 #if FF_API_OLD_AVOPTIONS
00370 attribute_deprecated
00371 void av_opt_set_defaults2(void *s, int mask, int flags);
00372 #endif
00373
00391 int av_set_options_string(void *ctx, const char *opts,
00392 const char *key_val_sep, const char *pairs_sep);
00393
00397 void av_opt_free(void *obj);
00398
00407 int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423 int av_opt_set_dict(void *obj, struct AVDictionary **options);
00424
00439 int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out);
00440 int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out);
00441 int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out);
00442 int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out);
00443 int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out);
00444 int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out);
00449 #define AV_OPT_SEARCH_CHILDREN 0x0001
00457 #define AV_OPT_SEARCH_FAKE_OBJ 0x0002
00458
00481 const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
00482 int opt_flags, int search_flags);
00483
00505 const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
00506 int opt_flags, int search_flags, void **target_obj);
00507
00517 const AVOption *av_opt_next(void *obj, const AVOption *prev);
00518
00525 void *av_opt_child_next(void *obj, void *prev);
00526
00533 const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
00534
00561 int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
00562 int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
00563 int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
00564 int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
00584 int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
00585 int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
00586 int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
00587 int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
00599 void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name);
00604 #endif