FFmpeg
Functions
scale_eval.h File Reference
#include "avfilter.h"

Go to the source code of this file.

Functions

int ff_scale_eval_dimensions (void *ctx, const char *w_expr, const char *h_expr, AVFilterLink *inlink, AVFilterLink *outlink, int *ret_w, int *ret_h)
 Parse and evaluate string expressions for width and height. More...
 
int ff_scale_adjust_dimensions (AVFilterLink *inlink, int *ret_w, int *ret_h, int force_original_aspect_ratio, int force_divisible_by)
 Transform evaluated width and height obtained from ff_scale_eval_dimensions into actual target width and height for scaling. More...
 

Function Documentation

◆ ff_scale_eval_dimensions()

int ff_scale_eval_dimensions ( void *  ctx,
const char *  w_expr,
const char *  h_expr,
AVFilterLink inlink,
AVFilterLink outlink,
int *  ret_w,
int *  ret_h 
)

Parse and evaluate string expressions for width and height.

Upon success, ff_scale_adjust_dimensions must be called with evaluated width and height to obtain actual target dimensions.

Returns 0 upon success, negative value if one of the expressions could not be parsed or if NaN was the result of their evaluation.

Definition at line 57 of file scale_eval.c.

Referenced by cudascale_config_props(), libplacebo_config_output(), scale_vaapi_config_output(), scale_vt_config_output(), and scale_vulkan_config_output().

◆ ff_scale_adjust_dimensions()

int ff_scale_adjust_dimensions ( AVFilterLink inlink,
int *  ret_w,
int *  ret_h,
int  force_original_aspect_ratio,
int  force_divisible_by 
)

Transform evaluated width and height obtained from ff_scale_eval_dimensions into actual target width and height for scaling.

Adjustment can occur if one or both of the evaluated values are of the form '-n' or if force_original_aspect_ratio is set. force_divisible_by is used only when force_original_aspect_ratio is set and must be at least 1.

Returns negative error code on error or non negative on success

Definition at line 113 of file scale_eval.c.

Referenced by config_props(), cudascale_config_props(), libplacebo_config_output(), and scale_vaapi_config_output().