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 AV_OPT_TYPE_PIXEL_FMT = MKBETAG('P','F','M','T'),
00230 #if FF_API_OLD_AVOPTIONS
00231 FF_OPT_TYPE_FLAGS = 0,
00232 FF_OPT_TYPE_INT,
00233 FF_OPT_TYPE_INT64,
00234 FF_OPT_TYPE_DOUBLE,
00235 FF_OPT_TYPE_FLOAT,
00236 FF_OPT_TYPE_STRING,
00237 FF_OPT_TYPE_RATIONAL,
00238 FF_OPT_TYPE_BINARY,
00239 FF_OPT_TYPE_CONST=128,
00240 #endif
00241 };
00242
00246 typedef struct AVOption {
00247 const char *name;
00248
00253 const char *help;
00254
00259 int offset;
00260 enum AVOptionType type;
00261
00265 union {
00266 int64_t i64;
00267 double dbl;
00268 const char *str;
00269
00270 AVRational q;
00271 } default_val;
00272 double min;
00273 double max;
00274
00275 int flags;
00276 #define AV_OPT_FLAG_ENCODING_PARAM 1
00277 #define AV_OPT_FLAG_DECODING_PARAM 2
00278 #define AV_OPT_FLAG_METADATA 4
00279 #define AV_OPT_FLAG_AUDIO_PARAM 8
00280 #define AV_OPT_FLAG_VIDEO_PARAM 16
00281 #define AV_OPT_FLAG_SUBTITLE_PARAM 32
00282 #define AV_OPT_FLAG_FILTERING_PARAM (1<<16)
00283 //FIXME think about enc-audio, ... style flags
00284
00290 const char *unit;
00291 } AVOption;
00292
00293 #if FF_API_FIND_OPT
00294
00308 attribute_deprecated
00309 const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
00310 #endif
00311
00312 #if FF_API_OLD_AVOPTIONS
00313
00339 attribute_deprecated
00340 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
00341
00342 attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
00343 attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
00344 attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
00345
00346 double av_get_double(void *obj, const char *name, const AVOption **o_out);
00347 AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
00348 int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
00349 attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
00350 attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
00351 #endif
00352
00362 int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
00363
00369 void av_opt_set_defaults(void *s);
00370
00371 #if FF_API_OLD_AVOPTIONS
00372 attribute_deprecated
00373 void av_opt_set_defaults2(void *s, int mask, int flags);
00374 #endif
00375
00393 int av_set_options_string(void *ctx, const char *opts,
00394 const char *key_val_sep, const char *pairs_sep);
00395
00399 void av_opt_free(void *obj);
00400
00409 int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425 int av_opt_set_dict(void *obj, struct AVDictionary **options);
00426
00441 int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out);
00442 int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out);
00443 int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out);
00444 int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out);
00445 int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out);
00446 int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out);
00451 #define AV_OPT_SEARCH_CHILDREN 0x0001
00459 #define AV_OPT_SEARCH_FAKE_OBJ 0x0002
00460
00483 const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
00484 int opt_flags, int search_flags);
00485
00507 const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
00508 int opt_flags, int search_flags, void **target_obj);
00509
00519 const AVOption *av_opt_next(void *obj, const AVOption *prev);
00520
00527 void *av_opt_child_next(void *obj, void *prev);
00528
00535 const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
00536
00563 int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
00564 int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
00565 int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
00566 int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
00567 int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
00587 int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
00588 int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
00589 int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
00590 int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
00602 void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name);
00607 #endif