28 #include "libavutil/common.h"
29 #include "libavutil/eval.h"
30 #include "libavutil/mathematics.h"
31 #include "libavutil/opt.h"
32 #include "libavutil/parseutils.h"
43 #if FF_API_OLD_FILTER_OPTS
54 #if FF_API_OLD_FILTER_OPTS
58 "num:den syntax is deprecated, please use num/den or named options instead\n");
60 NULL, NULL, NULL, NULL, NULL, 0, ctx);
70 if (ret < 0 || s->sar.num < 0 || s->
sar.
den <= 0) {
72 "Invalid string '%s' for aspect ratio\n", s->
ratio_str);
88 #define OFFSET(x) offsetof(AspectContext, x)
89 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
100 #if CONFIG_SETDAR_FILTER
112 s->
dar.
den * inlink->
w, INT_MAX);
122 inlink->
w, inlink->
h, old_dar.
num, old_dar.
den, old_sar.
num, old_sar.
den,
128 static const AVOption setdar_options[] = {
132 #if FF_API_OLD_FILTER_OPTS
135 {
"max",
"set max value for nominator or denominator in the ratio",
OFFSET(max),
AV_OPT_TYPE_INT, {.i64=100}, 1, INT_MAX,
FLAGS },
141 static const AVFilterPad avfilter_vf_setdar_inputs[] = {
145 .config_props = setdar_config_props,
151 static const AVFilterPad avfilter_vf_setdar_outputs[] = {
164 .priv_class = &setdar_class,
165 .
inputs = avfilter_vf_setdar_inputs,
166 .
outputs = avfilter_vf_setdar_outputs,
171 #if CONFIG_SETSAR_FILTER
184 inlink->
w, inlink->
h, old_sar.
num, old_sar.
den, old_dar.
num, old_dar.
den,
190 static const AVOption setsar_options[] = {
194 #if FF_API_OLD_FILTER_OPTS
197 {
"max",
"set max value for nominator or denominator in the ratio",
OFFSET(max),
AV_OPT_TYPE_INT, {.i64=100}, 1, INT_MAX,
FLAGS },
203 static const AVFilterPad avfilter_vf_setsar_inputs[] = {
207 .config_props = setsar_config_props,
213 static const AVFilterPad avfilter_vf_setsar_outputs[] = {
226 .priv_class = &setsar_class,
227 .
inputs = avfilter_vf_setsar_inputs,
228 .
outputs = avfilter_vf_setsar_outputs,
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
static void compute_dar(AVRational *dar, AVRational sar, int w, int h)
void * priv
private data for use by the filter
#define AV_LOG_WARNING
Something somehow does not look correct.
static const AVFilterPad outputs[]
int h
agreed upon image height
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
#define AV_LOG_VERBOSE
Detailed information.
A filter pad used for either input or output.
A link between two filters.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int init(AVFilterContext *ctx)
int av_parse_ratio(AVRational *q, const char *str, int max, int log_offset, void *log_ctx)
Parse str and store the parsed ratio in q.
int w
agreed upon image width
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
AVRational av_d2q(double d, int max) av_const
Convert a double precision floating point number to a rational.
int av_expr_parse_and_eval(double *res, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Main libavfilter public API header.
AVFilterLink ** outputs
array of pointers to output links
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
rational number numerator/denominator
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterContext * dst
dest filter
#define AVFILTER_DEFINE_CLASS(fname)
static int filter_frame(AVFilterLink *link, AVFrame *frame)