Evaluating option strings

This group of functions can be used to evaluate option strings and get numbers out of them. More...

Modules

 Option setting functions
 Those functions set the field of obj with the given name to value.

Functions

int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out)
int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out)
int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out)
int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out)
int av_opt_eval_double (void *obj, const AVOption *o, const char *val, double *double_out)
int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out)

Detailed Description

This group of functions can be used to evaluate option strings and get numbers out of them.

They do the same thing as av_opt_set(), except the result is written into the caller-supplied pointer.

Parameters
obja struct whose first element is a pointer to AVClass.
oan option for which the string is to be evaluated.
valstring to be evaluated.
*_outvalue of the string will be written here.
Returns
0 on success, a negative number on failure.

< offset must point to a pointer immediately followed by an int for the length

AVOption

short English help text

Todo:
What about other languages?

The offset relative to the context structure where the option value is stored. It should be 0 for named constants.

the default value for scalar options

< minimum valid value for the option

< maximum valid value for the option

The logical unit to which the option belongs. Non-constant options and corresponding named constants share the same unit. May be NULL.

Show the obj options.

Parameters
req_flagsrequested flags for the options to show. Show only the options for which it is opt->flags & req_flags.
rej_flagsrejected flags for the options to show. Show only the options for which it is !(opt->flags & req_flags).
av_log_objlog context to use for showing the options

Set the values of all AVOption fields to their default values.

Parameters
san AVOption-enabled struct (its first member must be a pointer to AVClass)

Parse the key/value pairs list in opts. For each key/value pair found, stores the value in the field in ctx that is named like the key. ctx must be an AVClass context, storing is done using AVOptions.

Parameters
key_val_sepa 0-terminated list of characters used to separate key from value
pairs_sepa 0-terminated list of characters used to separate two pairs from each other
Returns
the number of successfully set key/value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_set_string3() if a key/value pair cannot be set

Free all string and binary options in obj.

Check whether a particular flag is set in a flags field.

Parameters
field_namethe name of the flag field option
flag_namethe name of the flag to check
Returns
non-zero if the flag is set, zero if the flag isn't set, isn't of the right type, or the flags field doesn't exist.

This group of functions can be used to evaluate option strings and get numbers out of them. They do the same thing as av_opt_set(), except the result is written into the caller-supplied pointer.

Parameters
obja struct whose first element is a pointer to AVClass.
oan option for which the string is to be evaluated.
valstring to be evaluated.
*_outvalue of the string will be written here.
Returns
0 on success, a negative number on failure.

< offset must point to a pointer immediately followed by an int for the length

AVOption

short English help text

Todo:
What about other languages?

The offset relative to the context structure where the option value is stored. It should be 0 for named constants.

the default value for scalar options

< minimum valid value for the option

< maximum valid value for the option

The logical unit to which the option belongs. Non-constant options and corresponding named constants share the same unit. May be NULL.

Show the obj options.

Parameters
req_flagsrequested flags for the options to show. Show only the options for which it is opt->flags & req_flags.
rej_flagsrejected flags for the options to show. Show only the options for which it is !(opt->flags & req_flags).
av_log_objlog context to use for showing the options

Set the values of all AVOption fields to their default values.

Parameters
san AVOption-enabled struct (its first member must be a pointer to AVClass)

Parse the key/value pairs list in opts. For each key/value pair found, stores the value in the field in ctx that is named like the key. ctx must be an AVClass context, storing is done using AVOptions.

Parameters
key_val_sepa 0-terminated list of characters used to separate key from value
pairs_sepa 0-terminated list of characters used to separate two pairs from each other
Returns
the number of successfully set key/value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_set_string3() if a key/value pair cannot be set

Free all string and binary options in obj.

Check whether a particular flag is set in a flags field.

Parameters
field_namethe name of the flag field option
flag_namethe name of the flag to check
Returns
non-zero if the flag is set, zero if the flag isn't set, isn't of the right type, or the flags field doesn't exist.

This group of functions can be used to evaluate option strings and get numbers out of them. They do the same thing as av_opt_set(), except the result is written into the caller-supplied pointer.

Parameters
obja struct whose first element is a pointer to AVClass.
oan option for which the string is to be evaluated.
valstring to be evaluated.
*_outvalue of the string will be written here.
Returns
0 on success, a negative number on failure.

Function Documentation

int av_opt_eval_double ( void obj,
const AVOption o,
const char *  val,
double *  double_out 
)
int av_opt_eval_flags ( void obj,
const AVOption o,
const char *  val,
int *  flags_out 
)

Referenced by av_parse_cpu_flags(), and init().

int av_opt_eval_float ( void obj,
const AVOption o,
const char *  val,
float *  float_out 
)
int av_opt_eval_int ( void obj,
const AVOption o,
const char *  val,
int *  int_out 
)
int av_opt_eval_int64 ( void obj,
const AVOption o,
const char *  val,
int64_t *  int64_out 
)
int av_opt_eval_q ( void obj,
const AVOption o,
const char *  val,
AVRational q_out 
)