26#include "config_components.h"
62#define OFFSET(x) offsetof(SetTBContext, x)
63#define DEFINE_OPTIONS(filt_name, filt_type) \
64static const AVOption filt_name##_options[] = { \
65 { "expr", "set expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \
66 .flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \
67 { "tb", "set expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \
68 .flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \
85 outlink->
w = inlink->
w;
86 outlink->
h = inlink->
h;
93 time_base =
av_d2q(res, INT_MAX);
94 if (time_base.
num <= 0 || time_base.
den <= 0) {
96 "Invalid non-positive values for the timebase num:%d or den:%d.\n",
97 time_base.
num, time_base.
den);
117 inlink ->time_base.num, inlink ->
time_base.
den, orig_pts,
162#if CONFIG_SETTB_FILTER
167static const AVFilterPad avfilter_vf_settb_outputs[] = {
178 .p.priv_class = &settb_class,
187#if CONFIG_ASETTB_FILTER
192static const AVFilterPad avfilter_af_asettb_outputs[] = {
203 .p.priv_class = &asettb_class,
const FFFilter ff_af_asettb
const FFFilter ff_vf_settb
static AVFormatContext * ctx
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Main libavfilter public API header.
int av_expr_parse_and_eval(double *d, 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.
simple arithmetic expression evaluator
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
#define AVFILTER_DEFINE_CLASS(fname)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const char *const var_names[]
Utilities for rational number calculation.
static int64_t rescale_pts(AVFilterLink *inlink, AVFilterLink *outlink, int64_t orig_pts)
#define DEFINE_OPTIONS(filt_name, filt_type)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static int config_output_props(AVFilterLink *outlink)
static int activate(AVFilterContext *ctx)
Describe the class of an AVClass context structure.
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
Rational number (pair of numerator and denominator).
double var_values[VAR_VARS_NB]
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.