"on",
"duration",
"pduration",
- "time",
+ "in_time", "it",
+ "out_time", "time", "ot",
"frame",
"zoom",
"pzoom",
VAR_ON,
VAR_DURATION,
VAR_PDURATION,
- VAR_TIME,
+ VAR_IN_TIME, VAR_IT,
+ VAR_TIME, VAR_OUT_TIME, VAR_OT,
VAR_FRAME,
VAR_ZOOM,
VAR_PZOOM,
{
ZPContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
+ AVFilterLink *inlink = ctx->inputs[0];
int64_t pts = s->frame_count;
int k, x, y, w, h, ret = 0;
uint8_t *input[4];
var_values[VAR_PY] = s->y;
var_values[VAR_PZOOM] = s->prev_zoom;
var_values[VAR_PDURATION] = s->prev_nb_frames;
- var_values[VAR_TIME] = pts * av_q2d(outlink->time_base);
+ var_values[VAR_IN_TIME] = var_values[VAR_IT] = in->pts == AV_NOPTS_VALUE ?
+ NAN : in->pts * av_q2d(inlink->time_base);
+ var_values[VAR_OUT_TIME] = pts * av_q2d(outlink->time_base);
+ var_values[VAR_TIME] = var_values[VAR_OT] = var_values[VAR_OUT_TIME];
var_values[VAR_FRAME] = i;
var_values[VAR_ON] = outlink->frame_count_in;
}
return ret;
error:
+ sws_freeContext(s->sws);
+ s->sws = NULL;
av_frame_free(&out);
return ret;
}
int status, ret = 0;
int64_t pts;
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
if (s->in && ff_outlink_frame_wanted(outlink)) {
double zoom = -1, dx = -1, dy = -1;
sws_freeContext(s->sws);
s->sws = NULL;
+ av_expr_free(s->x_expr);
+ av_expr_free(s->y_expr);
+ av_expr_free(s->zoom_expr);
+ av_frame_free(&s->in);
}
static const AVFilterPad inputs[] = {
{ NULL }
};
-AVFilter ff_vf_zoompan = {
+const AVFilter ff_vf_zoompan = {
.name = "zoompan",
.description = NULL_IF_CONFIG_SMALL("Apply Zoom & Pan effect."),
.priv_size = sizeof(ZPContext),