FFmpeg
Functions
textutils.c File Reference
#include <fenv.h>
#include <math.h>
#include <string.h>
#include "textutils.h"
#include "libavutil/avutil.h"
#include "libavutil/error.h"
#include "libavutil/file.h"
#include "libavutil/mem.h"
#include "libavutil/time.h"

Go to the source code of this file.

Functions

static int ff_expand_text_function_internal (FFExpandTextContext *expand_text, AVBPrint *bp, char *name, unsigned argc, char **argv)
 
static int ff_expand_text_function (FFExpandTextContext *expand_text, AVBPrint *bp, const char **rtext)
 Expand text template pointed to by *rtext. More...
 
int ff_expand_text (FFExpandTextContext *expand_text, const char *text, AVBPrint *bp)
 Expand text template. More...
 
int ff_print_pts (void *log_ctx, AVBPrint *bp, double pts, const char *delta, const char *fmt, const char *strftime_fmt)
 
int ff_print_time (void *log_ctx, AVBPrint *bp, const char *strftime_fmt, char localtime)
 
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)
 
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)
 
int ff_load_textfile (void *log_ctx, const char *textfile, unsigned char **text, size_t *text_size)
 

Detailed Description

text expansion utilities

Definition in file textutils.c.

Function Documentation

◆ ff_expand_text_function_internal()

static int ff_expand_text_function_internal ( FFExpandTextContext expand_text,
AVBPrint *  bp,
char *  name,
unsigned  argc,
char **  argv 
)
static

Definition at line 35 of file textutils.c.

Referenced by ff_expand_text_function().

◆ ff_expand_text_function()

static int ff_expand_text_function ( FFExpandTextContext expand_text,
AVBPrint *  bp,
const char **  rtext 
)
static

Expand text template pointed to by *rtext.

Expand text template defined in text using the logic defined in a text expander object.

This function expects the text to be in the format %{FUNCTION_NAME[:PARAMS]}, where PARAMS is a sequence of strings separated by : and represents the function arguments to use for the function evaluation.

Parameters
text_expanderTextExpander object used to expand the text
bpBPrint object where the expanded text is written to
rtextpointer to pointer to the text to expand, it is updated to point to the next part of the template to process
Returns
negative value corresponding to an AVERROR error code in case of errors, a non-negative value otherwise

Definition at line 82 of file textutils.c.

Referenced by ff_expand_text().

◆ ff_expand_text()

int ff_expand_text ( FFExpandTextContext expand_text,
const char *  text,
AVBPrint *  bp 
)

Expand text template.

Expand text template defined in text using the logic defined in a text expander object.

Parameters
expand_texttext expansion context used to expand the text
texttemplate text to expand
bpBPrint object where the expanded text is written to
Returns
negative value corresponding to an AVERROR error code in case of errors, a non-negative value otherwise

Definition at line 123 of file textutils.c.

Referenced by draw_qrcode(), and draw_text().

◆ ff_print_pts()

int ff_print_pts ( void *  log_ctx,
AVBPrint *  bp,
double  pts,
const char *  delta,
const char *  fmt,
const char *  strftime_fmt 
)

Definition at line 149 of file textutils.c.

Referenced by func_pts().

◆ ff_print_time()

int ff_print_time ( void *  log_ctx,
AVBPrint *  bp,
const char *  strftime_fmt,
char  localtime 
)

Definition at line 202 of file textutils.c.

Referenced by func_strftime().

◆ ff_print_eval_expr()

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 
)

Definition at line 281 of file textutils.c.

Referenced by func_eval_expr().

◆ ff_print_formatted_eval_expr()

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 
)

Definition at line 303 of file textutils.c.

Referenced by func_eval_expr_formatted().

◆ ff_load_textfile()

int ff_load_textfile ( void *  log_ctx,
const char *  textfile,
unsigned char **  text,
size_t *  text_size 
)

Definition at line 353 of file textutils.c.

Referenced by filter_frame(), and init().