#include "libavutil/ffversion.h"
const char av_filter_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
-static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
-
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
{
av_unused char buf[16];
{
FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1);
+ av_assert1(!link->dst->filter->activate);
if (link->status_out)
return link->status_out;
if (link->status_in) {
return 0;
}
-int ff_request_frame_to_filter(AVFilterLink *link)
+static int ff_request_frame_to_filter(AVFilterLink *link)
{
int ret = -1;
ff_inlink_process_commands(link, frame);
dstctx->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
- /* TODO reindent */
- if (dstctx->is_disabled &&
- (dstctx->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC))
- filter_frame = default_filter_frame;
+ if (dstctx->is_disabled &&
+ (dstctx->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC))
+ filter_frame = default_filter_frame;
ret = filter_frame(link, frame);
link->frame_count_out++;
- ff_update_link_current_pts(link, frame->pts);
return ret;
fail:
frame = ff_framequeue_peek(&link->fifo, 0);
av_samples_copy(buf->extended_data, frame->extended_data, p, 0, n,
link->channels, link->format);
- frame->nb_samples -= n;
- av_samples_copy(frame->extended_data, frame->extended_data, 0, n,
- frame->nb_samples, link->channels, link->format);
- if (frame->pts != AV_NOPTS_VALUE)
- frame->pts += av_rescale_q(n, av_make_q(1, link->sample_rate), link->time_base);
- ff_framequeue_update_peeked(&link->fifo, 0);
- ff_framequeue_skip_samples(&link->fifo, n);
+ ff_framequeue_skip_samples(&link->fifo, n, link->time_base);
}
*rframe = buf;
return 0;
}
-int ff_filter_frame_to_filter(AVFilterLink *link)
+static int ff_filter_frame_to_filter(AVFilterLink *link)
{
AVFrame *frame = NULL;
AVFilterContext *dst = link->dst;
{
int ret;
+ /* Generic timeline support is not yet implemented but should be easy */
+ av_assert1(!(filter->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC &&
+ filter->filter->activate));
filter->ready = 0;
- ret = ff_filter_activate_default(filter);
+ ret = filter->filter->activate ? filter->filter->activate(filter) :
+ ff_filter_activate_default(filter);
if (ret == FFERROR_NOT_READY)
ret = 0;
return ret;
static void consume_update(AVFilterLink *link, const AVFrame *frame)
{
+ ff_update_link_current_pts(link, frame->pts);
ff_inlink_process_commands(link, frame);
link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
link->frame_count_out++;
return fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) >= 0.5;
}
+void ff_inlink_request_frame(AVFilterLink *link)
+{
+ av_assert1(!link->status_in);
+ av_assert1(!link->status_out);
+ link->frame_wanted_out = 1;
+ ff_filter_set_ready(link->src, 100);
+}
+
const AVClass *avfilter_get_class(void)
{
return &avfilter_class;