From 35a35d49d23c2b799e771f8947c0bc6cc6a45fe8 Mon Sep 17 00:00:00 2001 From: Mashiat Sarker Shakkhar Date: Tue, 9 Oct 2012 19:38:19 +0000 Subject: [PATCH 1/9] Double motion vector range for HPEL interlaced picture in proper place The existing code is not in the right place and it should cover both interlaced frame and field pictures. Signed-off-by: Derek Buitenhuis --- libavcodec/vc1.c | 5 +++++ libavcodec/vc1dec.c | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index b04d570602..c7edc25a25 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1223,6 +1223,11 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) break; } + if (v->fcm != PROGRESSIVE && !v->s.quarter_sample) { + v->range_x <<= 1; + v->range_y <<= 1; + } + /* AC Syntax */ v->c_ac_table_index = decode012(gb); if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI) { diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 40164cc9db..6bfba682d1 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1573,10 +1573,6 @@ static inline void vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, } } - if (v->field_mode && !s->quarter_sample) { - r_x <<= 1; - r_y <<= 1; - } if (v->field_mode && v->numref) r_y >>= 1; if (v->field_mode && v->cur_field_type && v->ref_field_type[dir] == 0) From bd141f5ec97f394d1043a2f9778d74ba1008db26 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 9 Oct 2012 21:45:23 +0200 Subject: [PATCH 2/9] mxfdec: return error if no segments are available in mxf_get_sorted_table_segments Fixes CID732275. --- libavformat/mxfdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 9a61d0243e..25d18f4829 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -950,6 +950,9 @@ static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment if (mxf->metadata_sets[i]->type == IndexTableSegment) nb_segments++; + if (!nb_segments) + return AVERROR_INVALIDDATA; + *sorted_segments = av_mallocz(nb_segments * sizeof(**sorted_segments)); unsorted_segments = av_mallocz(nb_segments * sizeof(*unsorted_segments)); if (!sorted_segments || !unsorted_segments) { From 6d556e8327f6275c807c6da7257f617c256fe759 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 10 Oct 2012 19:16:09 +0200 Subject: [PATCH 3/9] indeo4/5: remove constant parameter num_bands from wavelet recomposition Fixes bogus uninitialized value compiler and coverity warnings. --- libavcodec/ivi_common.c | 4 ++-- libavcodec/ivi_dsp.c | 5 +++-- libavcodec/ivi_dsp.h | 6 ++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index d1a86c4b65..d48014c39a 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -808,9 +808,9 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, if (ctx->is_scalable) { if (avctx->codec_id == AV_CODEC_ID_INDEO4) - ff_ivi_recompose_haar(&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0], 4); + ff_ivi_recompose_haar(&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0]); else - ff_ivi_recompose53 (&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0], 4); + ff_ivi_recompose53 (&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0]); } else { ff_ivi_output_plane(&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0]); } diff --git a/libavcodec/ivi_dsp.c b/libavcodec/ivi_dsp.c index caad843c8b..3ffe84ab9e 100644 --- a/libavcodec/ivi_dsp.c +++ b/libavcodec/ivi_dsp.c @@ -33,7 +33,7 @@ #include "ivi_dsp.h" void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, - const int dst_pitch, const int num_bands) + const int dst_pitch) { int x, y, indx; int32_t p0, p1, p2, p3, tmp0, tmp1, tmp2; @@ -41,6 +41,7 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, int32_t b3_1, b3_2, b3_3, b3_4, b3_5, b3_6, b3_7, b3_8, b3_9; int32_t pitch, back_pitch; const IDWTELEM *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr; + const int num_bands = 4; /* all bands should have the same pitch */ pitch = plane->bands[0].pitch; @@ -179,7 +180,7 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, } void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, - const int dst_pitch, const int num_bands) + const int dst_pitch) { int x, y, indx, b0, b1, b2, b3, p0, p1, p2, p3; const IDWTELEM *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr; diff --git a/libavcodec/ivi_dsp.h b/libavcodec/ivi_dsp.h index 04385140f3..c46f8b2d8d 100644 --- a/libavcodec/ivi_dsp.h +++ b/libavcodec/ivi_dsp.h @@ -38,10 +38,9 @@ * @param[in] plane pointer to the descriptor of the plane being processed * @param[out] dst pointer to the destination buffer * @param[in] dst_pitch pitch of the destination buffer - * @param[in] num_bands number of wavelet bands to be processed */ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, - const int dst_pitch, const int num_bands); + const int dst_pitch); /** * Haar wavelet recomposition filter for Indeo 4 @@ -49,10 +48,9 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, * @param[in] plane pointer to the descriptor of the plane being processed * @param[out] dst pointer to the destination buffer * @param[in] dst_pitch pitch of the destination buffer - * @param[in] num_bands number of wavelet bands to be processed */ void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, - const int dst_pitch, const int num_bands); + const int dst_pitch); /** * two-dimensional inverse Haar 8x8 transform for Indeo 4 From c466eb174699bd912b9cf601e5b1a5da87e83a33 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 10 Oct 2012 19:47:05 +0200 Subject: [PATCH 4/9] flashsv: propagate inflateReset() errors Fixes CID717493. --- libavcodec/flashsv.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 1f21c8bd29..6052ecdf82 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -121,10 +121,11 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx) } -static void flashsv2_prime(FlashSVContext *s, uint8_t *src, - int size, int unp_size) +static int flashsv2_prime(FlashSVContext *s, uint8_t *src, + int size, int unp_size) { z_stream zs; + int zret; // Zlib return code zs.zalloc = NULL; zs.zfree = NULL; @@ -144,13 +145,18 @@ static void flashsv2_prime(FlashSVContext *s, uint8_t *src, deflate(&zs, Z_SYNC_FLUSH); deflateEnd(&zs); - inflateReset(&s->zstream); + if ((zret = inflateReset(&s->zstream)) != Z_OK) { + av_log(s->avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); + return AVERROR_UNKNOWN; + } s->zstream.next_in = s->deflate_block; s->zstream.avail_in = s->deflate_block_size - zs.avail_out; s->zstream.next_out = s->tmpblock; s->zstream.avail_out = s->block_size * 3; inflate(&s->zstream, Z_SYNC_FLUSH); + + return 0; } static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt, @@ -163,11 +169,14 @@ static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt, int k; int ret = inflateReset(&s->zstream); if (ret != Z_OK) { - //return -1; + av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", ret); + return AVERROR_UNKNOWN; } if (s->zlibprime_curr || s->zlibprime_prev) { - flashsv2_prime(s, s->blocks[blk_idx].pos, s->blocks[blk_idx].size, + ret = flashsv2_prime(s, s->blocks[blk_idx].pos, s->blocks[blk_idx].size, s->blocks[blk_idx].unp_size); + if (ret < 0) + return ret; } s->zstream.next_in = avpkt->data + get_bits_count(gb) / 8; s->zstream.avail_in = block_size; From 25227c3a78fefd74bc6ea34032cd49ec8c8d9d85 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 10 Oct 2012 20:11:56 +0200 Subject: [PATCH 5/9] averror: explicitly define AVERROR_* values --- libavutil/error.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libavutil/error.h b/libavutil/error.h index 8ac355cc41..38f9824a5b 100644 --- a/libavutil/error.h +++ b/libavutil/error.h @@ -45,21 +45,21 @@ #define AVUNERROR(e) (e) #endif -#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found -#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found -#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found -#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found -#define AVERROR_EOF (-MKTAG( 'E','O','F',' ')) ///< End of file -#define AVERROR_EXIT (-MKTAG( 'E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted -#define AVERROR_FILTER_NOT_FOUND (-MKTAG(0xF8,'F','I','L')) ///< Filter not found -#define AVERROR_INVALIDDATA (-MKTAG( 'I','N','D','A')) ///< Invalid data found when processing input -#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found -#define AVERROR_OPTION_NOT_FOUND (-MKTAG(0xF8,'O','P','T')) ///< Option not found -#define AVERROR_PATCHWELCOME (-MKTAG( 'P','A','W','E')) ///< Not yet implemented in Libav, patches welcome -#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found -#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found -#define AVERROR_BUG (-MKTAG( 'B','U','G',' ')) ///< Bug detected, please report the issue -#define AVERROR_UNKNOWN (-MKTAG( 'U','N','K','N')) ///< Unknown error, typically from an external library +#define AVERROR_BSF_NOT_FOUND 0xb9acbd08 ///< Bitstream filter not found +#define AVERROR_DECODER_NOT_FOUND 0xbcbabb08 ///< Decoder not found +#define AVERROR_DEMUXER_NOT_FOUND 0xb2babb08 ///< Demuxer not found +#define AVERROR_ENCODER_NOT_FOUND 0xbcb1ba08 ///< Encoder not found +#define AVERROR_EOF 0xdfb9b0bb ///< End of file +#define AVERROR_EXIT 0xabb6a7bb ///< Immediate exit was requested; the called function should not be restarted +#define AVERROR_FILTER_NOT_FOUND 0xb3b6b908 ///< Filter not found +#define AVERROR_INVALIDDATA 0xbebbb1b7 ///< Invalid data found when processing input +#define AVERROR_MUXER_NOT_FOUND 0xa7aab208 ///< Muxer not found +#define AVERROR_OPTION_NOT_FOUND 0xabafb008 ///< Option not found +#define AVERROR_PATCHWELCOME 0xbaa8beb0 ///< Not yet implemented in Libav, patches welcome +#define AVERROR_PROTOCOL_NOT_FOUND 0xb0adaf08 ///< Protocol not found +#define AVERROR_STREAM_NOT_FOUND 0xadabac08 ///< Stream not found +#define AVERROR_BUG 0xdfb8aabe ///< Bug detected, please report the issue +#define AVERROR_UNKNOWN 0xb1b4b1ab ///< Unknown error, typically from an external library /** * Put a description of the AVERROR code errnum in errbuf. From 8d09d39a4b87280ca728d65c4e1cd03d7360cc2b Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 10 Oct 2012 20:35:26 +0200 Subject: [PATCH 6/9] avconv: remove bogus warning when using avconv -h without parameter --- avconv_opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avconv_opt.c b/avconv_opt.c index 9f30134055..fd3d5735fe 100644 --- a/avconv_opt.c +++ b/avconv_opt.c @@ -1792,7 +1792,7 @@ void show_help_default(const char *opt, const char *arg) const int per_file = OPT_SPEC | OPT_OFFSET | OPT_PERFILE; int show_advanced = 0, show_avoptions = 0; - if (opt) { + if (opt && *opt) { if (!strcmp(opt, "long")) show_advanced = 1; else if (!strcmp(opt, "full")) From b404c6605627dbbc07d680803e1a3f70cb4704a0 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 10 Oct 2012 14:22:57 +0200 Subject: [PATCH 7/9] fate: add h263 obmc vsynth tests --- tests/fate/vcodec.mak | 3 +++ tests/ref/fate/vsynth1-h263-obmc | 4 ++++ tests/ref/fate/vsynth2-h263-obmc | 4 ++++ 3 files changed, 11 insertions(+) create mode 100644 tests/ref/fate/vsynth1-h263-obmc create mode 100644 tests/ref/fate/vsynth2-h263-obmc diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak index e9a9ad622e..23dbc988bd 100644 --- a/tests/fate/vcodec.mak +++ b/tests/fate/vcodec.mak @@ -72,6 +72,9 @@ fate-vsynth%-h261: ENCOPTS = -qscale 11 FATE_VCODEC += h263 fate-vsynth%-h263: ENCOPTS = -qscale 10 +FATE_VCODEC += h263-obmc +fate-vsynth%-h263-obmc: ENCOPTS = -qscale 10 -obmc 1 + FATE_VCODEC += h263p fate-vsynth%-h263p: ENCOPTS = -qscale 2 -flags +aic -umv 1 -aiv 1 -ps 300 diff --git a/tests/ref/fate/vsynth1-h263-obmc b/tests/ref/fate/vsynth1-h263-obmc new file mode 100644 index 0000000000..b7e8f493c5 --- /dev/null +++ b/tests/ref/fate/vsynth1-h263-obmc @@ -0,0 +1,4 @@ +8a7be9f9f97673bf8b926b6dcf8a710d *tests/data/fate/vsynth1-h263-obmc.avi +657366 tests/data/fate/vsynth1-h263-obmc.avi +eba1d733a0c4b71322a78f718f312599 *tests/data/fate/vsynth1-h263-obmc.out.rawvideo +stddev: 8.16 PSNR: 29.89 MAXDIFF: 113 bytes: 7603200/ 7603200 diff --git a/tests/ref/fate/vsynth2-h263-obmc b/tests/ref/fate/vsynth2-h263-obmc new file mode 100644 index 0000000000..32c234149e --- /dev/null +++ b/tests/ref/fate/vsynth2-h263-obmc @@ -0,0 +1,4 @@ +0c84ee18c2261070ffc91b5d606094ae *tests/data/fate/vsynth2-h263-obmc.avi +154728 tests/data/fate/vsynth2-h263-obmc.avi +6f326547cf1cbd95a8c0a5ddce9eb71a *tests/data/fate/vsynth2-h263-obmc.out.rawvideo +stddev: 5.39 PSNR: 33.49 MAXDIFF: 82 bytes: 7603200/ 7603200 From 568c70e79ee267426c15ef4603c69703f6a5884a Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 24 Jul 2012 14:14:01 +0100 Subject: [PATCH 8/9] 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: Mans Rullgard --- libavfilter/af_aformat.c | 24 +++++++++---- libavfilter/af_amix.c | 16 ++++++--- libavfilter/af_anull.c | 26 ++++++++++---- libavfilter/af_asyncts.c | 30 +++++++++++----- libavfilter/af_channelmap.c | 28 ++++++++++----- libavfilter/af_channelsplit.c | 14 +++++--- libavfilter/af_join.c | 16 ++++++--- libavfilter/af_resample.c | 32 +++++++++++------ libavfilter/asink_anullsink.c | 18 +++++----- libavfilter/asrc_anullsrc.c | 16 ++++++--- libavfilter/buffersink.c | 36 ++++++++++++------- libavfilter/buffersrc.c | 36 ++++++++++++------- libavfilter/fifo.c | 68 +++++++++++++++++++++++------------ libavfilter/split.c | 36 ++++++++++++------- libavfilter/vf_aspect.c | 64 ++++++++++++++++++++++----------- libavfilter/vf_blackframe.c | 32 +++++++++++------ libavfilter/vf_boxblur.c | 30 +++++++++++----- libavfilter/vf_copy.c | 32 +++++++++++------ libavfilter/vf_crop.c | 36 ++++++++++++------- libavfilter/vf_cropdetect.c | 32 +++++++++++------ libavfilter/vf_delogo.c | 36 ++++++++++++------- libavfilter/vf_drawbox.c | 38 +++++++++++++------- libavfilter/vf_drawtext.c | 40 +++++++++++++-------- libavfilter/vf_fade.c | 38 +++++++++++++------- libavfilter/vf_fieldorder.c | 38 +++++++++++++------- libavfilter/vf_format.c | 64 ++++++++++++++++++++++----------- libavfilter/vf_fps.c | 34 ++++++++++++------ libavfilter/vf_frei0r.c | 48 +++++++++++++++++-------- libavfilter/vf_gradfun.c | 34 ++++++++++++------ libavfilter/vf_hflip.c | 30 +++++++++++----- libavfilter/vf_hqdn3d.c | 32 +++++++++++------ libavfilter/vf_libopencv.c | 30 +++++++++++----- libavfilter/vf_null.c | 30 +++++++++++----- libavfilter/vf_overlay.c | 62 +++++++++++++++++++------------- libavfilter/vf_pad.c | 36 ++++++++++++------- libavfilter/vf_pixdesctest.c | 32 +++++++++++------ libavfilter/vf_scale.c | 32 +++++++++++------ libavfilter/vf_select.c | 38 +++++++++++++------- libavfilter/vf_setpts.c | 30 +++++++++++----- libavfilter/vf_settb.c | 32 +++++++++++------ libavfilter/vf_showinfo.c | 32 +++++++++++------ libavfilter/vf_slicify.c | 34 ++++++++++++------ libavfilter/vf_transpose.c | 32 +++++++++++------ libavfilter/vf_unsharp.c | 32 +++++++++++------ libavfilter/vf_vflip.c | 32 +++++++++++------ libavfilter/vf_yadif.c | 38 +++++++++++++------- libavfilter/vsink_nullsink.c | 20 ++++++----- libavfilter/vsrc_color.c | 16 ++++++--- libavfilter/vsrc_movie.c | 16 ++++++--- libavfilter/vsrc_nullsrc.c | 20 ++++++----- libavfilter/vsrc_testsrc.c | 32 +++++++++++------ 51 files changed, 1135 insertions(+), 545 deletions(-) diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c index 9e69fd0ad8..77c16be4a2 100644 --- a/libavfilter/af_aformat.c +++ b/libavfilter/af_aformat.c @@ -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, }; diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index a0b265fa34..dde9595ff4 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -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, }; diff --git a/libavfilter/af_anull.c b/libavfilter/af_anull.c index 7082adb7d9..a791064e07 100644 --- a/libavfilter/af_anull.c +++ b/libavfilter/af_anull.c @@ -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, }; diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c index c7eb86dd77..94c5452d12 100644 --- a/libavfilter/af_asyncts.c +++ b/libavfilter/af_asyncts.c @@ -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, }; diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 405a9c2c2f..8c49d10386 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -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, }; diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c index fc044d0f87..92fb27e092 100644 --- a/libavfilter/af_channelsplit.c +++ b/libavfilter/af_channelsplit.c @@ -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, }; diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c index 26f631de63..7e3a542392 100644 --- a/libavfilter/af_join.c +++ b/libavfilter/af_join.c @@ -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, }; diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c index c43d260610..a0c7e0e4a9 100644 --- a/libavfilter/af_resample.c +++ b/libavfilter/af_resample.c @@ -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, }; diff --git a/libavfilter/asink_anullsink.c b/libavfilter/asink_anullsink.c index 386323f1c0..b679ffa010 100644 --- a/libavfilter/asink_anullsink.c +++ b/libavfilter/asink_anullsink.c @@ -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, }; diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c index 62bd3de1e7..7096ceafbd 100644 --- a/libavfilter/asrc_anullsrc.c +++ b/libavfilter/asrc_anullsrc.c @@ -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, }; diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index ca732fc936..73af25dc36 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -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, }; diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index b33aa0aba9..2157ec8a1f 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -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, }; diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c index bf78bb6aef..b13be68015 100644 --- a/libavfilter/fifo.c +++ b/libavfilter/fifo.c @@ -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, }; diff --git a/libavfilter/split.c b/libavfilter/split.c index e5ff0e56dc..01bb4489f0 100644 --- a/libavfilter/split.c +++ b/libavfilter/split.c @@ -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, }; diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c index 04c854d1bd..9f0c0c00a6 100644 --- a/libavfilter/vf_aspect.c +++ b/libavfilter/vf_aspect.c @@ -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}}, + .inputs = avfilter_vf_setdar_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .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}}, + .inputs = avfilter_vf_setsar_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .outputs = avfilter_vf_setsar_outputs, }; #endif /* CONFIG_SETSAR_FILTER */ diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c index 4f5a883b46..9a27b6971f 100644 --- a/libavfilter/vf_blackframe.c +++ b/libavfilter/vf_blackframe.c @@ -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 } +}; + AVFilter avfilter_vf_blackframe = { .name = "blackframe", .description = NULL_IF_CONFIG_SMALL("Detect frames that are (almost) black."), @@ -122,15 +142,7 @@ AVFilter avfilter_vf_blackframe = { .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .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, }, - { .name = NULL}}, + .inputs = avfilter_vf_blackframe_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .outputs = avfilter_vf_blackframe_outputs, }; diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index 7f334715c3..b638c71465 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -334,6 +334,25 @@ static int draw_slice(AVFilterLink *inlink, int y0, int h0, int slice_dir) return ff_draw_slice(outlink, y0, h0, slice_dir); } +static const AVFilterPad avfilter_vf_boxblur_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .draw_slice = draw_slice, + .min_perms = AV_PERM_READ + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_boxblur_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_boxblur = { .name = "boxblur", .description = NULL_IF_CONFIG_SMALL("Blur the input."), @@ -342,13 +361,6 @@ AVFilter avfilter_vf_boxblur = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .draw_slice = draw_slice, - .min_perms = AV_PERM_READ }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_boxblur_inputs, + .outputs = avfilter_vf_boxblur_outputs, }; diff --git a/libavfilter/vf_copy.c b/libavfilter/vf_copy.c index 243702b6e5..a20da93b82 100644 --- a/libavfilter/vf_copy.c +++ b/libavfilter/vf_copy.c @@ -26,18 +26,30 @@ #include "internal.h" #include "video.h" +static const AVFilterPad avfilter_vf_copy_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .end_frame = ff_null_end_frame, + .rej_perms = ~0 + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_copy_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_copy = { .name = "copy", .description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .end_frame = ff_null_end_frame, - .rej_perms = ~0 }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_copy_inputs, + .outputs = avfilter_vf_copy_outputs, }; diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 839376744c..0270a13e2c 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -326,6 +326,28 @@ static int end_frame(AVFilterLink *link) return ff_end_frame(link->dst->outputs[0]); } +static const AVFilterPad avfilter_vf_crop_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + .get_video_buffer = ff_null_get_video_buffer, + .config_props = config_input, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_crop_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, + { NULL } +}; + AVFilter avfilter_vf_crop = { .name = "crop", .description = NULL_IF_CONFIG_SMALL("Crop the input video to width:height:x:y."), @@ -336,16 +358,6 @@ AVFilter avfilter_vf_crop = { .init = init, .uninit = uninit, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = start_frame, - .draw_slice = draw_slice, - .end_frame = end_frame, - .get_video_buffer = ff_null_get_video_buffer, - .config_props = config_input, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_output, }, - { .name = NULL}}, + .inputs = avfilter_vf_crop_inputs, + .outputs = avfilter_vf_crop_outputs, }; diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index 7f750078f2..c930e00bb3 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -197,6 +197,26 @@ static int end_frame(AVFilterLink *inlink) return ff_end_frame(inlink->dst->outputs[0]); } +static const AVFilterPad avfilter_vf_cropdetect_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .end_frame = end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_cropdetect_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO + }, + { NULL } +}; + AVFilter avfilter_vf_cropdetect = { .name = "cropdetect", .description = NULL_IF_CONFIG_SMALL("Auto-detect crop size."), @@ -206,15 +226,7 @@ AVFilter avfilter_vf_cropdetect = { .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .end_frame = end_frame, }, - { .name = NULL}}, + .inputs = avfilter_vf_cropdetect_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .outputs = avfilter_vf_cropdetect_outputs, }; diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c index c273899d76..d2ff4bf14b 100644 --- a/libavfilter/vf_delogo.c +++ b/libavfilter/vf_delogo.c @@ -251,6 +251,28 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_delogo_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_inplace_start_frame, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_WRITE | AV_PERM_READ, + .rej_perms = AV_PERM_PRESERVE + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_delogo_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_delogo = { .name = "delogo", .description = NULL_IF_CONFIG_SMALL("Remove logo from input video."), @@ -258,16 +280,6 @@ AVFilter avfilter_vf_delogo = { .init = init, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_inplace_start_frame, - .draw_slice = null_draw_slice, - .end_frame = end_frame, - .min_perms = AV_PERM_WRITE | AV_PERM_READ, - .rej_perms = AV_PERM_PRESERVE }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_delogo_inputs, + .outputs = avfilter_vf_delogo_outputs, }; diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index 2cc8850dfd..39dd2e597d 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -124,6 +124,29 @@ static int draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) return ff_draw_slice(inlink->dst->outputs[0], y0, h, 1); } +static const AVFilterPad avfilter_vf_drawbox_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .draw_slice = draw_slice, + .end_frame = ff_null_end_frame, + .min_perms = AV_PERM_WRITE | AV_PERM_READ, + .rej_perms = AV_PERM_PRESERVE + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_drawbox_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_drawbox = { .name = "drawbox", .description = NULL_IF_CONFIG_SMALL("Draw a colored box on the input video."), @@ -131,17 +154,6 @@ AVFilter avfilter_vf_drawbox = { .init = init, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .draw_slice = draw_slice, - .end_frame = ff_null_end_frame, - .min_perms = AV_PERM_WRITE | AV_PERM_READ, - .rej_perms = AV_PERM_PRESERVE }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_drawbox_inputs, + .outputs = avfilter_vf_drawbox_outputs, }; diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index c08cd6fb24..10a7e66acd 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -879,6 +879,30 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_drawtext_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = start_frame, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + .config_props = config_input, + .min_perms = AV_PERM_WRITE | + AV_PERM_READ, + .rej_perms = AV_PERM_PRESERVE + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_drawtext_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_drawtext = { .name = "drawtext", .description = NULL_IF_CONFIG_SMALL("Draw text on top of video frames using libfreetype library."), @@ -887,18 +911,6 @@ AVFilter avfilter_vf_drawtext = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = start_frame, - .draw_slice = null_draw_slice, - .end_frame = end_frame, - .config_props = config_input, - .min_perms = AV_PERM_WRITE | - AV_PERM_READ, - .rej_perms = AV_PERM_PRESERVE }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_drawtext_inputs, + .outputs = avfilter_vf_drawtext_outputs, }; diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index 92ea8f6d80..5fe489778e 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -154,6 +154,29 @@ static int end_frame(AVFilterLink *inlink) return ret; } +static const AVFilterPad avfilter_vf_fade_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_props, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ | AV_PERM_WRITE, + .rej_perms = AV_PERM_PRESERVE, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_fade_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_fade = { .name = "fade", .description = NULL_IF_CONFIG_SMALL("Fade in/out input video"), @@ -161,17 +184,6 @@ AVFilter avfilter_vf_fade = { .priv_size = sizeof(FadeContext), .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_props, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .draw_slice = draw_slice, - .end_frame = end_frame, - .min_perms = AV_PERM_READ | AV_PERM_WRITE, - .rej_perms = AV_PERM_PRESERVE, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_fade_inputs, + .outputs = avfilter_vf_fade_outputs, }; diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c index cf174ded1d..d6875de99f 100644 --- a/libavfilter/vf_fieldorder.c +++ b/libavfilter/vf_fieldorder.c @@ -234,23 +234,35 @@ static int end_frame(AVFilterLink *inlink) return ff_end_frame(outlink); } +static const AVFilterPad avfilter_vf_fieldorder_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .start_frame = start_frame, + .get_video_buffer = get_video_buffer, + .draw_slice = draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, + .rej_perms = AV_PERM_REUSE2 | AV_PERM_PRESERVE, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_fieldorder_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_fieldorder = { .name = "fieldorder", .description = NULL_IF_CONFIG_SMALL("Set the field order."), .init = init, .priv_size = sizeof(FieldOrderContext), .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .start_frame = start_frame, - .get_video_buffer = get_video_buffer, - .draw_slice = draw_slice, - .end_frame = end_frame, - .min_perms = AV_PERM_READ, - .rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE,}, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_fieldorder_inputs, + .outputs = avfilter_vf_fieldorder_outputs, }; diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index 23dda0c23c..72d6348e17 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -99,6 +99,26 @@ static int query_formats_format(AVFilterContext *ctx) return 0; } +static const AVFilterPad avfilter_vf_format_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .draw_slice = ff_null_draw_slice, + .end_frame = ff_null_end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_format_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO + }, + { NULL } +}; + AVFilter avfilter_vf_format = { .name = "format", .description = NULL_IF_CONFIG_SMALL("Convert the input video to one of the specified pixel formats."), @@ -109,16 +129,8 @@ AVFilter avfilter_vf_format = { .priv_size = sizeof(FormatContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer= ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .draw_slice = ff_null_draw_slice, - .end_frame = ff_null_end_frame, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .inputs = avfilter_vf_format_inputs, + .outputs = avfilter_vf_format_outputs, }; #endif /* CONFIG_FORMAT_FILTER */ @@ -129,6 +141,26 @@ static int query_formats_noformat(AVFilterContext *ctx) return 0; } +static const AVFilterPad avfilter_vf_noformat_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .draw_slice = ff_null_draw_slice, + .end_frame = ff_null_end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_noformat_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO + }, + { NULL } +}; + AVFilter avfilter_vf_noformat = { .name = "noformat", .description = NULL_IF_CONFIG_SMALL("Force libavfilter not to use any of the specified pixel formats for the input to the next filter."), @@ -139,15 +171,7 @@ AVFilter avfilter_vf_noformat = { .priv_size = sizeof(FormatContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer= ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .draw_slice = ff_null_draw_slice, - .end_frame = ff_null_end_frame, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .inputs = avfilter_vf_noformat_inputs, + .outputs = avfilter_vf_noformat_outputs, }; #endif /* CONFIG_NOFORMAT_FILTER */ diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index 73058009a5..45b8225d7f 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -278,6 +278,27 @@ static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) return 0; } +static const AVFilterPad avfilter_vf_fps_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = null_start_frame, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_fps_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, + .config_props = config_props + }, + { NULL } +}; + AVFilter avfilter_vf_fps = { .name = "fps", .description = NULL_IF_CONFIG_SMALL("Force constant framerate"), @@ -287,15 +308,6 @@ AVFilter avfilter_vf_fps = { .priv_size = sizeof(FPSContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = null_start_frame, - .draw_slice = null_draw_slice, - .end_frame = end_frame, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = request_frame, - .config_props = config_props}, - { .name = NULL}}, + .inputs = avfilter_vf_fps_inputs, + .outputs = avfilter_vf_fps_outputs, }; diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index 45c7cf1340..471e6fc3ad 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -368,6 +368,26 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_frei0r_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = null_draw_slice, + .config_props = config_input_props, + .end_frame = end_frame, + .min_perms = AV_PERM_READ + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_frei0r_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_frei0r = { .name = "frei0r", .description = NULL_IF_CONFIG_SMALL("Apply a frei0r effect."), @@ -378,17 +398,9 @@ AVFilter avfilter_vf_frei0r = { .priv_size = sizeof(Frei0rContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .draw_slice = null_draw_slice, - .config_props = config_input_props, - .end_frame = end_frame, - .min_perms = AV_PERM_READ }, - { .name = NULL}}, + .inputs = avfilter_vf_frei0r_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .outputs = avfilter_vf_frei0r_outputs, }; static av_cold int source_init(AVFilterContext *ctx, const char *args) @@ -478,6 +490,16 @@ fail: return ret; } +static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = source_request_frame, + .config_props = source_config_props + }, + { NULL } +}; + AVFilter avfilter_vsrc_frei0r_src = { .name = "frei0r_src", .description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."), @@ -490,9 +512,5 @@ AVFilter avfilter_vsrc_frei0r_src = { .inputs = NULL, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = source_request_frame, - .config_props = source_config_props }, - { .name = NULL}}, + .outputs = avfilter_vsrc_frei0r_src_outputs, }; diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 78568fb62f..31ed639542 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -216,6 +216,27 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_gradfun_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .start_frame = ff_inplace_start_frame, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_gradfun_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_gradfun = { .name = "gradfun", .description = NULL_IF_CONFIG_SMALL("Debands video quickly using gradients."), @@ -224,15 +245,6 @@ AVFilter avfilter_vf_gradfun = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .start_frame = ff_inplace_start_frame, - .draw_slice = null_draw_slice, - .end_frame = end_frame, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_gradfun_inputs, + .outputs = avfilter_vf_gradfun_outputs, }; diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c index 0937d484a8..ea1db4fe29 100644 --- a/libavfilter/vf_hflip.c +++ b/libavfilter/vf_hflip.c @@ -148,19 +148,31 @@ static int draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) return ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir); } +static const AVFilterPad avfilter_vf_hflip_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = draw_slice, + .config_props = config_props, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_hflip_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_hflip = { .name = "hflip", .description = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."), .priv_size = sizeof(FlipContext), .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .draw_slice = draw_slice, - .config_props = config_props, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_hflip_inputs, + .outputs = avfilter_vf_hflip_outputs, }; diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c index e349a4b51c..03e1d830bd 100644 --- a/libavfilter/vf_hqdn3d.c +++ b/libavfilter/vf_hqdn3d.c @@ -349,6 +349,26 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_hqdn3d_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = ff_inplace_start_frame, + .draw_slice = null_draw_slice, + .config_props = config_input, + .end_frame = end_frame + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_hqdn3d_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO + }, + { NULL } +}; + AVFilter avfilter_vf_hqdn3d = { .name = "hqdn3d", .description = NULL_IF_CONFIG_SMALL("Apply a High Quality 3D Denoiser."), @@ -358,15 +378,7 @@ AVFilter avfilter_vf_hqdn3d = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = ff_inplace_start_frame, - .draw_slice = null_draw_slice, - .config_props = config_input, - .end_frame = end_frame }, - { .name = NULL}}, + .inputs = avfilter_vf_hqdn3d_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .outputs = avfilter_vf_hqdn3d_outputs, }; diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index 8e3a937274..3e802cde26 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -376,6 +376,25 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_ocv_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_ocv_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_ocv = { .name = "ocv", .description = NULL_IF_CONFIG_SMALL("Apply transform using libopencv."), @@ -386,14 +405,7 @@ AVFilter avfilter_vf_ocv = { .init = init, .uninit = uninit, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .draw_slice = null_draw_slice, - .end_frame = end_frame, - .min_perms = AV_PERM_READ }, - { .name = NULL}}, + .inputs = avfilter_vf_ocv_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .outputs = avfilter_vf_ocv_outputs, }; diff --git a/libavfilter/vf_null.c b/libavfilter/vf_null.c index 9f2e15addb..87e4820aa7 100644 --- a/libavfilter/vf_null.c +++ b/libavfilter/vf_null.c @@ -26,20 +26,32 @@ #include "internal.h" #include "video.h" +static const AVFilterPad avfilter_vf_null_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .end_frame = ff_null_end_frame + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_null_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_null = { .name = "null", .description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."), .priv_size = 0, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .end_frame = ff_null_end_frame }, - { .name = NULL}}, + .inputs = avfilter_vf_null_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .outputs = avfilter_vf_null_outputs, }; diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index f0b58427a7..e8ff834dbb 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -374,6 +374,42 @@ static int request_frame(AVFilterLink *outlink) return output_frame(ctx); } +static const AVFilterPad avfilter_vf_overlay_inputs[] = { + { + .name = "main", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = null_start_frame, + .config_props = config_input_main, + .draw_slice = null_draw_slice, + .end_frame = end_frame_main, + .min_perms = AV_PERM_READ, + .rej_perms = AV_PERM_REUSE2 | AV_PERM_PRESERVE, + .needs_fifo = 1, + }, + { + .name = "overlay", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = null_start_frame, + .config_props = config_input_overlay, + .draw_slice = null_draw_slice, + .end_frame = end_frame_overlay, + .min_perms = AV_PERM_READ, + .rej_perms = AV_PERM_REUSE2, + .needs_fifo = 1, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_overlay_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + .request_frame = request_frame, + }, + { NULL } +}; + AVFilter avfilter_vf_overlay = { .name = "overlay", .description = NULL_IF_CONFIG_SMALL("Overlay a video source on top of the input."), @@ -385,28 +421,6 @@ AVFilter avfilter_vf_overlay = { .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "main", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = null_start_frame, - .config_props = config_input_main, - .draw_slice = null_draw_slice, - .end_frame = end_frame_main, - .min_perms = AV_PERM_READ, - .rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE, - .needs_fifo = 1, }, - { .name = "overlay", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = null_start_frame, - .config_props = config_input_overlay, - .draw_slice = null_draw_slice, - .end_frame = end_frame_overlay, - .min_perms = AV_PERM_READ, - .rej_perms = AV_PERM_REUSE2, - .needs_fifo = 1, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_output, - .request_frame = request_frame, }, - { .name = NULL}}, + .inputs = avfilter_vf_overlay_inputs, + .outputs = avfilter_vf_overlay_outputs, }; diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index a852b0db5c..1ab6ed57f3 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -434,6 +434,28 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) return draw_send_bar_slice(link, y, h, slice_dir, -1); } +static const AVFilterPad avfilter_vf_pad_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_pad_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, + { NULL } +}; + AVFilter avfilter_vf_pad = { .name = "pad", .description = NULL_IF_CONFIG_SMALL("Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black)."), @@ -443,17 +465,7 @@ AVFilter avfilter_vf_pad = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .get_video_buffer = get_video_buffer, - .start_frame = start_frame, - .draw_slice = draw_slice, - .end_frame = end_frame, }, - { .name = NULL}}, + .inputs = avfilter_vf_pad_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_output, }, - { .name = NULL}}, + .outputs = avfilter_vf_pad_outputs, }; diff --git a/libavfilter/vf_pixdesctest.c b/libavfilter/vf_pixdesctest.c index cf08977b1f..e3b4cfa6bf 100644 --- a/libavfilter/vf_pixdesctest.c +++ b/libavfilter/vf_pixdesctest.c @@ -126,6 +126,26 @@ static int draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) return ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir); } +static const AVFilterPad avfilter_vf_pixdesctest_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .draw_slice = draw_slice, + .config_props = config_props, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_pixdesctest_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_pixdesctest = { .name = "pixdesctest", .description = NULL_IF_CONFIG_SMALL("Test pixel format definitions."), @@ -133,15 +153,7 @@ AVFilter avfilter_vf_pixdesctest = { .priv_size = sizeof(PixdescTestContext), .uninit = uninit, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = start_frame, - .draw_slice = draw_slice, - .config_props = config_props, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, + .inputs = avfilter_vf_pixdesctest_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .outputs = avfilter_vf_pixdesctest_outputs, }; diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 568a42bced..5425bbd9bc 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -336,6 +336,26 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) return ret; } +static const AVFilterPad avfilter_vf_scale_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .draw_slice = draw_slice, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_scale_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_props, + }, + { NULL } +}; + AVFilter avfilter_vf_scale = { .name = "scale", .description = NULL_IF_CONFIG_SMALL("Scale the input video to width:height size and/or convert the image format."), @@ -347,14 +367,6 @@ AVFilter avfilter_vf_scale = { .priv_size = sizeof(ScaleContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = start_frame, - .draw_slice = draw_slice, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_props, }, - { .name = NULL}}, + .inputs = avfilter_vf_scale_inputs, + .outputs = avfilter_vf_scale_outputs, }; diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c index dabd3d173d..25c6a146e9 100644 --- a/libavfilter/vf_select.c +++ b/libavfilter/vf_select.c @@ -340,6 +340,29 @@ static av_cold void uninit(AVFilterContext *ctx) select->pending_frames = NULL; } +static const AVFilterPad avfilter_vf_select_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .config_props = config_input, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_select_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .poll_frame = poll_frame, + .request_frame = request_frame, + }, + { NULL } +}; + AVFilter avfilter_vf_select = { .name = "select", .description = NULL_IF_CONFIG_SMALL("Select frames to pass in output."), @@ -348,17 +371,6 @@ AVFilter avfilter_vf_select = { .priv_size = sizeof(SelectContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .config_props = config_input, - .start_frame = start_frame, - .draw_slice = draw_slice, - .end_frame = end_frame }, - { .name = NULL }}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .poll_frame = poll_frame, - .request_frame = request_frame, }, - { .name = NULL}}, + .inputs = avfilter_vf_select_inputs, + .outputs = avfilter_vf_select_outputs, }; diff --git a/libavfilter/vf_setpts.c b/libavfilter/vf_setpts.c index e347716dff..f2b86a16af 100644 --- a/libavfilter/vf_setpts.c +++ b/libavfilter/vf_setpts.c @@ -144,6 +144,25 @@ static av_cold void uninit(AVFilterContext *ctx) setpts->expr = NULL; } +static const AVFilterPad avfilter_vf_setpts_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .config_props = config_input, + .start_frame = start_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_setpts_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_setpts = { .name = "setpts", .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."), @@ -152,13 +171,6 @@ AVFilter avfilter_vf_setpts = { .priv_size = sizeof(SetPTSContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .config_props = config_input, - .start_frame = start_frame, }, - { .name = NULL }}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_setpts_inputs, + .outputs = avfilter_vf_setpts_outputs, }; diff --git a/libavfilter/vf_settb.c b/libavfilter/vf_settb.c index 24c2a637ab..0b68b342a2 100644 --- a/libavfilter/vf_settb.c +++ b/libavfilter/vf_settb.c @@ -125,6 +125,26 @@ static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) return ff_start_frame(outlink, picref); } +static const AVFilterPad avfilter_vf_settb_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = start_frame, + .end_frame = ff_null_end_frame + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_settb_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output_props, + }, + { NULL } +}; + AVFilter avfilter_vf_settb = { .name = "settb", .description = NULL_IF_CONFIG_SMALL("Set timebase for the output link."), @@ -132,15 +152,7 @@ AVFilter avfilter_vf_settb = { .priv_size = sizeof(SetTBContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = start_frame, - .end_frame = ff_null_end_frame }, - { .name = NULL }}, + .inputs = avfilter_vf_settb_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_output_props, }, - { .name = NULL}}, + .outputs = avfilter_vf_settb_outputs, }; diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index b53ccd10db..c931cb3665 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -80,6 +80,26 @@ static int end_frame(AVFilterLink *inlink) return ff_end_frame(inlink->dst->outputs[0]); } +static const AVFilterPad avfilter_vf_showinfo_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_showinfo_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO + }, + { NULL } +}; + AVFilter avfilter_vf_showinfo = { .name = "showinfo", .description = NULL_IF_CONFIG_SMALL("Show textual information for each video frame."), @@ -87,15 +107,7 @@ AVFilter avfilter_vf_showinfo = { .priv_size = sizeof(ShowInfoContext), .init = init, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .end_frame = end_frame, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, + .inputs = avfilter_vf_showinfo_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .outputs = avfilter_vf_showinfo_outputs, }; diff --git a/libavfilter/vf_slicify.c b/libavfilter/vf_slicify.c index e0e2718ebd..f7db66848a 100644 --- a/libavfilter/vf_slicify.c +++ b/libavfilter/vf_slicify.c @@ -106,6 +106,27 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) return 0; } +static const AVFilterPad avfilter_vf_slicify_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .config_props = config_props, + .end_frame = ff_null_end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_slicify_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_slicify = { .name = "slicify", .description = NULL_IF_CONFIG_SMALL("Pass the images of input video on to next video filter as multiple slices."), @@ -114,15 +135,6 @@ AVFilter avfilter_vf_slicify = { .priv_size = sizeof(SliceContext), - .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, - .config_props = config_props, - .end_frame = ff_null_end_frame, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_slicify_inputs, + .outputs = avfilter_vf_slicify_outputs, }; diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c index a8ef440b36..2d25f69f2b 100644 --- a/libavfilter/vf_transpose.c +++ b/libavfilter/vf_transpose.c @@ -208,6 +208,26 @@ static int end_frame(AVFilterLink *inlink) return 0; } +static const AVFilterPad avfilter_vf_transpose_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_transpose_outputs[] = { + { + .name = "default", + .config_props = config_props_output, + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_transpose = { .name = "transpose", .description = NULL_IF_CONFIG_SMALL("Transpose input video."), @@ -217,14 +237,6 @@ AVFilter avfilter_vf_transpose = { .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = start_frame, - .end_frame = end_frame, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .config_props = config_props_output, - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_transpose_inputs, + .outputs = avfilter_vf_transpose_outputs, }; diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 7db76d43d8..21eeaefb00 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -237,6 +237,26 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) return 0; } +static const AVFilterPad avfilter_vf_unsharp_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = draw_slice, + .end_frame = end_frame, + .config_props = config_props, + .min_perms = AV_PERM_READ, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_unsharp_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_unsharp = { .name = "unsharp", .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."), @@ -247,15 +267,7 @@ AVFilter avfilter_vf_unsharp = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .draw_slice = draw_slice, - .end_frame = end_frame, - .config_props = config_props, - .min_perms = AV_PERM_READ, }, - { .name = NULL}}, + .inputs = avfilter_vf_unsharp_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .outputs = avfilter_vf_unsharp_outputs, }; diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c index 742fe6a38c..04791036e0 100644 --- a/libavfilter/vf_vflip.c +++ b/libavfilter/vf_vflip.c @@ -96,20 +96,32 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) return ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir); } +static const AVFilterPad avfilter_vf_vflip_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .config_props = config_input, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_vflip_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + }, + { NULL } +}; + AVFilter avfilter_vf_vflip = { .name = "vflip", .description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."), .priv_size = sizeof(FlipContext), - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer = get_video_buffer, - .start_frame = start_frame, - .draw_slice = draw_slice, - .config_props = config_input, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = avfilter_vf_vflip_inputs, + .outputs = avfilter_vf_vflip_outputs, }; diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index abb7812ce1..f67e3b0249 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -424,6 +424,29 @@ static int config_props(AVFilterLink *link) return 0; } +static const AVFilterPad avfilter_vf_yadif_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .get_video_buffer = get_video_buffer, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + }, + { NULL } +}; + +static const AVFilterPad avfilter_vf_yadif_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .poll_frame = poll_frame, + .request_frame = request_frame, + .config_props = config_props, + }, + { NULL } +}; + AVFilter avfilter_vf_yadif = { .name = "yadif", .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image"), @@ -433,18 +456,7 @@ AVFilter avfilter_vf_yadif = { .uninit = uninit, .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = start_frame, - .get_video_buffer = get_video_buffer, - .draw_slice = null_draw_slice, - .end_frame = end_frame, }, - { .name = NULL}}, + .inputs = avfilter_vf_yadif_inputs, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .poll_frame = poll_frame, - .request_frame = request_frame, - .config_props = config_props, }, - { .name = NULL}}, + .outputs = avfilter_vf_yadif_outputs, }; diff --git a/libavfilter/vsink_nullsink.c b/libavfilter/vsink_nullsink.c index 7373020d84..b10ee626b1 100644 --- a/libavfilter/vsink_nullsink.c +++ b/libavfilter/vsink_nullsink.c @@ -30,20 +30,22 @@ static int end_frame(AVFilterLink *link) return 0; } +static const AVFilterPad avfilter_vsink_nullsink_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .end_frame = end_frame, + }, + { NULL }, +}; + AVFilter avfilter_vsink_nullsink = { .name = "nullsink", .description = NULL_IF_CONFIG_SMALL("Do absolutely nothing with the input video."), .priv_size = 0, - .inputs = (const AVFilterPad[]) { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .start_frame = start_frame, - .end_frame = end_frame, - }, - { .name = NULL}, - }, + .inputs = avfilter_vsink_nullsink_inputs, .outputs = NULL, }; diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c index 9df81ad19f..f885b717af 100644 --- a/libavfilter/vsrc_color.c +++ b/libavfilter/vsrc_color.c @@ -182,6 +182,16 @@ fail: return ret; } +static const AVFilterPad avfilter_vsrc_color_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = color_request_frame, + .config_props = color_config_props + }, + { NULL } +}; + AVFilter avfilter_vsrc_color = { .name = "color", .description = NULL_IF_CONFIG_SMALL("Provide an uniformly colored input, syntax is: [color[:size[:rate]]]"), @@ -194,9 +204,5 @@ AVFilter avfilter_vsrc_color = { .inputs = NULL, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = color_request_frame, - .config_props = color_config_props }, - { .name = NULL}}, + .outputs = avfilter_vsrc_color_outputs, }; diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c index 7479a3cc8c..79186762cb 100644 --- a/libavfilter/vsrc_movie.c +++ b/libavfilter/vsrc_movie.c @@ -309,6 +309,16 @@ fail: return ret; } +static const AVFilterPad avfilter_vsrc_movie_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, + .config_props = config_output_props, + }, + { NULL } +}; + AVFilter avfilter_vsrc_movie = { .name = "movie", .description = NULL_IF_CONFIG_SMALL("Read from a movie source."), @@ -318,9 +328,5 @@ AVFilter avfilter_vsrc_movie = { .query_formats = query_formats, .inputs = NULL, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = request_frame, - .config_props = config_output_props, }, - { .name = NULL}}, + .outputs = avfilter_vsrc_movie_outputs, }; diff --git a/libavfilter/vsrc_nullsrc.c b/libavfilter/vsrc_nullsrc.c index 49200c2cca..79f6d4ba99 100644 --- a/libavfilter/vsrc_nullsrc.c +++ b/libavfilter/vsrc_nullsrc.c @@ -114,6 +114,16 @@ static int request_frame(AVFilterLink *link) return -1; } +static const AVFilterPad avfilter_vsrc_nullsrc_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_props, + .request_frame = request_frame, + }, + { NULL } +}; + AVFilter avfilter_vsrc_nullsrc = { .name = "nullsrc", .description = NULL_IF_CONFIG_SMALL("Null video source, never return images."), @@ -123,13 +133,5 @@ AVFilter avfilter_vsrc_nullsrc = { .inputs = NULL, - .outputs = (const AVFilterPad[]) { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_props, - .request_frame = request_frame, - }, - { .name = NULL} - }, + .outputs = avfilter_vsrc_nullsrc_outputs, }; diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 3177263e76..b81611d19e 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -359,6 +359,16 @@ static int test_query_formats(AVFilterContext *ctx) return 0; } +static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, + .config_props = config_props, + }, + { NULL } +}; + AVFilter avfilter_vsrc_testsrc = { .name = "testsrc", .description = NULL_IF_CONFIG_SMALL("Generate test pattern."), @@ -369,11 +379,7 @@ AVFilter avfilter_vsrc_testsrc = { .inputs = NULL, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = request_frame, - .config_props = config_props, }, - { .name = NULL }}, + .outputs = avfilter_vsrc_testsrc_outputs, }; #endif /* CONFIG_TESTSRC_FILTER */ @@ -486,6 +492,16 @@ static int rgbtest_config_props(AVFilterLink *outlink) return config_props(outlink); } +static const AVFilterPad avfilter_vsrc_rgbtestsrc_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, + .config_props = rgbtest_config_props, + }, + { NULL } +}; + AVFilter avfilter_vsrc_rgbtestsrc = { .name = "rgbtestsrc", .description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."), @@ -496,11 +512,7 @@ AVFilter avfilter_vsrc_rgbtestsrc = { .inputs = NULL, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = request_frame, - .config_props = rgbtest_config_props, }, - { .name = NULL }}, + .outputs = avfilter_vsrc_rgbtestsrc_outputs, }; #endif /* CONFIG_RGBTESTSRC_FILTER */ From 4436f25a1682ada3f7226cb6fadf429946933161 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Wed, 10 Oct 2012 22:36:54 +0100 Subject: [PATCH 9/9] build: remove references to unused EXTRAOBJS variable This was part of a ghastly hack that is long since gone. Signed-off-by: Mans Rullgard --- library.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.mak b/library.mak index 98e0c6f912..7f26984cd0 100644 --- a/library.mak +++ b/library.mak @@ -25,7 +25,7 @@ $(TESTOBJS): CPPFLAGS += -DTEST $(SUBDIR)$(LIBNAME): $(OBJS) $(RM) $@ - $(AR) $(ARFLAGS) $(AR_O) $^ $(EXTRAOBJS) + $(AR) $(ARFLAGS) $(AR_O) $^ $(RANLIB) $@ install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig @@ -45,7 +45,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS) $(SLIB_CREATE_DEF_CMD) - $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) + $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(SLIB_EXTRA_CMD) clean::