Mercurial > libavcodec.hg
comparison avcodec.h @ 1058:3c3da6edc9a1 libavcodec
* still unfinished code for Options
author | kabi |
---|---|
date | Mon, 10 Feb 2003 09:38:38 +0000 |
parents | 6261fdd1f69d |
children | b32afefe7d33 |
comparison
equal
deleted
inserted
replaced
1057:bb5de8a59da8 | 1058:3c3da6edc9a1 |
---|---|
948 * decoding: set by user, if not set then the native format will always be choosen | 948 * decoding: set by user, if not set then the native format will always be choosen |
949 */ | 949 */ |
950 enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt); | 950 enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt); |
951 } AVCodecContext; | 951 } AVCodecContext; |
952 | 952 |
953 //void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config); | |
954 | |
955 typedef struct AVOption { | |
956 /** options' name */ | |
957 const char *name; /* if name is NULL, it indicates a link to next */ | |
958 /** short English text help */ | |
959 const char *help; | |
960 /** offset to context structure where the parsed value should be stored */ | |
961 int offset; | |
962 /** options' type */ | |
963 int type; | |
964 #define FF_OPT_TYPE_BOOL 1 // boolean - true,1,on (or simply presence) | |
965 #define FF_OPT_TYPE_DOUBLE 2 // double | |
966 #define FF_OPT_TYPE_INT 3 // integer | |
967 #define FF_OPT_TYPE_STRING 4 // string (finished with \0) | |
968 #define FF_OPT_TYPE_MASK 0x1f // mask for types - upper bits are various flags | |
969 //#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option | |
970 #define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40) | |
971 #define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80) | |
972 /** min value (min == max -> no limits) */ | |
973 double min; | |
974 /** maximum value for double/int */ | |
975 double max; | |
976 /** default boo [0,1]l/double/int value */ | |
977 double defval; | |
978 /** | |
979 * default string value (with optional semicolon delimited extra option-list | |
980 * i.e. option1;option2;option3 | |
981 * defval might select other then first argument as default | |
982 */ | |
983 const char *defstr; | |
984 const struct AVOption *sub; /* used when name is NULL */ | |
985 /* when it's NULL return to previous level (or finish reading) */ | |
986 #define FF_OPT_MAX_DEPTH 10 | |
987 } AVOption; | |
988 | |
953 typedef struct AVCodec { | 989 typedef struct AVCodec { |
954 const char *name; | 990 const char *name; |
955 int type; | 991 int type; |
956 int id; | 992 int id; |
957 int priv_data_size; | 993 int priv_data_size; |
959 int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data); | 995 int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data); |
960 int (*close)(AVCodecContext *); | 996 int (*close)(AVCodecContext *); |
961 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, | 997 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, |
962 UINT8 *buf, int buf_size); | 998 UINT8 *buf, int buf_size); |
963 int capabilities; | 999 int capabilities; |
1000 const AVOption *options; | |
964 struct AVCodec *next; | 1001 struct AVCodec *next; |
965 } AVCodec; | 1002 } AVCodec; |
966 | 1003 |
967 /** | 1004 /** |
968 * four components are given, that's all. | 1005 * four components are given, that's all. |
969 * the last component is alpha | 1006 * the last component is alpha |
970 */ | 1007 */ |
971 typedef struct AVPicture { | 1008 typedef struct AVPicture { |
972 UINT8 *data[4]; | 1009 UINT8 *data[4]; |
1133 | 1170 |
1134 void avcodec_register_all(void); | 1171 void avcodec_register_all(void); |
1135 | 1172 |
1136 void avcodec_flush_buffers(AVCodecContext *avctx); | 1173 void avcodec_flush_buffers(AVCodecContext *avctx); |
1137 | 1174 |
1138 typedef struct { | 1175 |
1139 /** options' name with default value*/ | |
1140 const char* name; | |
1141 /** English text help */ | |
1142 const char* help; | |
1143 /** type of variable */ | |
1144 int type; | |
1145 #define FF_CONF_TYPE_BOOL 1 // boolean - true,1,on (or simply presence) | |
1146 #define FF_CONF_TYPE_DOUBLE 2 // double | |
1147 #define FF_CONF_TYPE_INT 3 // integer | |
1148 #define FF_CONF_TYPE_STRING 4 // string (finished with \0) | |
1149 #define FF_CONF_TYPE_MASK 0x1f // mask for types - upper bits are various flags | |
1150 #define FF_CONF_TYPE_EXPERT 0x20 // flag for expert option | |
1151 #define FF_CONF_TYPE_FLAG (FF_CONF_TYPE_BOOL | 0x40) | |
1152 #define FF_CONF_TYPE_RCOVERIDE (FF_CONF_TYPE_STRING | 0x80) | |
1153 /** where the parsed value should be stored */ | |
1154 void* val; | |
1155 /** min value (min == max -> no limits) */ | |
1156 double min; | |
1157 /** maximum value for double/int */ | |
1158 double max; | |
1159 /** default boo [0,1]l/double/int value */ | |
1160 double defval; | |
1161 /** | |
1162 * default string value (with optional semicolon delimited extra option-list | |
1163 * i.e. option1;option2;option3 | |
1164 * defval might select other then first argument as default | |
1165 */ | |
1166 const char* defstr; | |
1167 /** char* list of supported codecs (i.e. ",msmpeg4,h263," NULL - everything */ | |
1168 const char* supported; | |
1169 } avc_config_t; | |
1170 | |
1171 void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config); | |
1172 | 1176 |
1173 /** | 1177 /** |
1174 * Interface for 0.5.0 version | 1178 * Interface for 0.5.0 version |
1175 * | 1179 * |
1176 * do not even think about it's usage for this moment | 1180 * do not even think about it's usage for this moment |
1252 void *av_realloc(void *ptr, unsigned int size); | 1256 void *av_realloc(void *ptr, unsigned int size); |
1253 void av_free(void *ptr); | 1257 void av_free(void *ptr); |
1254 char *av_strdup(const char *s); | 1258 char *av_strdup(const char *s); |
1255 void __av_freep(void **ptr); | 1259 void __av_freep(void **ptr); |
1256 #define av_freep(p) __av_freep((void **)(p)) | 1260 #define av_freep(p) __av_freep((void **)(p)) |
1257 void *av_fast_realloc(void *ptr, int *size, int min_size); | 1261 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size); |
1258 /* for static data only */ | 1262 /* for static data only */ |
1259 /* call av_free_static to release all staticaly allocated tables */ | 1263 /* call av_free_static to release all staticaly allocated tables */ |
1260 void av_free_static(void); | 1264 void av_free_static(void); |
1261 void *__av_mallocz_static(void** location, unsigned int size); | 1265 void *__av_mallocz_static(void** location, unsigned int size); |
1262 #define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s) | 1266 #define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s) |