VAR_X,
VAR_Y,
VAR_N,
+ VAR_POS,
VAR_T,
VAR_VARS_NB
};
crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;
crop->var_values[VAR_N] = 0;
crop->var_values[VAR_T] = NAN;
+ crop->var_values[VAR_POS] = NAN;
av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc);
crop->hsub = pix_desc->log2_chroma_w;
frame->width = crop->w;
frame->height = crop->h;
+ crop->var_values[VAR_N] = link->frame_count;
crop->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
NAN : frame->pts * av_q2d(link->time_base);
+ crop->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ?
+ NAN : av_frame_get_pkt_pos(frame);
crop->var_values[VAR_X] = av_expr_eval(crop->x_pexpr, crop->var_values, NULL);
crop->var_values[VAR_Y] = av_expr_eval(crop->y_pexpr, crop->var_values, NULL);
crop->var_values[VAR_X] = av_expr_eval(crop->x_pexpr, crop->var_values, NULL);
crop->x &= ~((1 << crop->hsub) - 1);
crop->y &= ~((1 << crop->vsub) - 1);
- av_dlog(ctx, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
- (int)crop->var_values[VAR_N], crop->var_values[VAR_T], crop->x,
- crop->y, crop->x+crop->w, crop->y+crop->h);
+ av_dlog(ctx, "n:%d t:%f pos:%f x:%d y:%d x+w:%d y+h:%d\n",
+ (int)crop->var_values[VAR_N], crop->var_values[VAR_T], crop->var_values[VAR_POS],
+ crop->x, crop->y, crop->x+crop->w, crop->y+crop->h);
frame->data[0] += crop->y * frame->linesize[0];
frame->data[0] += crop->x * crop->max_step[0];
frame->data[3] += crop->x * crop->max_step[3];
}
- crop->var_values[VAR_N] += 1.0;
-
return ff_filter_frame(link->dst->outputs[0], frame);
}