Commit 568c70e7 authored by Mans Rullgard's avatar Mans Rullgard

lavfi: convert input/ouput list compound literals to named objects

A number of compilers, for example those from TI and IBM, choke on
these initialisers.  The current style is also quite ugly.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent b404c660
......@@ -132,6 +132,22 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
static const AVFilterPad avfilter_af_aformat_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
},
{ NULL }
};
static const AVFilterPad avfilter_af_aformat_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO
},
{ NULL }
};
AVFilter avfilter_af_aformat = {
.name = "aformat",
.description = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."),
......@@ -139,10 +155,6 @@ AVFilter avfilter_af_aformat = {
.query_formats = query_formats,
.priv_size = sizeof(AFormatContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, },
{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO},
{ .name = NULL}},
.inputs = avfilter_af_aformat_inputs,
.outputs = avfilter_af_aformat_outputs,
};
......@@ -549,6 +549,16 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
static const AVFilterPad avfilter_af_amix_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_output,
.request_frame = request_frame
},
{ NULL }
};
AVFilter avfilter_af_amix = {
.name = "amix",
.description = NULL_IF_CONFIG_SMALL("Audio mixing."),
......@@ -559,9 +569,5 @@ AVFilter avfilter_af_amix = {
.query_formats = query_formats,
.inputs = NULL,
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_output,
.request_frame = request_frame },
{ .name = NULL}},
.outputs = avfilter_af_amix_outputs,
};
......@@ -26,18 +26,30 @@
#include "internal.h"
#include "libavutil/internal.h"
static const AVFilterPad avfilter_af_anull_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer,
},
{ NULL }
};
static const AVFilterPad avfilter_af_anull_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
},
{ NULL }
};
AVFilter avfilter_af_anull = {
.name = "anull",
.description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."),
.priv_size = 0,
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer, },
{ .name = NULL}},
.inputs = avfilter_af_anull_inputs,
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, },
{ .name = NULL}},
.outputs = avfilter_af_anull_outputs,
};
......@@ -239,6 +239,25 @@ fail:
return ret;
}
static const AVFilterPad avfilter_af_asyncts_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples
},
{ NULL }
};
static const AVFilterPad avfilter_af_asyncts_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_props,
.request_frame = request_frame
},
{ NULL }
};
AVFilter avfilter_af_asyncts = {
.name = "asyncts",
.description = NULL_IF_CONFIG_SMALL("Sync audio data to timestamps"),
......@@ -248,13 +267,6 @@ AVFilter avfilter_af_asyncts = {
.priv_size = sizeof(ASyncContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples },
{ NULL }},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_props,
.request_frame = request_frame },
{ NULL }},
.inputs = avfilter_af_asyncts_inputs,
.outputs = avfilter_af_asyncts_outputs,
};
......@@ -386,6 +386,24 @@ static int channelmap_config_input(AVFilterLink *inlink)
return err;
}
static const AVFilterPad avfilter_af_channelmap_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = channelmap_filter_samples,
.config_props = channelmap_config_input
},
{ NULL }
};
static const AVFilterPad avfilter_af_channelmap_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO
},
{ NULL }
};
AVFilter avfilter_af_channelmap = {
.name = "channelmap",
.description = NULL_IF_CONFIG_SMALL("Remap audio channels."),
......@@ -393,12 +411,6 @@ AVFilter avfilter_af_channelmap = {
.query_formats = channelmap_query_formats,
.priv_size = sizeof(ChannelMapContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = channelmap_filter_samples,
.config_props = channelmap_config_input },
{ .name = NULL }},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO },
{ .name = NULL }},
.inputs = avfilter_af_channelmap_inputs,
.outputs = avfilter_af_channelmap_outputs,
};
......@@ -136,6 +136,15 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
return ret;
}
static const AVFilterPad avfilter_af_channelsplit_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples,
},
{ NULL }
};
AVFilter avfilter_af_channelsplit = {
.name = "channelsplit",
.description = NULL_IF_CONFIG_SMALL("Split audio into per-channel streams"),
......@@ -144,9 +153,6 @@ AVFilter avfilter_af_channelsplit = {
.init = init,
.query_formats = query_formats,
.inputs = (const AVFilterPad[]){{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples, },
{ NULL }},
.inputs = avfilter_af_channelsplit_inputs,
.outputs = NULL,
};
......@@ -485,6 +485,16 @@ fail:
return AVERROR(ENOMEM);
}
static const AVFilterPad avfilter_af_join_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = join_config_output,
.request_frame = join_request_frame,
},
{ NULL }
};
AVFilter avfilter_af_join = {
.name = "join",
.description = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
......@@ -496,9 +506,5 @@ AVFilter avfilter_af_join = {
.query_formats = join_query_formats,
.inputs = NULL,
.outputs = (const AVFilterPad[]){{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = join_config_output,
.request_frame = join_request_frame, },
{ NULL }},
.outputs = avfilter_af_join_outputs,
};
......@@ -239,6 +239,26 @@ fail:
return ret;
}
static const AVFilterPad avfilter_af_resample_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples,
.min_perms = AV_PERM_READ
},
{ NULL }
};
static const AVFilterPad avfilter_af_resample_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_output,
.request_frame = request_frame
},
{ NULL }
};
AVFilter avfilter_af_resample = {
.name = "resample",
.description = NULL_IF_CONFIG_SMALL("Audio resampling and conversion."),
......@@ -247,14 +267,6 @@ AVFilter avfilter_af_resample = {
.uninit = uninit,
.query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples,
.min_perms = AV_PERM_READ },
{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_output,
.request_frame = request_frame },
{ .name = NULL}},
.inputs = avfilter_af_resample_inputs,
.outputs = avfilter_af_resample_outputs,
};
......@@ -25,19 +25,21 @@ static int null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref
return 0;
}
static const AVFilterPad avfilter_asink_anullsink_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = null_filter_samples,
},
{ NULL },
};
AVFilter avfilter_asink_anullsink = {
.name = "anullsink",
.description = NULL_IF_CONFIG_SMALL("Do absolutely nothing with the input audio."),
.priv_size = 0,
.inputs = (const AVFilterPad[]) {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = null_filter_samples,
},
{ .name = NULL},
},
.inputs = avfilter_asink_anullsink_inputs,
.outputs = NULL,
};
......@@ -84,6 +84,16 @@ static int request_frame(AVFilterLink *link)
return -1;
}
static const AVFilterPad avfilter_asrc_anullsrc_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_props,
.request_frame = request_frame,
},
{ NULL }
};
AVFilter avfilter_asrc_anullsrc = {
.name = "anullsrc",
.description = NULL_IF_CONFIG_SMALL("Null audio source, never return audio frames."),
......@@ -93,9 +103,5 @@ AVFilter avfilter_asrc_anullsrc = {
.inputs = NULL,
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_props,
.request_frame = request_frame, },
{ .name = NULL}},
.outputs = avfilter_asrc_anullsrc_outputs,
};
......@@ -140,32 +140,44 @@ int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **pbuf,
return ret;
}
static const AVFilterPad avfilter_vsink_buffer_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame,
.min_perms = AV_PERM_READ,
.needs_fifo = 1
},
{ NULL }
};
AVFilter avfilter_vsink_buffer = {
.name = "buffersink",
.description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
.priv_size = sizeof(BufferSinkContext),
.uninit = uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame,
.min_perms = AV_PERM_READ,
.needs_fifo = 1 },
{ .name = NULL }},
.inputs = avfilter_vsink_buffer_inputs,
.outputs = NULL,
};
static const AVFilterPad avfilter_asink_abuffer_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = start_frame,
.min_perms = AV_PERM_READ,
.needs_fifo = 1
},
{ NULL }
};
AVFilter avfilter_asink_abuffer = {
.name = "abuffersink",
.description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
.priv_size = sizeof(BufferSinkContext),
.uninit = uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_samples = start_frame,
.min_perms = AV_PERM_READ,
.needs_fifo = 1 },
{ .name = NULL }},
.inputs = avfilter_asink_abuffer_inputs,
.outputs = NULL,
};
......@@ -355,6 +355,17 @@ static int poll_frame(AVFilterLink *link)
return size/sizeof(AVFilterBufferRef*);
}
static const AVFilterPad avfilter_vsrc_buffer_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame,
.poll_frame = poll_frame,
.config_props = config_props,
},
{ NULL }
};
AVFilter avfilter_vsrc_buffer = {
.name = "buffer",
.description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them accessible to the filterchain."),
......@@ -365,12 +376,18 @@ AVFilter avfilter_vsrc_buffer = {
.uninit = uninit,
.inputs = NULL,
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame,
.poll_frame = poll_frame,
.config_props = config_props, },
{ .name = NULL}},
.outputs = avfilter_vsrc_buffer_outputs,
};
static const AVFilterPad avfilter_asrc_abuffer_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame,
.poll_frame = poll_frame,
.config_props = config_props,
},
{ NULL }
};
AVFilter avfilter_asrc_abuffer = {
......@@ -383,10 +400,5 @@ AVFilter avfilter_asrc_abuffer = {
.uninit = uninit,
.inputs = NULL,
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame,
.poll_frame = poll_frame,
.config_props = config_props, },
{ .name = NULL}},
.outputs = avfilter_asrc_abuffer_outputs,
};
......@@ -267,6 +267,28 @@ static int request_frame(AVFilterLink *outlink)
return ret;
}
static const AVFilterPad avfilter_vf_fifo_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = add_to_queue,
.draw_slice = draw_slice,
.end_frame = end_frame,
.rej_perms = AV_PERM_REUSE2,
},
{ NULL }
};
static const AVFilterPad avfilter_vf_fifo_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame,
},
{ NULL }
};
AVFilter avfilter_vf_fifo = {
.name = "fifo",
.description = NULL_IF_CONFIG_SMALL("Buffer input images and send them when they are requested."),
......@@ -276,18 +298,28 @@ AVFilter avfilter_vf_fifo = {
.priv_size = sizeof(FifoContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= ff_null_get_video_buffer,
.start_frame = add_to_queue,
.draw_slice = draw_slice,
.end_frame = end_frame,
.rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame, },
{ .name = NULL}},
.inputs = avfilter_vf_fifo_inputs,
.outputs = avfilter_vf_fifo_outputs,
};
static const AVFilterPad avfilter_af_afifo_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer,
.filter_samples = add_to_queue,
.rej_perms = AV_PERM_REUSE2,
},
{ NULL }
};
static const AVFilterPad avfilter_af_afifo_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame,
},
{ NULL }
};
AVFilter avfilter_af_afifo = {
......@@ -299,14 +331,6 @@ AVFilter avfilter_af_afifo = {
.priv_size = sizeof(FifoContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer,
.filter_samples = add_to_queue,
.rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame, },
{ .name = NULL}},
.inputs = avfilter_af_afifo_inputs,
.outputs = avfilter_af_afifo_outputs,
};
......@@ -110,6 +110,18 @@ static int end_frame(AVFilterLink *inlink)
return ret;
}
static const AVFilterPad avfilter_vf_split_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame,
.draw_slice = draw_slice,
.end_frame = end_frame,
},
{ NULL }
};
AVFilter avfilter_vf_split = {
.name = "split",
.description = NULL_IF_CONFIG_SMALL("Pass on the input to two outputs."),
......@@ -117,13 +129,7 @@ AVFilter avfilter_vf_split = {
.init = split_init,
.uninit = split_uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= ff_null_get_video_buffer,
.start_frame = start_frame,
.draw_slice = draw_slice,
.end_frame = end_frame, },
{ .name = NULL}},
.inputs = avfilter_vf_split_inputs,
.outputs = NULL,
};
......@@ -148,6 +154,16 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
return ret;
}
static const AVFilterPad avfilter_af_asplit_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer,
.filter_samples = filter_samples
},
{ NULL }
};
AVFilter avfilter_af_asplit = {
.name = "asplit",
.description = NULL_IF_CONFIG_SMALL("Pass on the audio input to N audio outputs."),
......@@ -155,10 +171,6 @@ AVFilter avfilter_af_asplit = {
.init = split_init,
.uninit = split_uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer,
.filter_samples = filter_samples },
{ .name = NULL }},
.inputs = avfilter_af_asplit_inputs,
.outputs = NULL,
};
......@@ -93,6 +93,26 @@ static int setdar_config_props(AVFilterLink *inlink)
return 0;
}
static const AVFilterPad avfilter_vf_setdar_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = setdar_config_props,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame,
.end_frame = ff_null_end_frame
},
{ NULL }
};
static const AVFilterPad avfilter_vf_setdar_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
},
{ NULL }
};
AVFilter avfilter_vf_setdar = {
.name = "setdar",
.description = NULL_IF_CONFIG_SMALL("Set the frame display aspect ratio."),
......@@ -101,17 +121,9 @@ AVFilter avfilter_vf_setdar = {
.priv_size = sizeof(AspectContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = setdar_config_props,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame,
.end_frame = ff_null_end_frame },
{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}},
.inputs = avfilter_vf_setdar_inputs,
.outputs = avfilter_vf_setdar_outputs,
};
#endif /* CONFIG_SETDAR_FILTER */
......@@ -126,6 +138,26 @@ static int setsar_config_props(AVFilterLink *inlink)
return 0;
}
static const AVFilterPad avfilter_vf_setsar_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = setsar_config_props,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame,
.end_frame = ff_null_end_frame
},
{ NULL }
};
static const AVFilterPad avfilter_vf_setsar_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
},
{ NULL }
};
AVFilter avfilter_vf_setsar = {
.name = "setsar",
.description = NULL_IF_CONFIG_SMALL("Set the pixel sample aspect ratio."),
......@@ -134,16 +166,8 @@ AVFilter avfilter_vf_setsar = {
.priv_size = sizeof(AspectContext),
.inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = setsar_config_props,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame,
.end_frame = ff_null_end_frame },
{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}},
.inputs = avfilter_vf_setsar_inputs,
.outputs = avfilter_vf_setsar_outputs,
};
#endif /* CONFIG_SETSAR_FILTER */
......@@ -113,6 +113,26 @@ static int end_frame(AVFilterLink *inlink)
return ff_end_frame(inlink->dst->outputs[0]);
}
static const AVFilterPad avfilter_vf_blackframe_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.draw_slice = draw_slice,
.get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame,
.end_frame = end_frame,
},
{ NULL }
};
static const AVFilterPad avfilter_vf_blackframe_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO
},
{ NULL }
};