FFmpeg
Functions
Option getting functions

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

Functions

int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val)
 
int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val)
 
int av_opt_get_double (void *obj, const char *name, int search_flags, double *out_val)
 
int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val)
 
int av_opt_get_image_size (void *obj, const char *name, int search_flags, int *w_out, int *h_out)
 
int av_opt_get_pixel_fmt (void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt)
 
int av_opt_get_sample_fmt (void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt)
 
int av_opt_get_video_rate (void *obj, const char *name, int search_flags, AVRational *out_val)
 
int av_opt_get_chlayout (void *obj, const char *name, int search_flags, AVChannelLayout *layout)
 
int av_opt_get_dict_val (void *obj, const char *name, int search_flags, AVDictionary **out_val)
 
int av_opt_get_array_size (void *obj, const char *name, int search_flags, unsigned int *out_val)
 For an array-type option, get the number of elements in the array. More...
 
int av_opt_get_array (void *obj, const char *name, int search_flags, unsigned int start_elem, unsigned int nb_elems, enum AVOptionType out_type, void *out_val)
 For an array-type option, retrieve the values of one or more array elements. More...
 

Detailed Description

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

Parameters
[in]obja struct whose first element is a pointer to an AVClass.
[in]namename of the option to get.
[in]search_flagsflags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be found in a child of obj.
[out]out_valvalue of the option will be written here
Returns
>=0 on success, a negative error code otherwise

Function Documentation

◆ av_opt_get()

int av_opt_get ( void *  obj,
const char *  name,
int  search_flags,
uint8_t **  out_val 
)
Note
the returned string will be av_malloc()ed and must be av_free()ed by the caller
if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option is of type AV_OPT_TYPE_STRING, AV_OPT_TYPE_BINARY or AV_OPT_TYPE_DICT and is set to NULL, *out_val will be set to NULL instead of an allocated empty string.

Definition at line 1207 of file opt.c.

Referenced by av_probe_input_buffer2(), config_props(), ff_rtp_chain_mux_open(), ffio_copy_url_options(), main(), mpjpeg_get_boundary(), open_url(), opt_serialize(), ost_bind_filter(), parse_manifest(), parse_playlist(), pcm_read_header(), print_private_data(), process_client(), and read_data().

◆ av_opt_get_int()

int av_opt_get_int ( void *  obj,
const char *  name,
int  search_flags,
int64_t out_val 
)

◆ av_opt_get_double()

int av_opt_get_double ( void *  obj,
const char *  name,
int  search_flags,
double out_val 
)

Definition at line 1280 of file opt.c.

◆ av_opt_get_q()

int av_opt_get_q ( void *  obj,
const char *  name,
int  search_flags,
AVRational out_val 
)

Definition at line 1292 of file opt.c.

Referenced by av_opt_get_video_rate().

◆ av_opt_get_image_size()

int av_opt_get_image_size ( void *  obj,
const char *  name,
int  search_flags,
int *  w_out,
int *  h_out 
)

Definition at line 1308 of file opt.c.

◆ av_opt_get_pixel_fmt()

int av_opt_get_pixel_fmt ( void *  obj,
const char *  name,
int  search_flags,
enum AVPixelFormat out_fmt 
)

Definition at line 1349 of file opt.c.

◆ av_opt_get_sample_fmt()

int av_opt_get_sample_fmt ( void *  obj,
const char *  name,
int  search_flags,
enum AVSampleFormat out_fmt 
)

Definition at line 1354 of file opt.c.

Referenced by config_output(), and query_formats().

◆ av_opt_get_video_rate()

int av_opt_get_video_rate ( void *  obj,
const char *  name,
int  search_flags,
AVRational out_val 
)

Definition at line 1326 of file opt.c.

◆ av_opt_get_chlayout()

int av_opt_get_chlayout ( void *  obj,
const char *  name,
int  search_flags,
AVChannelLayout layout 
)
Parameters
[out]layoutThe returned layout is a copy of the actual value and must be freed with av_channel_layout_uninit() by the caller

Definition at line 1359 of file opt.c.

Referenced by config_output(), and query_formats().

◆ av_opt_get_dict_val()

int av_opt_get_dict_val ( void *  obj,
const char *  name,
int  search_flags,
AVDictionary **  out_val 
)
Parameters
[out]out_valThe returned dictionary is a copy of the actual value and must be freed with av_dict_free() by the caller

Definition at line 1375 of file opt.c.

Referenced by read_frame_internal().

◆ av_opt_get_array_size()

int av_opt_get_array_size ( void *  obj,
const char *  name,
int  search_flags,
unsigned int *  out_val 
)

For an array-type option, get the number of elements in the array.

Definition at line 2169 of file opt.c.

Referenced by multiview_setup().

◆ av_opt_get_array()

int av_opt_get_array ( void *  obj,
const char *  name,
int  search_flags,
unsigned int  start_elem,
unsigned int  nb_elems,
enum AVOptionType  out_type,
void *  out_val 
)

For an array-type option, retrieve the values of one or more array elements.

Parameters
start_elemindex of the first array element to retrieve
nb_elemsnumber of array elements to retrieve; start_elem+nb_elems must not be larger than array size as returned by av_opt_get_array_size()
out_typeOption type corresponding to the desired output.
            The array elements produced by this function will
            will be as if av_opt_getX() was called for each element,
            where X is specified by out_type. E.g. AV_OPT_TYPE_STRING
            corresponds to av_opt_get().

            Typically this should be the same as the scalarized type of
            the AVOption being retrieved, but certain conversions are
            also possible - the same as those done by the corresponding
            av_opt_get*() function. E.g. any option type can be retrieved
            as a string, numeric types can be retrieved as int64, double,
            or rational, etc.
out_valArray with nb_elems members into which the output will be written. The array type must match the underlying C type as documented for out_type, and be zeroed on entry to this function.

For dynamically allocated types (strings, binary, dicts, etc.), the result is owned and freed by the caller.

Definition at line 2187 of file opt.c.

Referenced by main(), and multiview_setup().