avfilter/internal: Replace AVFilterPad.needs_writable by flags

It will be useful in the future when more flags are added.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/364/head
Andreas Rheinhardt 3 years ago
parent f60c3ca136
commit 1e35744a4c
  1. 2
      libavfilter/af_anequalizer.c
  2. 2
      libavfilter/af_channelmap.c
  3. 2
      libavfilter/af_firequalizer.c
  4. 2
      libavfilter/avfilter.c
  5. 2
      libavfilter/f_reverse.c
  6. 21
      libavfilter/internal.h
  7. 4
      libavfilter/vf_chromakey.c
  8. 2
      libavfilter/vf_codecview.c
  9. 2
      libavfilter/vf_colorcontrast.c
  10. 2
      libavfilter/vf_colorcorrect.c
  11. 2
      libavfilter/vf_colorize.c
  12. 2
      libavfilter/vf_colorkey.c
  13. 2
      libavfilter/vf_colortemperature.c
  14. 2
      libavfilter/vf_datascope.c
  15. 2
      libavfilter/vf_despill.c
  16. 4
      libavfilter/vf_drawbox.c
  17. 2
      libavfilter/vf_drawtext.c
  18. 2
      libavfilter/vf_elbg.c
  19. 2
      libavfilter/vf_exposure.c
  20. 2
      libavfilter/vf_fade.c
  21. 2
      libavfilter/vf_fillborders.c
  22. 2
      libavfilter/vf_lumakey.c
  23. 2
      libavfilter/vf_maskfun.c
  24. 2
      libavfilter/vf_monochrome.c
  25. 2
      libavfilter/vf_subtitles.c
  26. 2
      libavfilter/vf_swaprect.c
  27. 2
      libavfilter/vf_vibrance.c

@ -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 functions to get a video/audio buffers. If NULL,
* the filter system will use ff_default_get_video_buffer() for video
@ -110,14 +123,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,
},

Loading…
Cancel
Save