Go to the documentation of this file.
24 #ifndef AVFILTER_TEXTUTILS_H
25 #define AVFILTER_TEXTUTILS_H
51 int (*
func)(
void *
ctx, AVBPrint *bp,
const char *function_name,
unsigned argc,
char **args);
121 const char *fmt,
const char *strftime_fmt);
138 int ff_print_time(
void *log_ctx, AVBPrint *bp,
const char *strftime_fmt,
char localtime);
140 typedef double (*ff_eval_func2)(
void *,
double a,
double b);
163 const char *
const *fun_names,
const ff_eval_func2 *fun_values,
164 const char *
const *
var_names,
const double *var_values,
198 const char *
const *fun_names,
const ff_eval_func2 *fun_values,
199 const char *
const *
var_names,
const double *var_values,
209 static inline int ff_is_newline(uint32_t
c)
211 return c ==
'\n' ||
c ==
'\r' ||
c ==
'\f' ||
c ==
'\v';
227 unsigned char **text,
size_t *text_size);
int ff_expand_text(FFExpandTextContext *expand_text, const char *text, AVBPrint *bp)
Expand text template.
unsigned int functions_nb
number of functions
const static uint16_t positions[][14][3]
void * log_ctx
log context to pass to the function, used for logging and for accessing the context for the function
Function used to expand a template sequence in the format %{FUNCTION_NAME[:PARAMS]},...
int ff_load_textfile(void *log_ctx, const char *textfile, unsigned char **text, size_t *text_size)
static const char *const var_names[]
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
const char * name
name of the function
const FFExpandTextFunction * functions
list of functions to use to expand sequences in the format FUNCTION_NAME{PARAMS}
int ff_print_formatted_eval_expr(void *log_ctx, AVBPrint *bp, const char *expr, const char *const *fun_names, const ff_eval_func2 *fun_values, const char *const *var_names, const double *var_values, void *eval_ctx, const char format, int positions)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
unsigned argc_min
minimum and maximum number of arguments accepted by the function in the PARAMS
int ff_print_eval_expr(void *log_ctx, AVBPrint *bp, const char *expr, const char *const *fun_names, const ff_eval_func2 *fun_values, const char *const *var_names, const double *var_values, void *eval_ctx)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
int(* func)(void *ctx, AVBPrint *bp, const char *function_name, unsigned argc, char **args)
actual function used to perform the expansion
int ff_print_pts(void *log_ctx, AVBPrint *bp, double pts, const char *delta, const char *fmt, const char *strftime_fmt)
in a text template, followed by any character, always expands to the second character.
int ff_print_time(void *log_ctx, AVBPrint *bp, const char *strftime_fmt, char localtime)