[FFmpeg-devel] [PATCH 5/5] lavfi: remove FF_LINK_FLAG_REQUEST_LOOP.
Nicolas George
george at nsup.org
Wed Aug 26 13:19:37 CEST 2015
It has no longer any effect.
Signed-off-by: Nicolas George <george at nsup.org>
---
libavfilter/af_afade.c | 1 -
libavfilter/af_asetnsamples.c | 1 -
libavfilter/af_atempo.c | 2 --
libavfilter/af_compand.c | 1 -
libavfilter/af_dynaudnorm.c | 7 -------
libavfilter/af_silenceremove.c | 8 --------
libavfilter/avf_showfreqs.c | 1 -
libavfilter/avfilter.c | 1 -
libavfilter/f_ebur128.c | 4 ----
libavfilter/f_interleave.c | 2 --
libavfilter/f_reverse.c | 8 --------
libavfilter/framesync.c | 1 -
libavfilter/internal.h | 14 --------------
libavfilter/trim.c | 8 --------
libavfilter/vf_atadenoise.c | 7 -------
libavfilter/vf_blend.c | 5 ++---
libavfilter/vf_decimate.c | 1 -
libavfilter/vf_detelecine.c | 1 -
libavfilter/vf_fieldmatch.c | 1 -
libavfilter/vf_framestep.c | 1 -
libavfilter/vf_idet.c | 7 -------
libavfilter/vf_interlace.c | 1 -
libavfilter/vf_palettegen.c | 1 -
libavfilter/vf_pullup.c | 7 -------
libavfilter/vf_random.c | 7 -------
libavfilter/vf_stereo3d.c | 1 -
libavfilter/vf_telecine.c | 1 -
libavfilter/vf_tile.c | 2 --
libavfilter/vf_tinterlace.c | 1 -
libavfilter/vf_w3fdif.c | 1 -
30 files changed, 2 insertions(+), 102 deletions(-)
The following filters implement the loop themselves and can be simplified
(but no rush):
af_aresample.c
af_astreamsync.c
af_asyncts.c
avf_showcqt.c
avf_showspectrum.c
avf_showwaves.c
f_select.c
vf_alphamerge.c
vf_decimate.c
vf_fieldmatch.c
vf_fps.c
vf_mpdecimate.c
vf_thumbnail.c
vf_w3fdif.c
vf_yadif.c
The following filters push a frame in request_frame instead of filter_frame:
af_amix.c
af_join.c
fifo.c
vf_framepack.c
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index a599b62..393556c 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -611,7 +611,6 @@ static int acrossfade_config_output(AVFilterLink *outlink)
outlink->time_base = ctx->inputs[0]->time_base;
outlink->channel_layout = ctx->inputs[0]->channel_layout;
outlink->channels = ctx->inputs[0]->channels;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
switch (outlink->format) {
case AV_SAMPLE_FMT_DBL: s->crossfade_samples = crossfade_samples_dbl; break;
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index e830643..7756c5a 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -77,7 +77,6 @@ static int config_props_output(AVFilterLink *outlink)
asns->fifo = av_audio_fifo_alloc(outlink->format, outlink->channels, asns->nb_out_samples);
if (!asns->fifo)
return AVERROR(ENOMEM);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 49d49ee..7b3d57c 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -1046,8 +1046,6 @@ static int config_props(AVFilterLink *inlink)
int sample_rate = (int)inlink->sample_rate;
int channels = av_get_channel_layout_nb_channels(inlink->channel_layout);
- ctx->outputs[0]->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-
return yae_reset(atempo, format, sample_rate, channels);
}
diff --git a/libavfilter/af_compand.c b/libavfilter/af_compand.c
index 610787f..91e8770 100644
--- a/libavfilter/af_compand.c
+++ b/libavfilter/af_compand.c
@@ -531,7 +531,6 @@ static int config_output(AVFilterLink *outlink)
if (err)
return err;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
s->compand = compand_delay;
return 0;
}
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index 60d6c87..9bb8d6e 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -305,12 +305,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
static inline double fade(double prev, double next, int pos,
double *fade_factors[2])
{
@@ -721,7 +715,6 @@ static const AVFilterPad avfilter_af_dynaudnorm_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index cd1e038..5a27400 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -153,13 +153,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-
- return 0;
-}
-
static double compute_rms(SilenceRemoveContext *s, double sample)
{
double new_sum;
@@ -463,7 +456,6 @@ static const AVFilterPad silenceremove_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index a1ef0bf..afc5def 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -287,7 +287,6 @@ static int config_output(AVFilterLink *outlink)
s->scale += s->window_func_lut[i] * s->window_func_lut[i];
}
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->frame_rate = av_make_q(inlink->sample_rate, s->win_size * (1.-s->overlap));
outlink->sample_aspect_ratio = (AVRational){1,1};
outlink->w = s->w;
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index dfdc574..2ff9d53 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1112,7 +1112,6 @@ static int ff_filter_frame_needs_framing(AVFilterLink *link, AVFrame *frame)
int nb_channels = av_frame_get_channels(frame);
int ret = 0;
- link->flags |= FF_LINK_FLAG_REQUEST_LOOP;
/* Handle framing (min_samples, max_samples) */
while (insamples) {
if (!pbuf) {
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index c18ae79..ef891b6 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -337,8 +337,6 @@ static int config_video_output(AVFilterLink *outlink)
DRAW_RECT(ebur128->graph);
DRAW_RECT(ebur128->gauge);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-
return 0;
}
@@ -398,8 +396,6 @@ static int config_audio_output(AVFilterLink *outlink)
return AVERROR(ENOMEM);
}
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-
#if CONFIG_SWRESAMPLE
if (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS) {
int ret;
diff --git a/libavfilter/f_interleave.c b/libavfilter/f_interleave.c
index 95401cf..e0915b5 100644
--- a/libavfilter/f_interleave.c
+++ b/libavfilter/f_interleave.c
@@ -180,8 +180,6 @@ static int config_output(AVFilterLink *outlink)
}
}
}
-
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
diff --git a/libavfilter/f_reverse.c b/libavfilter/f_reverse.c
index 10529df..1f475e1 100644
--- a/libavfilter/f_reverse.c
+++ b/libavfilter/f_reverse.c
@@ -62,12 +62,6 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->frames);
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
@@ -129,7 +123,6 @@ static const AVFilterPad reverse_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame,
- .config_props = config_output,
},
{ NULL }
};
@@ -240,7 +233,6 @@ static const AVFilterPad areverse_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.request_frame = areverse_request_frame,
- .config_props = config_output,
},
{ NULL }
};
diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
index 12db50c..92ba498 100644
--- a/libavfilter/framesync.c
+++ b/libavfilter/framesync.c
@@ -315,7 +315,6 @@ int ff_framesync_request_frame(FFFrameSync *fs, AVFilterLink *outlink)
return 0;
if (fs->eof)
return AVERROR_EOF;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
input = fs->in_request;
ret = ff_request_frame(ctx->inputs[input]);
if (ret == AVERROR_EOF) {
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 1343a4e..5100044 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -363,20 +363,6 @@ int ff_request_frame(AVFilterLink *link);
int ff_filter_frame(AVFilterLink *link, AVFrame *frame);
/**
- * Flags for AVFilterLink.flags.
- */
-enum {
-
- /**
- * Frame requests may need to loop in order to be fulfilled.
- * A filter must set this flags on an output link if it may return 0 in
- * request_frame() without filtering a frame.
- */
- FF_LINK_FLAG_REQUEST_LOOP = 1,
-
-};
-
-/**
* Allocate a new filter context and return it.
*
* @param filter what filter to create an instance of
diff --git a/libavfilter/trim.c b/libavfilter/trim.c
index 468dc03..e8d023e 100644
--- a/libavfilter/trim.c
+++ b/libavfilter/trim.c
@@ -114,12 +114,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
#define OFFSET(x) offsetof(TrimContext, x)
#define COMMON_OPTS \
{ "starti", "Timestamp of the first frame that " \
@@ -223,7 +217,6 @@ static const AVFilterPad trim_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .config_props = config_output,
},
{ NULL }
};
@@ -378,7 +371,6 @@ static const AVFilterPad atrim_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .config_props = config_output,
},
{ NULL }
};
diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c
index 5e60687..8978530 100755
--- a/libavfilter/vf_atadenoise.c
+++ b/libavfilter/vf_atadenoise.c
@@ -285,12 +285,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
AVFilterContext *ctx = inlink->dst;
@@ -398,7 +392,6 @@ static const AVFilterPad outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame,
- .config_props = config_output,
},
{ NULL }
};
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 2a33ce1..e3c8474 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -467,9 +467,8 @@ static int config_output(AVFilterLink *outlink)
is_16bit = pix_desc->comp[0].depth_minus1 == 15;
s->nb_planes = av_pix_fmt_count_planes(toplink->format);
- if (s->tblend)
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- else if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
+ if (!s->tblend)
+ if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
return ret;
for (plane = 0; plane < FF_ARRAY_ELEMS(s->params); plane++) {
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index 70357ea..03919f7 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -372,7 +372,6 @@ static int config_output(AVFilterLink *outlink)
fps = av_mul_q(fps, (AVRational){dm->cycle - 1, dm->cycle});
av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n",
inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->time_base = inlink->time_base;
outlink->frame_rate = fps;
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c
index 44379a3..320e90d 100644
--- a/libavfilter/vf_detelecine.c
+++ b/libavfilter/vf_detelecine.c
@@ -170,7 +170,6 @@ static int config_output(AVFilterLink *outlink)
av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n",
inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->frame_rate = fps;
outlink->time_base = av_mul_q(inlink->time_base, s->pts);
av_log(ctx, AV_LOG_VERBOSE, "TB: %d/%d -> %d/%d\n",
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index c01af66..ccccb19 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -953,7 +953,6 @@ static int config_output(AVFilterLink *outlink)
const AVFilterLink *inlink =
ctx->inputs[fm->ppsrc ? INPUT_CLEANSRC : INPUT_MAIN];
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->time_base = inlink->time_base;
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
outlink->frame_rate = inlink->frame_rate;
diff --git a/libavfilter/vf_framestep.c b/libavfilter/vf_framestep.c
index 09945e1..6f198b8 100644
--- a/libavfilter/vf_framestep.c
+++ b/libavfilter/vf_framestep.c
@@ -49,7 +49,6 @@ static int config_output_props(AVFilterLink *outlink)
FrameStepContext *framestep = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->frame_rate =
av_div_q(inlink->frame_rate, (AVRational){framestep->frame_step, 1});
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index b6411a4..5342b30 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -400,12 +400,6 @@ static int query_formats(AVFilterContext *ctx)
return ff_set_common_formats(ctx, fmts_list);
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
static av_cold int init(AVFilterContext *ctx)
{
IDETContext *idet = ctx->priv;
@@ -440,7 +434,6 @@ static const AVFilterPad idet_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .config_props = config_output,
.request_frame = request_frame
},
{ NULL }
diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
index a520776..3ab1582 100644
--- a/libavfilter/vf_interlace.c
+++ b/libavfilter/vf_interlace.c
@@ -113,7 +113,6 @@ static int config_out_props(AVFilterLink *outlink)
// half framerate
outlink->time_base.num *= 2;
outlink->frame_rate.den *= 2;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
if (s->lowpass) {
diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c
index 4e7cb8a..b59cf38 100644
--- a/libavfilter/vf_palettegen.c
+++ b/libavfilter/vf_palettegen.c
@@ -520,7 +520,6 @@ static int config_output(AVFilterLink *outlink)
{
outlink->w = outlink->h = 16;
outlink->sample_aspect_ratio = av_make_q(1, 1);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c
index ea15019..79cf9ee 100644
--- a/libavfilter/vf_pullup.c
+++ b/libavfilter/vf_pullup.c
@@ -220,12 +220,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
static PullupBuffer *pullup_lock_buffer(PullupBuffer *b, int parity)
{
if (!b)
@@ -766,7 +760,6 @@ static const AVFilterPad pullup_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .config_props = config_output,
},
{ NULL }
};
diff --git a/libavfilter/vf_random.c b/libavfilter/vf_random.c
index 663fafc..373a7db 100644
--- a/libavfilter/vf_random.c
+++ b/libavfilter/vf_random.c
@@ -64,12 +64,6 @@ static av_cold int init(AVFilterContext *ctx)
return 0;
}
-static int config_output(AVFilterLink *outlink)
-{
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
- return 0;
-}
-
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
@@ -128,7 +122,6 @@ static const AVFilterPad random_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame,
- .config_props = config_output,
},
{ NULL }
};
diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c
index 5309d70..e065d42 100644
--- a/libavfilter/vf_stereo3d.c
+++ b/libavfilter/vf_stereo3d.c
@@ -364,7 +364,6 @@ static int config_output(AVFilterLink *outlink)
break;
case ALTERNATING_RL:
case ALTERNATING_LR:
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
fps.den *= 2;
tb.num *= 2;
break;
diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index 26f0ef8..bb091e1 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -157,7 +157,6 @@ static int config_output(AVFilterLink *outlink)
av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n",
inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->frame_rate = fps;
outlink->time_base = av_mul_q(inlink->time_base, s->pts);
av_log(ctx, AV_LOG_VERBOSE, "TB: %d/%d -> %d/%d\n",
diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c
index 4756977..9af00bd 100644
--- a/libavfilter/vf_tile.c
+++ b/libavfilter/vf_tile.c
@@ -116,8 +116,6 @@ static int config_props(AVFilterLink *outlink)
ff_draw_init(&tile->draw, inlink->format, 0);
ff_draw_color(&tile->draw, &tile->blank, tile->rgba_color);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-
return 0;
}
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index e2f8c34..4bdcd45 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -117,7 +117,6 @@ static int config_out_props(AVFilterLink *outlink)
int i;
tinterlace->vsub = desc->log2_chroma_h;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
outlink->w = inlink->w;
outlink->h = tinterlace->mode == MODE_MERGE || tinterlace->mode == MODE_PAD ?
inlink->h*2 : inlink->h;
diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index bbd8db0..849a3c0 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -117,7 +117,6 @@ static int config_output(AVFilterLink *outlink)
outlink->time_base.den = inlink->time_base.den * 2;
outlink->frame_rate.num = inlink->frame_rate.num * 2;
outlink->frame_rate.den = inlink->frame_rate.den;
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
--
2.5.0
More information about the ffmpeg-devel
mailing list