50 if (!strcmp(o->
name, name) && (!unit || (o->
unit && !strcmp(o->
unit, unit))) && (o->
flags & mask) == flags)
57 #if FF_API_OLD_AVOPTIONS
67 if (!last &&
class &&
class->option &&
class->option[0].name)
69 if (last && last[1].
name)
96 if (o->
max*den < num*intnum || o->
min*den > num*intnum) {
137 if (c >=
'0' && c <=
'9')
return c -
'0';
138 if (c >=
'a' && c <=
'f')
return c -
'a' + 10;
139 if (c >=
'A' && c <=
'F')
return c -
'A' + 10;
145 int *lendst = (
int *)(dst + 1);
147 int len = strlen(val);
160 if (a < 0 || b < 0) {
164 *ptr++ = (a << 4) | b;
179 #define DEFAULT_NUMVAL(opt) ((opt->type == AV_OPT_TYPE_INT64 || \
180 opt->type == AV_OPT_TYPE_CONST || \
181 opt->type == AV_OPT_TYPE_FLAGS || \
182 opt->type == AV_OPT_TYPE_INT) ? \
183 opt->default_val.i64 : opt->default_val.dbl)
187 int ret = 0, notfirst = 0;
196 if (*val ==
'+' || *val ==
'-') {
203 for (; i <
sizeof(
buf) - 1 && val[i] && val[i] !=
'+' && val[i] !=
'-'; i++)
212 else if (!strcmp(buf,
"max" )) d = o->
max;
213 else if (!strcmp(buf,
"min" )) d = o->
min;
214 else if (!strcmp(buf,
"none" )) d = 0;
215 else if (!strcmp(buf,
"all" )) d = ~0;
217 int res =
av_expr_parse_and_eval(&d, buf,
const_names,
const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);
226 if (cmd ==
'+') d = intnum | (int64_t)d;
227 else if (cmd ==
'-') d = intnum &~(int64_t)d;
230 if (cmd ==
'+') d = notfirst*num*intnum/den + d;
231 else if (cmd ==
'-') d = notfirst*num*intnum/den - d;
245 #if FF_API_OLD_AVOPTIONS
258 void *dst, *target_obj;
260 if (!o || !target_obj)
280 if (!val || !strcmp(val,
"none")) {
281 *(
int *)dst = *((
int *)dst + 1) = 0;
286 av_log(obj,
AV_LOG_ERROR,
"Unable to parse option value \"%s\" as image size\n", val);
295 av_log(obj,
AV_LOG_ERROR,
"Unable to parse option value \"%s\" as video rate\n", val);
298 if (!val || !strcmp(val,
"none")) {
304 ret = strtol(val, &tail, 0);
306 av_log(obj,
AV_LOG_ERROR,
"Unable to parse option value \"%s\" as pixel format\n", val);
314 if (!val || !strcmp(val,
"none")) {
320 ret = strtol(val, &tail, 0);
322 av_log(obj,
AV_LOG_ERROR,
"Unable to parse option value \"%s\" as sample format\n", val);
350 if (!val || !strcmp(val,
"none")) {
353 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
359 av_log(obj,
AV_LOG_ERROR,
"Unable to parse option value \"%s\" as channel layout\n", val);
362 *(int64_t *)dst = cl;
372 #define OPT_EVAL_NUMBER(name, opttype, vartype)\
373 int av_opt_eval_ ## name(void *obj, const AVOption *o, const char *val, vartype *name ## _out)\
375 if (!o || o->type != opttype)\
376 return AVERROR(EINVAL);\
377 return set_string_number(obj, obj, o, val, name ## _out);\
387 static
int set_number(
void *obj, const
char *
name,
double num,
int den, int64_t intnum,
390 void *dst, *target_obj;
393 if (!o || !target_obj)
400 #if FF_API_OLD_AVOPTIONS
428 return set_number(obj, name, 1, 1, val, search_flags);
433 return set_number(obj, name, val, 1, 1, search_flags);
449 if (!o || !target_obj)
460 lendst = (
int *)(dst + 1);
466 memcpy(ptr, val, len);
476 if (!o || !target_obj)
480 "The value set by option '%s' is not an image size.\n", o->
name);
485 "Invalid negative size value %dx%d for size '%s'\n", w, h, o->
name);
489 *(
int *)(((
uint8_t *)target_obj+
sizeof(int)) + o->
offset) = h;
498 if (!o || !target_obj)
502 "The value set by option '%s' is not a video rate.\n", o->
name);
505 if (val.
num <= 0 || val.
den <= 0)
515 search_flags, &target_obj);
519 if (!o || !target_obj)
521 if (o->
type != type) {
523 "The value set by option '%s' is not a %s format", name, desc);
527 #if LIBAVUTIL_VERSION_MAJOR < 53
537 if (fmt < min || fmt > max) {
539 "Value %d for parameter '%s' out of %s format range [%d - %d]\n",
540 fmt, name, desc, min, max);
562 if (!o || !target_obj)
566 "The value set by option '%s' is not a channel layout.\n", o->
name);
569 *(
int *)(((int64_t *)target_obj) + o->
offset) = cl;
573 #if FF_API_OLD_AVOPTIONS
591 if (o_out) *o_out= o;
604 if (len >= (buf_len + 1)/2)
return NULL;
606 for (i = 0; i <
len; i++)
snprintf(buf + i*2, 3,
"%02X", bin[i]);
608 default:
return NULL;
616 void *dst, *target_obj;
645 if ((uint64_t)len*2 + 1 > INT_MAX)
650 for (i = 0; i <
len; i++)
651 snprintf(*out_val + i*2, 3,
"%02X", bin[i]);
654 ret =
snprintf(buf,
sizeof(buf),
"%dx%d", ((
int *)dst)[0], ((
int *)dst)[1]);
663 i64 = *(int64_t *)dst;
664 ret =
snprintf(buf,
sizeof(buf),
"%"PRIi64
"d:%02d:%02d.%06d",
665 i64 / 3600000000, (
int)((i64 / 60000000) % 60),
666 (
int)((i64 / 1000000) % 60), (
int)(i64 % 1000000));
669 ret =
snprintf(buf,
sizeof(buf),
"0x%02x%02x%02x%02x", ((
int *)dst)[0], ((
int *)dst)[1], ((
int *)dst)[2], ((
int *)dst)[3]);
672 i64 = *(int64_t *)dst;
673 ret =
snprintf(buf,
sizeof(buf),
"0x%"PRIx64, i64);
679 if (ret >=
sizeof(buf))
688 void *dst, *target_obj;
690 if (!o || !target_obj)
695 if (o_out) *o_out= o;
704 #if FF_API_OLD_AVOPTIONS
711 if (
get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
713 return num*intnum/den;
722 if (
get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
724 if (num == 1.0 && (
int)intnum == intnum)
727 return av_d2q(num*intnum/den, 1<<24);
736 if (
get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
738 return num*intnum/den;
748 if ((ret =
get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
750 *out_val = num*intnum/den;
760 if ((ret =
get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
762 *out_val = num*intnum/den;
772 if ((ret =
get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
775 if (num == 1.0 && (
int)intnum == intnum)
778 *out_val =
av_d2q(num*intnum/den, 1<<24);
784 void *dst, *target_obj;
786 if (!o || !target_obj)
790 "The value for option '%s' is not an image size.\n", name);
795 if (w_out) *w_out = *(
int *)dst;
796 if (h_out) *h_out = *((
int *)dst+1);
806 if ((ret =
get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
809 if (num == 1.0 && (
int)intnum == intnum)
812 *out_val =
av_d2q(num*intnum/den, 1<<24);
816 static int get_format(
void *obj,
const char *
name,
int search_flags,
int *out_fmt,
819 void *dst, *target_obj;
821 if (!o || !target_obj)
823 if (o->
type != type) {
825 "The value for option '%s' is not a %s format.\n", desc, name);
830 *out_fmt = *(
int *)dst;
846 void *dst, *target_obj;
848 if (!o || !target_obj)
852 "The value for option '%s' is not a channel layout.\n", name);
857 *cl = *(int64_t *)dst;
865 field ? field->
unit : NULL, 0, 0);
877 av_log(av_log_obj, level,
"INT_MAX");
878 }
else if (d == INT_MIN) {
879 av_log(av_log_obj, level,
"INT_MIN");
880 }
else if (d == (
double)INT64_MAX) {
881 av_log(av_log_obj, level,
"I64_MAX");
882 }
else if (d == INT64_MIN) {
883 av_log(av_log_obj, level,
"I64_MIN");
884 }
else if (d == FLT_MAX) {
885 av_log(av_log_obj, level,
"FLT_MAX");
886 }
else if (d == FLT_MIN) {
887 av_log(av_log_obj, level,
"FLT_MIN");
889 av_log(av_log_obj, level,
"%g", d);
893 static void opt_list(
void *obj,
void *av_log_obj,
const char *unit,
894 int req_flags,
int rej_flags)
901 if (!(opt->
flags & req_flags) || (opt->
flags & rej_flags))
1009 switch (opt->
type) {
1047 opt_list(obj, av_log_obj, opt->
unit, req_flags, rej_flags);
1052 int av_opt_show2(
void *obj,
void *av_log_obj,
int req_flags,
int rej_flags)
1059 opt_list(obj, av_log_obj, NULL, req_flags, rej_flags);
1066 #if FF_API_OLD_AVOPTIONS
1076 #if FF_API_OLD_AVOPTIONS
1080 switch (opt->
type) {
1111 #if LIBAVUTIL_VERSION_MAJOR < 53
1119 #if LIBAVUTIL_VERSION_MAJOR < 53
1153 const char *key_val_sep,
const char *pairs_sep)
1162 if (*key && strspn(*buf, key_val_sep)) {
1170 av_log(ctx,
AV_LOG_ERROR,
"Missing key or no key/value separator found after key '%s'\n", key);
1187 const char *key_val_sep,
const char *pairs_sep)
1206 #define WHITESPACES " \n\t"
1210 return (
unsigned)((c | 32) -
'a') < 26 ||
1211 (unsigned)(c -
'0') < 10 ||
1212 c ==
'-' || c ==
'_' || c ==
'/' || c ==
'.';
1223 static int get_key(
const char **ropts,
const char *delim,
char **rkey)
1225 const char *opts = *ropts;
1226 const char *key_start, *key_end;
1233 if (!*opts || !strchr(delim, *opts))
1236 if (!(*rkey =
av_malloc(key_end - key_start + 1)))
1238 memcpy(*rkey, key_start, key_end - key_start);
1239 (*rkey)[key_end - key_start] = 0;
1245 const char *key_val_sep,
const char *pairs_sep,
1247 char **rkey,
char **rval)
1250 char *key = NULL, *
val;
1251 const char *opts = *ropts;
1253 if ((ret =
get_key(&opts, key_val_sep, &key)) < 0 &&
1267 const char *
const *shorthand,
1268 const char *key_val_sep,
const char *pairs_sep)
1271 const char *dummy_shorthand = NULL;
1278 shorthand = &dummy_shorthand;
1283 &parsed_key, &
value);
1299 key = *(shorthand++);
1348 int opt_flags,
int search_flags)
1350 return av_opt_find2(obj, name, unit, opt_flags, search_flags, NULL);
1354 int opt_flags,
int search_flags,
void **target_obj)
1371 if (o =
av_opt_find2(&child, name, unit, opt_flags, search_flags, NULL))
1376 if (o =
av_opt_find2(child, name, unit, opt_flags, search_flags, target_obj))
1382 if (!strcmp(o->
name, name) && (o->
flags & opt_flags) == opt_flags &&
1425 if (c->
version > (52 << 16 | 11 << 8))
1431 return callback(ranges_arg, obj, key, flags);
1444 if (!ranges || !range || !range_array || !field) {
1449 ranges->
range = range_array;
1450 ranges->
range[0] = range;
1456 switch (field->
type) {
1494 *ranges_arg = ranges;
1508 for (i = 0; i < ranges->
nb_ranges; i++) {
1519 typedef struct TestContext
1533 int64_t channel_layout;
1536 #define OFFSET(x) offsetof(TestContext, x)
1538 #define TEST_FLAG_COOL 01
1539 #define TEST_FLAG_LAME 02
1540 #define TEST_FLAG_MU 04
1542 static const AVOption test_options[]= {
1548 {
"cool",
"set cool flag ", 0,
AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_COOL}, INT_MIN, INT_MAX, 0,
"flags" },
1549 {
"lame",
"set lame flag ", 0,
AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_LAME}, INT_MIN, INT_MAX, 0,
"flags" },
1550 {
"mu",
"set mu flag ", 0,
AV_OPT_TYPE_CONST, {.i64 = TEST_FLAG_MU}, INT_MIN, INT_MAX, 0,
"flags" },
1561 static const char *test_get_name(
void *ctx)
1566 static const AVClass test_class = {
1576 printf(
"\nTesting av_set_options_string()\n");
1578 TestContext test_ctx = { 0 };
1579 static const char *
const options[] = {
1595 "flags=+mu-lame : num=42: toggle=0",
1596 "num=42 : string=blahblah",
1597 "rational=0 : rational=1/2 : rational=1/-1",
1610 "video_rate=30000/1001",
1611 "video_rate=30/1.001",
1615 "duration=1\\:23\\:45.67",
1619 "cl=stereo+downmix",
1623 test_ctx.class = &test_class;
1637 printf(
"\nTesting av_opt_set_from_string()\n");
1639 TestContext test_ctx = { 0 };
1640 static const char *
const options[] = {
1648 " 5 : hello : size = pal ",
1649 "a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42"
1651 static const char *
const shorthand[] = {
"num",
"string", NULL };
1653 test_ctx.class = &test_class;
static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)
const char const char void * val
void *(* child_next)(void *obj, void *prev)
Return next AVOptions-enabled child or NULL.
attribute_deprecated const AVOption * av_set_q(void *obj, const char *name, AVRational n)
A single allowed range of values, or a single allowed value.
static void callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
const AVClass * av_opt_child_class_next(const AVClass *parent, const AVClass *prev)
Iterate over potential AVOptions-enabled children of parent.
Number of sample formats. DO NOT USE if linking dynamically.
char * av_strdup(const char *s) av_malloc_attrib
Duplicate the string s.
static int get_key(const char **ropts, const char *delim, char **rkey)
Read a key from a string.
void av_log_set_level(int level)
Set the log level.
struct AVClass *(* child_class_next)(const struct AVClass *prev)
Return an AVClass corresponding to the next potential AVOptions-enabled child.
double value_max
For string ranges this represents the min/max length, for dimensions this represents the min/max pixe...
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
int av_set_options_string(void *ctx, const char *opts, const char *key_val_sep, const char *pairs_sep)
Parse the key/value pairs list in opts.
union AVOption::@31 default_val
the default value for scalar options
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int size, int search_flags)
int av_opt_get_q(void *obj, const char *name, int search_flags, AVRational *out_val)
static void opt_list(void *obj, void *av_log_obj, const char *unit, int req_flags, int rej_flags)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
#define AV_OPT_FLAG_FILTERING_PARAM
a generic parameter which can be set by the user for filtering
attribute_deprecated const AVOption * av_next_option(void *obj, const AVOption *last)
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val)
int av_opt_set_from_string(void *ctx, const char *opts, const char *const *shorthand, const char *key_val_sep, const char *pairs_sep)
Parse the key-value pairs list in opts.
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
static int get_format(void *obj, const char *name, int search_flags, int *out_fmt, enum AVOptionType type, const char *desc)
#define AV_OPT_FLAG_SUBTITLE_PARAM
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
AVS_FilterInfo AVS_Value child
#define AV_CH_LAYOUT_HEXAGONAL
int av_opt_set_double(void *obj, const char *name, double val, int search_flags)
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
#define AV_OPT_FLAG_VIDEO_PARAM
static const double const_values[]
double component_max
For string this represents the unicode range for chars, 0-127 limits to ASCII.
enum AVPixelFormat pix_fmt
attribute_deprecated const AVOption * av_set_double(void *obj, const char *name, double n)
const char * unit
The logical unit to which the option belongs.
const OptionDef options[]
static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum, int search_flags)
int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags)
const AVOption * av_opt_next(void *obj, const AVOption *prev)
Iterate over all AVOptions belonging to obj.
attribute_deprecated const AVOption * av_set_int(void *obj, const char *name, int64_t n)
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.
attribute_deprecated const char * av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len)
static int hexchar2int(char c)
int av_opt_get_pixel_fmt(void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt)
#define av_err2str(errnum)
int av_opt_set_pixel_fmt(void *obj, const char *name, enum AVPixelFormat fmt, int search_flags)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static const uint16_t mask[17]
#define AV_OPT_FLAG_AUDIO_PARAM
double max
maximum valid value for the option
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_dict_free(AVDictionary **m)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
double av_get_double(void *obj, const char *name, const AVOption **o_out)
#define AV_VERSION_INT(a, b, c)
AVPixelFormat
Pixel format.
int av_parse_video_rate(AVRational *rate, const char *str)
Parse str and store the detected values in *rate.
void * av_opt_ptr(const AVClass *avclass, void *obj, const char *name)
Gets a pointer to the requested field in a struct.
static const char *const const_names[]
static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **dst)
#define FF_ARRAY_ELEMS(a)
int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt)
audio channel layout utility functions
AVRational av_d2q(double d, int max) av_const
Convert a double precision floating point number to a rational.
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out)
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int parse_key_value_pair(void *ctx, const char **buf, const char *key_val_sep, const char *pairs_sep)
Store the value in the field in ctx that is named like key.
int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, int search_flags)
double min
minimum valid value for the option
static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)
attribute_deprecated const AVOption * av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags)
Look for an option in obj.
const char * help
short English help text
static int set_string_binary(void *obj, const AVOption *o, const char *val, uint8_t **dst)
int av_expr_parse_and_eval(double *res, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Accept to parse a value without a key; the key will then be returned as NULL.
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
offset must point to a pointer immediately followed by an int for the length
int av_opt_query_ranges_default(AVOptionRanges **, void *obj, const char *key, int flags)
Get a default list of allowed ranges for the given option.
struct AVOption * option
a pointer to the first option specified in the class if any or NULL
int is_range
if set to 1 the struct encodes a range, if set to 0 a single value
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
static void log_value(void *av_log_obj, int level, double d)
AVSampleFormat
Audio Sample Formats.
#define AV_LOG_INFO
Standard information.
static int set_format(void *obj, const char *name, int fmt, int search_flags, enum AVOptionType type, const char *desc, int nb_fmts)
void av_opt_freep_ranges(AVOptionRanges **ranges)
Free an AVOptionRanges struct and set it to NULL.
int offset
The offset relative to the context structure where the option value is stored.
int av_opt_set_dict(void *obj, struct AVDictionary **options)
Set all the options from a given dictionary on an object.
static int set_number(void *obj, const char *name, double num, int den, int64_t intnum, int search_flags)
int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
Show the obj options.
const AVOption * av_opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags)
Look for an option in an object.
#define OPT_EVAL_NUMBER(name, opttype, vartype)
simple arithmetic expression evaluator
int av_opt_get_channel_layout(void *obj, const char *name, int search_flags, int64_t *ch_layout)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_OPTION_NOT_FOUND
Describe the class of an AVClass context structure.
rational number numerator/denominator
offset must point to AVRational
int av_parse_time(int64_t *timeval, const char *timestr, int duration)
Parse timestr and return in *time a corresponding number of microseconds.
const AVOption * av_opt_find2(void *obj, const char *name, const char *unit, int opt_flags, int search_flags, void **target_obj)
Look for an option in an object.
offset must point to two consecutive integers
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
int version
LIBAVUTIL_VERSION with which this structure was created.
void av_opt_free(void *obj)
Free all string and binary options in obj.
int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags)
Get a list of allowed ranges for the given option.
#define DEFAULT_NUMVAL(opt)
int(* query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags)
Callback to return the supported/allowed ranges.
int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val)
#define AV_OPT_SEARCH_FAKE_OBJ
The obj passed to av_opt_find() is fake – only a double pointer to AVClass instead of a required poin...
static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
List of AVOptionRange structs.
void * av_opt_child_next(void *obj, void *prev)
Iterate over AVOptions-enabled children of obj.
attribute_deprecated int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out)
Set the field of obj with the given name to value.
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
int av_opt_get_key_value(const char **ropts, const char *key_val_sep, const char *pairs_sep, unsigned flags, char **rkey, char **rval)
Extract a key-value pair from the beginning of a string.
uint64_t ff_get_channel_layout(const char *name, int compat)
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
Check whether a particular flag is set in a flags field.
#define AV_DICT_IGNORE_SUFFIX
int main(int argc, char **argv)
common internal and external API header
int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags)
attribute_deprecated void av_opt_set_defaults2(void *s, int mask, int flags)
int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_flags)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
static int is_key_char(char c)
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_out, int *h_out)