@@ -757,9 +757,9 @@ static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -383,9 +383,9 @@ static const AVFilterPad avfilter_af_channelmap_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = channelmap_filter_frame,
.config_props = channelmap_config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -939,10 +939,10 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
static const AVFilterPad firequalizer_inputs[] = {
{
.name = "default",
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = filter_frame,
.type = AVMEDIA_TYPE_AUDIO,
- .needs_writable = 1,
},
{ NULL }
};
@@ -950,7 +950,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
if (!(filter_frame = dst->filter_frame))
filter_frame = default_filter_frame;
- if (dst->needs_writable) {
+ if (dst->flags & AVFILTERPAD_FLAG_NEEDS_WRITABLE) {
ret = ff_inlink_make_frame_writable(link, &frame);
if (ret < 0)
goto fail;
@@ -269,8 +269,8 @@ static const AVFilterPad areverse_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -60,6 +60,19 @@ struct AVFilterPad {
*/
enum AVMediaType type;
+ /**
+ * The filter expects writable frames from its input link,
+ * duplicating data buffers if needed.
+ *
+ * input pads only.
+ */
+#define AVFILTERPAD_FLAG_NEEDS_WRITABLE (1 << 0)
+
+ /**
+ * A combination of AVFILTERPAD_FLAG_* flags.
+ */
+ int flags;
+
/**
* Callback function to get a video buffer. If NULL, the filter system will
* use ff_default_get_video_buffer().
@@ -112,14 +125,6 @@ struct AVFilterPad {
* and another value on error.
*/
int (*config_props)(AVFilterLink *link);
-
- /**
- * The filter expects writable frames from its input link,
- * duplicating data buffers if needed.
- *
- * input pads only.
- */
- int needs_writable;
};
struct AVFilterGraphInternal {
@@ -367,7 +367,7 @@ static const AVFilterPad chromakey_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -420,7 +420,7 @@ static const AVFilterPad chromahold_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -300,9 +300,9 @@ static const AVFilterPad codecview_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -358,7 +358,7 @@ static const AVFilterPad colorcontrast_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -303,7 +303,7 @@ static const AVFilterPad colorcorrect_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -259,7 +259,7 @@ static const AVFilterPad colorize_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -176,8 +176,8 @@ static const AVFilterPad colorkey_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -324,9 +324,9 @@ static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -1130,9 +1130,9 @@ static const AVFilterPad oscilloscope_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = oscilloscope_filter_frame,
.config_props = oscilloscope_config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -131,8 +131,8 @@ static const AVFilterPad despill_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -384,9 +384,9 @@ static const AVFilterPad drawbox_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -468,9 +468,9 @@ static const AVFilterPad drawgrid_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = drawgrid_filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -1615,9 +1615,9 @@ static const AVFilterPad avfilter_vf_drawtext_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -235,9 +235,9 @@ static const AVFilterPad elbg_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -99,7 +99,7 @@ static const AVFilterPad exposure_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -551,9 +551,9 @@ static const AVFilterPad avfilter_vf_fade_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -705,9 +705,9 @@ static const AVFilterPad fillborders_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.config_props = config_input,
.filter_frame = filter_frame,
- .needs_writable = 1,
},
{ NULL }
};
@@ -172,9 +172,9 @@ static const AVFilterPad lumakey_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -294,9 +294,9 @@ static const AVFilterPad maskfun_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -267,7 +267,7 @@ static const AVFilterPad monochrome_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
@@ -198,9 +198,9 @@ static const AVFilterPad ass_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -228,9 +228,9 @@ static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -340,7 +340,7 @@ static const AVFilterPad vibrance_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .needs_writable = 1,
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
It will be useful in the future when more flags are added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavfilter/af_anequalizer.c | 2 +- libavfilter/af_channelmap.c | 2 +- libavfilter/af_firequalizer.c | 2 +- libavfilter/avfilter.c | 2 +- libavfilter/f_reverse.c | 2 +- libavfilter/internal.h | 21 +++++++++++++-------- libavfilter/vf_chromakey.c | 4 ++-- libavfilter/vf_codecview.c | 2 +- libavfilter/vf_colorcontrast.c | 2 +- libavfilter/vf_colorcorrect.c | 2 +- libavfilter/vf_colorize.c | 2 +- libavfilter/vf_colorkey.c | 2 +- libavfilter/vf_colortemperature.c | 2 +- libavfilter/vf_datascope.c | 2 +- libavfilter/vf_despill.c | 2 +- libavfilter/vf_drawbox.c | 4 ++-- libavfilter/vf_drawtext.c | 2 +- libavfilter/vf_elbg.c | 2 +- libavfilter/vf_exposure.c | 2 +- libavfilter/vf_fade.c | 2 +- libavfilter/vf_fillborders.c | 2 +- libavfilter/vf_lumakey.c | 2 +- libavfilter/vf_maskfun.c | 2 +- libavfilter/vf_monochrome.c | 2 +- libavfilter/vf_subtitles.c | 2 +- libavfilter/vf_swaprect.c | 2 +- libavfilter/vf_vibrance.c | 2 +- 27 files changed, 41 insertions(+), 36 deletions(-)