libavutil/opt.h File Reference

AVOptions. More...

#include "rational.h"
#include "avutil.h"
#include "dict.h"

Go to the source code of this file.

Data Structures

struct  AVOption
 AVOption. More...

Defines

#define AV_OPT_FLAG_ENCODING_PARAM   1
 a generic parameter which can be set by the user for muxing or encoding
#define AV_OPT_FLAG_DECODING_PARAM   2
 a generic parameter which can be set by the user for demuxing or decoding
#define AV_OPT_FLAG_METADATA   4
 some data extracted or inserted into the file like title, comment, ...
#define AV_OPT_FLAG_AUDIO_PARAM   8
#define AV_OPT_FLAG_VIDEO_PARAM   16
#define AV_OPT_FLAG_SUBTITLE_PARAM   32
#define AV_OPT_SEARCH_CHILDREN   0x0001
 Search in possible children of the given object first.

Enumerations

enum  AVOptionType {
  FF_OPT_TYPE_FLAGS, FF_OPT_TYPE_INT, FF_OPT_TYPE_INT64, FF_OPT_TYPE_DOUBLE,
  FF_OPT_TYPE_FLOAT, FF_OPT_TYPE_STRING, FF_OPT_TYPE_RATIONAL, FF_OPT_TYPE_BINARY,
  FF_OPT_TYPE_CONST = 128
}

Functions

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.
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.
const AVOptionav_set_double (void *obj, const char *name, double n)
const AVOptionav_set_q (void *obj, const char *name, AVRational n)
const AVOptionav_set_int (void *obj, const char *name, int64_t n)
double av_get_double (void *obj, const char *name, const AVOption **o_out)
AVRational av_get_q (void *obj, const char *name, const AVOption **o_out)
int64_t av_get_int (void *obj, const char *name, const AVOption **o_out)
const char * av_get_string (void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len)
const AVOptionav_next_option (void *obj, const AVOption *last)
int av_opt_show2 (void *obj, void *av_log_obj, int req_flags, int rej_flags)
 Show the obj options.
void av_opt_set_defaults (void *s)
void av_opt_set_defaults2 (void *s, int mask, int flags)
 Set the values of the AVCodecContext or AVFormatContext structure.
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.
void av_opt_free (void *obj)
 Free all string and binary options in obj.
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.
int av_opt_set_dict (void *obj, struct AVDictionary **options)
const AVOptionav_opt_find (void *obj, const char *name, const char *unit, int opt_flags, int search_flags)
 Look for an option in an object.


Detailed Description

AVOptions.

Definition in file opt.h.


Define Documentation

#define AV_OPT_FLAG_AUDIO_PARAM   8

#define AV_OPT_FLAG_DECODING_PARAM   2

a generic parameter which can be set by the user for demuxing or decoding

Definition at line 80 of file opt.h.

Referenced by av_opt_show(), opt_help(), opt_input_file(), and opt_list().

#define AV_OPT_FLAG_ENCODING_PARAM   1

a generic parameter which can be set by the user for muxing or encoding

Definition at line 79 of file opt.h.

Referenced by av_opt_show(), new_audio_stream(), new_subtitle_stream(), new_video_stream(), opt_help(), opt_list(), opt_output_file(), and parse_ffconfig().

#define AV_OPT_FLAG_METADATA   4

some data extracted or inserted into the file like title, comment, ...

Definition at line 81 of file opt.h.

#define AV_OPT_FLAG_SUBTITLE_PARAM   32

#define AV_OPT_FLAG_VIDEO_PARAM   16

#define AV_OPT_SEARCH_CHILDREN   0x0001

Search in possible children of the given object first.

Definition at line 217 of file opt.h.

Referenced by av_opt_find(), and opt_default2().


Enumeration Type Documentation

Enumerator:
FF_OPT_TYPE_FLAGS 
FF_OPT_TYPE_INT 
FF_OPT_TYPE_INT64 
FF_OPT_TYPE_DOUBLE 
FF_OPT_TYPE_FLOAT 
FF_OPT_TYPE_STRING 
FF_OPT_TYPE_RATIONAL 
FF_OPT_TYPE_BINARY  offset must point to a pointer immediately followed by an int for the length
FF_OPT_TYPE_CONST 

Definition at line 34 of file opt.h.


Function Documentation

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.

Look only for the options which have the flags set as specified in mask and flags (that is, for which it is the case that opt->flags & mask == flags).

Parameters:
[in] obj a pointer to a struct whose first element is a pointer to an AVClass
[in] name the name of the option to look for
[in] unit the unit of the option to look for, or any if NULL
Returns:
a pointer to the option found, or NULL if no option has been found
Deprecated:
use av_opt_find.

Definition at line 36 of file opt.c.

Referenced by av_opt_flag_is_set(), ff_rtp_chain_mux_open(), opt_default(), and set_context_opts().

double av_get_double ( void *  obj,
const char *  name,
const AVOption **  o_out 
)

Definition at line 290 of file opt.c.

Referenced by av_set_string3().

int64_t av_get_int ( void *  obj,
const char *  name,
const AVOption **  o_out 
)

AVRational av_get_q ( void *  obj,
const char *  name,
const AVOption **  o_out 
)

Definition at line 301 of file opt.c.

const char* av_get_string ( void *  obj,
const char *  name,
const AVOption **  o_out,
char *  buf,
int  buf_len 
)

Parameters:
buf a buffer which is used for returning non string values as strings, can be NULL
buf_len allocated length in bytes of buf

Definition at line 230 of file opt.c.

Referenced by set_context_opts().

const AVOption* av_next_option ( void *  obj,
const AVOption last 
)

Definition at line 48 of file opt.c.

Referenced by av_find_opt(), av_opt_find(), av_opt_free(), av_opt_set_defaults2(), and opt_list().

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.

Consider only options which have all the specified flags set.

Parameters:
[in] obj A pointer to a struct whose first element is a pointer to an AVClass.
[in] name The name of the option to look for.
[in] unit When searching for named constants, name of the unit it belongs to.
opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
search_flags A 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.

Definition at line 567 of file opt.c.

Referenced by av_get_number(), av_get_string(), av_set_number2(), av_set_string3(), ffserver_opt_default(), opt_default(), opt_default2(), and opt_find().

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.

Parameters:
field_name the name of the flag field option
flag_name the 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.

Definition at line 326 of file opt.c.

void av_opt_free ( void *  obj  ) 

Free all string and binary options in obj.

Definition at line 538 of file opt.c.

Referenced by av_write_trailer(), avcodec_close(), and avformat_free_context().

void av_opt_set_defaults ( void *  s  ) 

void av_opt_set_defaults2 ( void *  s,
int  mask,
int  flags 
)

Set the values of the AVCodecContext or AVFormatContext structure.

They are set to the defaults specified in the according AVOption options array default_val field.

Parameters:
s AVCodecContext or AVFormatContext for which the defaults will be set

Definition at line 423 of file opt.c.

Referenced by av_opt_set_defaults(), avcodec_get_context_defaults2(), and init().

int av_opt_set_dict ( void *  obj,
struct AVDictionary **  options 
)

Definition at line 546 of file opt.c.

Referenced by avcodec_open2(), avformat_open_input(), and avformat_write_header().

int av_opt_show2 ( void *  obj,
void *  av_log_obj,
int  req_flags,
int  rej_flags 
)

Show the obj options.

Parameters:
req_flags requested flags for the options to show. Show only the options for which it is opt->flags & req_flags.
rej_flags rejected flags for the options to show. Show only the options for which it is !(opt->flags & req_flags).
av_log_obj log context to use for showing the options

Definition at line 405 of file opt.c.

Referenced by av_opt_show(), and opt_help().

const AVOption* av_set_double ( void *  obj,
const char *  name,
double  n 
)

Definition at line 210 of file opt.c.

Referenced by av_opt_set_defaults2().

const AVOption* av_set_int ( void *  obj,
const char *  name,
int64_t  n 
)

Definition at line 220 of file opt.c.

Referenced by av_opt_set_defaults2(), and ff_rtp_chain_mux_open().

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.

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:
opts options string to parse, may be NULL
key_val_sep a 0-terminated list of characters used to separate key from value
pairs_sep a 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

Definition at line 519 of file opt.c.

Referenced by init().

const AVOption* av_set_q ( void *  obj,
const char *  name,
AVRational  n 
)

Definition at line 215 of file opt.c.

Referenced by av_opt_set_defaults2().

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.

Parameters:
[in] obj A struct whose first element is a pointer to an AVClass.
[in] name the name of the field to set
[in] val The value to 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.
[out] o_out if non-NULL put here a pointer to the AVOption found
alloc when 1 then the old value will be av_freed() and the new av_strduped() when 0 then no av_free() nor av_strdup() will be used
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

Definition at line 117 of file opt.c.

Referenced by av_opt_set_defaults2(), av_opt_set_dict(), av_set_string(), av_set_string2(), ffserver_opt_default(), open_input(), opt_default(), opt_default2(), parse_key_value_pair(), and set_context_opts().


Generated on Fri Oct 26 02:38:17 2012 for FFmpeg by  doxygen 1.5.8