Mercurial > libavcodec.hg
comparison opt.c @ 11832:e522dbf60abd libavcodec
Move eval.c and eval.h from libavcodec to libavutil, and make the eval
API public.
author | stefano |
---|---|
date | Sat, 05 Jun 2010 12:01:28 +0000 |
parents | 026edf66e3a9 |
children | 7220936dc29c |
comparison
equal
deleted
inserted
replaced
11831:9b1da3f82dd7 | 11832:e522dbf60abd |
---|---|
25 * @author Michael Niedermayer <michaelni@gmx.at> | 25 * @author Michael Niedermayer <michaelni@gmx.at> |
26 */ | 26 */ |
27 | 27 |
28 #include "avcodec.h" | 28 #include "avcodec.h" |
29 #include "opt.h" | 29 #include "opt.h" |
30 #include "eval.h" | 30 #include "libavutil/eval.h" |
31 | 31 |
32 //FIXME order them and do a bin search | 32 //FIXME order them and do a bin search |
33 const AVOption *av_find_opt(void *v, const char *name, const char *unit, int mask, int flags){ | 33 const AVOption *av_find_opt(void *v, const char *name, const char *unit, int mask, int flags){ |
34 AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass | 34 AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass |
35 const AVOption *o= c->option; | 35 const AVOption *o= c->option; |
163 else if(!strcmp(buf, "max" )) d= o->max; | 163 else if(!strcmp(buf, "max" )) d= o->max; |
164 else if(!strcmp(buf, "min" )) d= o->min; | 164 else if(!strcmp(buf, "min" )) d= o->min; |
165 else if(!strcmp(buf, "none" )) d= 0; | 165 else if(!strcmp(buf, "none" )) d= 0; |
166 else if(!strcmp(buf, "all" )) d= ~0; | 166 else if(!strcmp(buf, "all" )) d= ~0; |
167 else { | 167 else { |
168 int res = ff_parse_and_eval_expr(&d, buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, obj); | 168 int res = av_parse_and_eval_expr(&d, buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, obj); |
169 if (res < 0) { | 169 if (res < 0) { |
170 av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val); | 170 av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val); |
171 return res; | 171 return res; |
172 } | 172 } |
173 } | 173 } |