65
65
* static const AVOption options[] = {
66
66
* { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
67
* AV_OPT_TYPE_INT, { -1 }, INT_MIN, INT_MAX },
67
* AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX },
68
68
* { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
69
69
* AV_OPT_TYPE_STRING },
70
70
* { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
123
123
* } child_struct;
124
124
* static const AVOption child_opts[] = {
125
125
* { "test_flags", "This is a test option of flags type.",
126
* offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX },
126
* offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX },
129
129
* static const AVClass child_class = {
170
170
* above, put the following into the child_opts array:
172
172
* { "test_flags", "This is a test option of flags type.",
173
* offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, "test_unit" },
174
* { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { 16 }, 0, 0, "test_unit" },
173
* offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, "test_unit" },
174
* { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { .i64 = 16 }, 0, 0, "test_unit" },
177
177
* @section avoptions_use Using AVOptions
287
276
const char *unit;
292
* Look for an option in obj. Look only for the options which
293
* have the flags set as specified in mask and flags (that is,
294
* for which it is the case that opt->flags & mask == flags).
296
* @param[in] obj a pointer to a struct whose first element is a
297
* pointer to an AVClass
298
* @param[in] name the name of the option to look for
299
* @param[in] unit the unit of the option to look for, or any if NULL
300
* @return a pointer to the option found, or NULL if no option
303
* @deprecated use av_opt_find.
306
const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
309
#if FF_API_OLD_AVOPTIONS
311
* Set the field of obj with the given name to value.
313
* @param[in] obj A struct whose first element is a pointer to an
315
* @param[in] name the name of the field to set
316
* @param[in] val The value to set. If the field is not of a string
317
* type, then the given string is parsed.
318
* SI postfixes and some named scalars are supported.
319
* If the field is of a numeric type, it has to be a numeric or named
320
* scalar. Behavior with more than one scalar and +- infix operators
322
* If the field is of a flags type, it has to be a sequence of numeric
323
* scalars or named flags separated by '+' or '-'. Prefixing a flag
324
* with '+' causes it to be set without affecting the other flags;
325
* similarly, '-' unsets a flag.
326
* @param[out] o_out if non-NULL put here a pointer to the AVOption
328
* @param alloc this parameter is currently ignored
329
* @return 0 if the value has been set, or an AVERROR code in case of
331
* AVERROR_OPTION_NOT_FOUND if no matching option exists
332
* AVERROR(ERANGE) if the value is out of range
333
* AVERROR(EINVAL) if the value is not valid
334
* @deprecated use av_opt_set()
337
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
339
attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
340
attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
341
attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
343
attribute_deprecated double av_get_double(void *obj, const char *name, const AVOption **o_out);
344
attribute_deprecated AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
345
attribute_deprecated int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
346
attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
347
attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
351
280
* Show the obj options.
560
484
int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
561
485
int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
562
486
int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
487
int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);