Mercurial > libavcodec.hg
diff avcodec.h @ 962:c5aef83c6a3f libavcodec
* first shot for generaly usable option parser for codecs
author | kabi |
---|---|
date | Mon, 06 Jan 2003 18:06:51 +0000 |
parents | 13aec7e50c52 |
children | e162c09efbe7 |
line wrap: on
line diff
--- a/avcodec.h Mon Jan 06 09:55:52 2003 +0000 +++ b/avcodec.h Mon Jan 06 18:06:51 2003 +0000 @@ -1109,6 +1109,41 @@ void avcodec_flush_buffers(AVCodecContext *avctx); +typedef struct { + /** options' name with default value*/ + const char* name; + /** English text help */ + const char* help; + /** type of variable */ + int type; +#define FF_CONF_TYPE_BOOL 1 // boolean - true,1,on (or simply presence) +#define FF_CONF_TYPE_DOUBLE 2 // double +#define FF_CONF_TYPE_INT 3 // integer +#define FF_CONF_TYPE_STRING 4 // string (finished with \0) +#define FF_CONF_TYPE_MASK 0x1f // mask for types - upper bits are various flags +#define FF_CONF_TYPE_EXPERT 0x20 // flag for expert option +#define FF_CONF_TYPE_FLAG (FF_CONF_TYPE_BOOL | 0x40) +#define FF_CONF_TYPE_RCOVERIDE (FF_CONF_TYPE_STRING | 0x80) + /** where the parsed value should be stored */ + void* val; + /** min value (min == max -> no limits) */ + double min; + /** maximum value for double/int */ + double max; + /** default boo [0,1]l/double/int value */ + double defval; + /** + * default string value (with optional semicolon delimited extra option-list + * i.e. option1;option2;option3 + * defval might select other then first argument as default + */ + const char* defstr; + /** char* list of supported codecs (i.e. ",msmpeg4,h263," NULL - everything */ + const char* supported; +} avc_config_t; + +void avcodec_getopt(AVCodecContext* avctx, char* str, avc_config_t** config); + /** * Interface for 0.5.0 version * @@ -1193,7 +1228,7 @@ #define av_freep(p) __av_freep((void **)(p)) /* for static data only */ /* call av_free_static to release all staticaly allocated tables */ -void av_free_static(); +void av_free_static(void); void *__av_mallocz_static(void** location, unsigned int size); #define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s)