FFmpeg  1.2.12
Modules | Functions
Option setting functions
AVOptions | Evaluating option strings

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

Modules

 Option getting functions
 Those functions get a value of the option with the given name from an object.

Functions

int av_opt_set (void *obj, const char *name, const char *val, int search_flags)
int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags)
int av_opt_set_double (void *obj, const char *name, double val, int search_flags)
int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags)
int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags)
int av_opt_set_image_size (void *obj, const char *name, int w, int h, int search_flags)
int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags)
int av_opt_set_sample_fmt (void *obj, const char *name, enum AVSampleFormat fmt, int search_flags)

Detailed Description

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

Parameters
[in]objA struct whose first element is a pointer to an AVClass.
[in]namethe name of the field to set
[in]valThe value to set. In case of av_opt_set() if the field is not of a string type, then the given string is parsed. SI postfixes and some named scalars are supported. If the field is of a numeric type, it has to be a numeric or named scalar. Behavior with more than one scalar and +- infix operators is undefined. If the field is of a flags type, it has to be a sequence of numeric scalars or named flags separated by '+' or '-'. Prefixing a flag with '+' causes it to be set without affecting the other flags; similarly, '-' unsets a flag.
search_flagsflags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be set on a child of obj.
Returns
0 if the value has been set, or an AVERROR code in case of error: AVERROR_OPTION_NOT_FOUND if no matching option exists AVERROR(ERANGE) if the value is out of range AVERROR(EINVAL) if the value is not valid

The obj passed to av_opt_find() is fake – only a double pointer to AVClass instead of a required pointer to a struct containing AVClass. This is useful for searching for options without needing to allocate the corresponding object.

Look for an option in an object. Consider only options which have all the specified flags set.

Parameters
[in]objA pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set.
[in]nameThe name of the option to look for.
[in]unitWhen searching for named constants, name of the unit it belongs to.
opt_flagsFind only options with all the specified flags set (AV_OPT_FLAG).
search_flagsA combination of AV_OPT_SEARCH_*.
Returns
A pointer to the option found, or NULL if no option was found.
Note
Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable directly with av_set_string3(). Use special calls which take an options AVDictionary (e.g. avformat_open_input()) to set options found with this flag.

Look for an option in an object. Consider only options which have all the specified flags set.

Parameters
[in]objA pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set.
[in]nameThe name of the option to look for.
[in]unitWhen searching for named constants, name of the unit it belongs to.
opt_flagsFind only options with all the specified flags set (AV_OPT_FLAG).
search_flagsA combination of AV_OPT_SEARCH_*.
[out]target_objif non-NULL, an object to which the option belongs will be written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present in search_flags. This parameter is ignored if search_flags contain AV_OPT_SEARCH_FAKE_OBJ.
Returns
A pointer to the option found, or NULL if no option was found.

Iterate over all AVOptions belonging to obj.

Parameters
objan AVOptions-enabled struct or a double pointer to an AVClass describing it.
prevresult of the previous call to av_opt_next() on this object or NULL
Returns
next AVOption or NULL

Iterate over AVOptions-enabled children of obj.

Parameters
prevresult of a previous call to this function or NULL
Returns
next AVOptions-enabled child or NULL

Iterate over potential AVOptions-enabled children of parent.

Parameters
prevresult of a previous call to this function or NULL
Returns
AVClass corresponding to next potential child or NULL

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

Parameters
[in]objA struct whose first element is a pointer to an AVClass.
[in]namethe name of the field to set
[in]valThe value to set. In case of av_opt_set() if the field is not of a string type, then the given string is parsed. SI postfixes and some named scalars are supported. If the field is of a numeric type, it has to be a numeric or named scalar. Behavior with more than one scalar and +- infix operators is undefined. If the field is of a flags type, it has to be a sequence of numeric scalars or named flags separated by '+' or '-'. Prefixing a flag with '+' causes it to be set without affecting the other flags; similarly, '-' unsets a flag.
search_flagsflags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be set on a child of obj.
Returns
0 if the value has been set, or an AVERROR code in case of error: AVERROR_OPTION_NOT_FOUND if no matching option exists AVERROR(ERANGE) if the value is out of range AVERROR(EINVAL) if the value is not valid

The obj passed to av_opt_find() is fake – only a double pointer to AVClass instead of a required pointer to a struct containing AVClass. This is useful for searching for options without needing to allocate the corresponding object.

Look for an option in an object. Consider only options which have all the specified flags set.

Parameters
[in]objA pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set.
[in]nameThe name of the option to look for.
[in]unitWhen searching for named constants, name of the unit it belongs to.
opt_flagsFind only options with all the specified flags set (AV_OPT_FLAG).
search_flagsA combination of AV_OPT_SEARCH_*.
Returns
A pointer to the option found, or NULL if no option was found.
Note
Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable directly with av_set_string3(). Use special calls which take an options AVDictionary (e.g. avformat_open_input()) to set options found with this flag.

Look for an option in an object. Consider only options which have all the specified flags set.

Parameters
[in]objA pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set.
[in]nameThe name of the option to look for.
[in]unitWhen searching for named constants, name of the unit it belongs to.
opt_flagsFind only options with all the specified flags set (AV_OPT_FLAG).
search_flagsA combination of AV_OPT_SEARCH_*.
[out]target_objif non-NULL, an object to which the option belongs will be written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present in search_flags. This parameter is ignored if search_flags contain AV_OPT_SEARCH_FAKE_OBJ.
Returns
A pointer to the option found, or NULL if no option was found.

Iterate over all AVOptions belonging to obj.

Parameters
objan AVOptions-enabled struct or a double pointer to an AVClass describing it.
prevresult of the previous call to av_opt_next() on this object or NULL
Returns
next AVOption or NULL

Iterate over AVOptions-enabled children of obj.

Parameters
prevresult of a previous call to this function or NULL
Returns
next AVOptions-enabled child or NULL

Iterate over potential AVOptions-enabled children of parent.

Parameters
prevresult of a previous call to this function or NULL
Returns
AVClass corresponding to next potential child or NULL

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

Parameters
[in]objA struct whose first element is a pointer to an AVClass.
[in]namethe name of the field to set
[in]valThe value to set. In case of av_opt_set() if the field is not of a string type, then the given string is parsed. SI postfixes and some named scalars are supported. If the field is of a numeric type, it has to be a numeric or named scalar. Behavior with more than one scalar and +- infix operators is undefined. If the field is of a flags type, it has to be a sequence of numeric scalars or named flags separated by '+' or '-'. Prefixing a flag with '+' causes it to be set without affecting the other flags; similarly, '-' unsets a flag.
search_flagsflags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be set on a child of obj.
Returns
0 if the value has been set, or an AVERROR code in case of error: AVERROR_OPTION_NOT_FOUND if no matching option exists AVERROR(ERANGE) if the value is out of range AVERROR(EINVAL) if the value is not valid

Function Documentation

int av_opt_set ( void obj,
const char *  name,
const char *  val,
int  search_flags 
)
int av_opt_set_bin ( void obj,
const char *  name,
const uint8_t val,
int  size,
int  search_flags 
)

Definition at line 390 of file opt.c.

Referenced by rtmp_calc_swfhash(), rtmp_http_open(), and rtmp_http_send_cmd().

int av_opt_set_double ( void obj,
const char *  name,
double  val,
int  search_flags 
)

Definition at line 380 of file opt.c.

Referenced by av_opt_set_defaults2().

int av_opt_set_image_size ( void obj,
const char *  name,
int  w,
int  h,
int  search_flags 
)

Definition at line 419 of file opt.c.

int av_opt_set_int ( void obj,
const char *  name,
int64_t  val,
int  search_flags 
)
int av_opt_set_pixel_fmt ( void obj,
const char *  name,
enum AVPixelFormat  fmt,
int  search_flags 
)

Definition at line 478 of file opt.c.

Referenced by av_opt_set_defaults2().

int av_opt_set_q ( void obj,
const char *  name,
AVRational  val,
int  search_flags 
)

Definition at line 385 of file opt.c.

Referenced by av_opt_set_defaults2().

int av_opt_set_sample_fmt ( void obj,
const char *  name,
enum AVSampleFormat  fmt,
int  search_flags 
)
Examples:
doc/examples/resampling_audio.c.

Definition at line 483 of file opt.c.

Referenced by av_opt_set_defaults2(), and main().