Hi. Sorry, been busy.

Len Woodward via ffmpeg-devel (HE12026-01-14):
>   Thanks for the feedback. To clarify my understanding:
> 
>   1. Define AVExprVar in libavutil/eval.h so non-filter code can use it
>   2. Add accessor functions instead of direct struct iteration
>   3. Add the field to AVFilter (or AVFilterContext)

Yes, my recommendation would be something like that.

>   On point 3 — is your thinking that AVFilterContext would allow variables
> to depend on runtime state (e.g., configured input dimensions)? For most
> filters the variables are static, but I can see cases where that matters.

If it goes through an accessor, then it does not matter where the fields
are. We could even have the field in both AVFilter and AVFilterContext
and have the accessor merge the two lists.

> 
>   On the accessor approach, something like:
> 
>   // libavutil/eval.h
>   typedef struct AVExprVar {
>       const char *name;
>       const char *help;
>   } AVExprVar;
> 
>   // libavfilter/avfilter.h
>   int avfilter_get_nb_expr_vars(const AVFilter *f);
>   const AVExprVar *avfilter_get_expr_var(const AVFilter *f, int index);
> 
>   Or if we go with AVFilterContext:
> 
>   int avfilter_ctx_get_nb_expr_vars(const AVFilterContext *ctx);
>   const AVExprVar *avfilter_ctx_get_expr_var(const AVFilterContext *ctx,
> int index);
> 
>   Which do you think fits better? I'm leaning toward AVFilter since the
> variables are compile-time constants for all the filters I've looked at.

I would suggest AVFilterContext, because ctx->filter gives you the
corresponding AVFilter whereas the opposite is not possible.

You will need to be careful when generic functions in libavutil get
AVExprVar pointers that may come from libavfilter: they could be too
small. The best way to do that would probably to lock all libraries
versions together, as we discussed multiple times, but nobody
implemented it yet.

Regards,

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to