History

avfilter/vf_amplify: add timeline support

Paul B Mahol committed 6 years ago

Commit 55ca21d1 parent 103effe1 file · +16 −9Browse files

Unified · Split

libavfilter/vf_amplify.c+16−9
@@ -259,14 +259,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 258 unmodified lines
259259 s->frames[s->nb_inputs - 1] = in;
260260 }
261261
262− out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
263− if (!out)
264− return AVERROR(ENOMEM);
265− out->pts = s->frames[0]->pts;
266−
267− td.out = out;
268− td.in = s->frames;
269− ctx->internal->execute(ctx, amplify_frame, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
262+ if (!ctx->is_disabled) {
263+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
264+ if (!out)
265+ return AVERROR(ENOMEM);
266+ av_frame_copy_props(out, s->frames[0]);
267+
268+ td.out = out;
269+ td.in = s->frames;
270+ ctx->internal->execute(ctx, amplify_frame, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
271+ } else {
272+ out = av_frame_clone(s->frames[s->radius]);
273+ if (!out)
274+ return AVERROR(ENOMEM);
275+ out->pts = s->frames[0]->pts;
276+ }
270277
271278 return ff_filter_frame(outlink, out);
272279 }
@@ -316,6 +323,6 @@ AVFilter ff_vf_amplify = { · 43 unmodified lines
316323 .inputs = inputs,
317324 .init = init,
318325 .uninit = uninit,
319− .flags = AVFILTER_FLAG_SLICE_THREADS,
326+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
320327 .process_command = ff_filter_process_command,
321328 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t