MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_parse_expr

Function ff_parse_expr

libavcodec/eval.c:372–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372AVExpr *ff_parse_expr(const char *s, const char * const *const_name,
373 double (* const *func1)(void *, double), const char * const *func1_name,
374 double (* const *func2)(void *, double, double), const char * const *func2_name,
375 const char **error){
376 Parser p;
377 AVExpr *e = NULL;
378 char *w = av_malloc(strlen(s) + 1);
379 char *wp = w;
380
381 if (!w)
382 goto end;
383
384 while (*s)
385 if (!isspace(*s++)) *wp++ = s[-1];
386 *wp++ = 0;
387
388 p.stack_index=100;
389 p.s= w;
390 p.const_name = const_name;
391 p.func1 = func1;
392 p.func1_name = func1_name;
393 p.func2 = func2;
394 p.func2_name = func2_name;
395 p.error= error;
396
397 e = parse_expr(&p);
398 if (!verify_expr(e)) {
399 ff_free_expr(e);
400 e = NULL;
401 }
402end:
403 av_free(w);
404 return e;
405}
406
407double ff_eval_expr(AVExpr * e, const double *const_value, void *opaque) {
408 Parser p;

Callers 2

ff_parse_and_eval_exprFunction · 0.85
ff_rate_control_initFunction · 0.85

Calls 5

av_mallocFunction · 0.85
parse_exprFunction · 0.85
verify_exprFunction · 0.85
ff_free_exprFunction · 0.85
av_freeFunction · 0.85

Tested by

no test coverage detected