FFmpeg
|
#include <stdint.h>
#include "scale.h"
#include "libavutil/eval.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
Go to the source code of this file.
Functions | |
int | ff_scale_eval_dimensions (void *log_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... | |
Variables | |
static const char *const | var_names [] |
static const char *const | var_names_scale2ref [] |
This must be kept in sync with var_names so that it is always a complete list of var_names with the scale2ref specific names appended. More... | |
enum var_name |
enum var_name_scale2ref |
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 106 of file scale.c.
Referenced by config_props(), cudascale_config_props(), nppscale_config_props(), and scale_vaapi_config_output().
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.
Returns 0.
Definition at line 186 of file scale.c.
Referenced by config_props(), cudascale_config_props(), nppscale_config_props(), and scale_vaapi_config_output().
|
static |
Definition at line 27 of file scale.c.
Referenced by ff_scale_eval_dimensions().
|
static |
This must be kept in sync with var_names so that it is always a complete list of var_names with the scale2ref specific names appended.
scale2ref values must appear in the order they appear in the var_name_scale2ref enum but also be below all of the non-scale2ref specific values.
Definition at line 70 of file scale.c.
Referenced by ff_scale_eval_dimensions().