From 5511ad14fe1cc871a5a256bf801db09cf1cc35f5 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 2 Nov 2011 09:34:41 +0100 Subject: [PATCH] lavc: use designated initialisers for parsers. --- libavcodec/aac_parser.c | 10 +++++----- libavcodec/ac3_parser.c | 10 +++++----- libavcodec/cavs_parser.c | 11 +++++------ libavcodec/dca_parser.c | 10 +++++----- libavcodec/dirac_parser.c | 9 ++++----- libavcodec/dnxhd_parser.c | 9 ++++----- libavcodec/dvbsub_parser.c | 10 +++++----- libavcodec/dvdsub_parser.c | 10 +++++----- libavcodec/flac_parser.c | 10 +++++----- libavcodec/h261_parser.c | 9 ++++----- libavcodec/h263_parser.c | 9 ++++----- libavcodec/h264_parser.c | 12 ++++++------ libavcodec/latm_parser.c | 9 ++++----- libavcodec/mjpeg_parser.c | 9 ++++----- libavcodec/mlp_parser.c | 10 +++++----- libavcodec/mpeg4video_parser.c | 12 ++++++------ libavcodec/mpegaudio_parser.c | 9 ++++----- libavcodec/mpegvideo_parser.c | 11 +++++------ libavcodec/pnm_parser.c | 10 +++++----- libavcodec/rv34_parser.c | 14 ++++++-------- libavcodec/vc1_parser.c | 11 +++++------ libavcodec/vp3_parser.c | 8 +++----- libavcodec/vp8_parser.c | 6 ++---- 23 files changed, 106 insertions(+), 122 deletions(-) diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index ca016d1b89..f0914e60c0 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -61,9 +61,9 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1) AVCodecParser ff_aac_parser = { - { CODEC_ID_AAC }, - sizeof(AACAC3ParseContext), - aac_parse_init, - ff_aac_ac3_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_AAC }, + .priv_data_size = sizeof(AACAC3ParseContext), + .parser_init = aac_parse_init, + .parser_parse = ff_aac_ac3_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c index a6bdd5490f..e3c46fd332 100644 --- a/libavcodec/ac3_parser.c +++ b/libavcodec/ac3_parser.c @@ -174,9 +174,9 @@ static av_cold int ac3_parse_init(AVCodecParserContext *s1) AVCodecParser ff_ac3_parser = { - { CODEC_ID_AC3, CODEC_ID_EAC3 }, - sizeof(AACAC3ParseContext), - ac3_parse_init, - ff_aac_ac3_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_AC3, CODEC_ID_EAC3 }, + .priv_data_size = sizeof(AACAC3ParseContext), + .parser_init = ac3_parse_init, + .parser_parse = ff_aac_ac3_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/cavs_parser.c b/libavcodec/cavs_parser.c index 2cc65665b8..07464c39b2 100644 --- a/libavcodec/cavs_parser.c +++ b/libavcodec/cavs_parser.c @@ -98,10 +98,9 @@ static int cavsvideo_parse(AVCodecParserContext *s, } AVCodecParser ff_cavsvideo_parser = { - { CODEC_ID_CAVS }, - sizeof(ParseContext1), - NULL, - cavsvideo_parse, - ff_parse1_close, - ff_mpeg4video_split, + .codec_ids = { CODEC_ID_CAVS }, + .priv_data_size = sizeof(ParseContext1), + .parser_parse = cavsvideo_parse, + .parser_close = ff_parse1_close, + .split = ff_mpeg4video_split, }; diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index 70a3e989ba..2441099257 100644 --- a/libavcodec/dca_parser.c +++ b/libavcodec/dca_parser.c @@ -126,9 +126,9 @@ static int dca_parse(AVCodecParserContext * s, } AVCodecParser ff_dca_parser = { - {CODEC_ID_DTS}, - sizeof(DCAParseContext), - dca_parse_init, - dca_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_DTS }, + .priv_data_size = sizeof(DCAParseContext), + .parser_init = dca_parse_init, + .parser_parse = dca_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/dirac_parser.c b/libavcodec/dirac_parser.c index 87c3a04b91..11d0cf86b2 100644 --- a/libavcodec/dirac_parser.c +++ b/libavcodec/dirac_parser.c @@ -248,9 +248,8 @@ static void dirac_parse_close(AVCodecParserContext *s) } AVCodecParser ff_dirac_parser = { - { CODEC_ID_DIRAC }, - sizeof(DiracParseContext), - NULL, - dirac_parse, - dirac_parse_close, + .codec_ids = { CODEC_ID_DIRAC }, + .priv_data_size = sizeof(DiracParseContext), + .parser_parse = dirac_parse, + .parser_close = dirac_parse_close, }; diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c index 44ea8f06f5..870fed4a11 100644 --- a/libavcodec/dnxhd_parser.c +++ b/libavcodec/dnxhd_parser.c @@ -87,9 +87,8 @@ static int dnxhd_parse(AVCodecParserContext *s, } AVCodecParser ff_dnxhd_parser = { - { CODEC_ID_DNXHD }, - sizeof(ParseContext), - NULL, - dnxhd_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_DNXHD }, + .priv_data_size = sizeof(ParseContext), + .parser_parse = dnxhd_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/dvbsub_parser.c b/libavcodec/dvbsub_parser.c index 8f3b0653d4..643352888f 100644 --- a/libavcodec/dvbsub_parser.c +++ b/libavcodec/dvbsub_parser.c @@ -172,9 +172,9 @@ static av_cold void dvbsub_parse_close(AVCodecParserContext *s) } AVCodecParser ff_dvbsub_parser = { - { CODEC_ID_DVB_SUBTITLE }, - sizeof(DVBSubParseContext), - dvbsub_parse_init, - dvbsub_parse, - dvbsub_parse_close, + .codec_ids = { CODEC_ID_DVB_SUBTITLE }, + .priv_data_size = sizeof(DVBSubParseContext), + .parser_init = dvbsub_parse_init, + .parser_parse = dvbsub_parse, + .parser_close = dvbsub_parse_close, }; diff --git a/libavcodec/dvdsub_parser.c b/libavcodec/dvdsub_parser.c index 5b07de60df..e4c01e05cc 100644 --- a/libavcodec/dvdsub_parser.c +++ b/libavcodec/dvdsub_parser.c @@ -77,9 +77,9 @@ static av_cold void dvdsub_parse_close(AVCodecParserContext *s) } AVCodecParser ff_dvdsub_parser = { - { CODEC_ID_DVD_SUBTITLE }, - sizeof(DVDSubParseContext), - dvdsub_parse_init, - dvdsub_parse, - dvdsub_parse_close, + .codec_ids = { CODEC_ID_DVD_SUBTITLE }, + .priv_data_size = sizeof(DVDSubParseContext), + .parser_init = dvdsub_parse_init, + .parser_parse = dvdsub_parse, + .parser_close = dvdsub_parse_close, }; diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 947a5b6e15..87f3f95042 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -674,9 +674,9 @@ static void flac_parse_close(AVCodecParserContext *c) } AVCodecParser ff_flac_parser = { - { CODEC_ID_FLAC }, - sizeof(FLACParseContext), - flac_parse_init, - flac_parse, - flac_parse_close, + .codec_ids = { CODEC_ID_FLAC }, + .priv_data_size = sizeof(FLACParseContext), + .parser_init = flac_parse_init, + .parser_parse = flac_parse, + .parser_close = flac_parse_close, }; diff --git a/libavcodec/h261_parser.c b/libavcodec/h261_parser.c index 20c2862549..fb50acfc4a 100644 --- a/libavcodec/h261_parser.c +++ b/libavcodec/h261_parser.c @@ -82,9 +82,8 @@ static int h261_parse(AVCodecParserContext *s, } AVCodecParser ff_h261_parser = { - { CODEC_ID_H261 }, - sizeof(ParseContext), - NULL, - h261_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_H261 }, + .priv_data_size = sizeof(ParseContext), + .parser_parse = h261_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/h263_parser.c b/libavcodec/h263_parser.c index 4b9fc110f2..98a72d92a9 100644 --- a/libavcodec/h263_parser.c +++ b/libavcodec/h263_parser.c @@ -84,9 +84,8 @@ static int h263_parse(AVCodecParserContext *s, } AVCodecParser ff_h263_parser = { - { CODEC_ID_H263 }, - sizeof(ParseContext), - NULL, - h263_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_H263 }, + .priv_data_size = sizeof(ParseContext), + .parser_parse = h263_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 52ff88b3a4..826c17a0f1 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -334,10 +334,10 @@ static int init(AVCodecParserContext *s) } AVCodecParser ff_h264_parser = { - { CODEC_ID_H264 }, - sizeof(H264Context), - init, - h264_parse, - close, - h264_split, + .codec_ids = { CODEC_ID_H264 }, + .priv_data_size = sizeof(H264Context), + .parser_init = init, + .parser_parse = h264_parse, + .parser_close = close, + .split = h264_split, }; diff --git a/libavcodec/latm_parser.c b/libavcodec/latm_parser.c index fe39de8e09..d2c0244c02 100644 --- a/libavcodec/latm_parser.c +++ b/libavcodec/latm_parser.c @@ -106,9 +106,8 @@ static int latm_parse(AVCodecParserContext *s1, AVCodecContext *avctx, } AVCodecParser ff_aac_latm_parser = { - { CODEC_ID_AAC_LATM }, - sizeof(LATMParseContext), - NULL, - latm_parse, - ff_parse_close + .codec_ids = { CODEC_ID_AAC_LATM }, + .priv_data_size = sizeof(LATMParseContext), + .parser_parse = latm_parse, + .parser_close = ff_parse_close }; diff --git a/libavcodec/mjpeg_parser.c b/libavcodec/mjpeg_parser.c index b5282f17c4..daa65483cd 100644 --- a/libavcodec/mjpeg_parser.c +++ b/libavcodec/mjpeg_parser.c @@ -97,9 +97,8 @@ static int jpeg_parse(AVCodecParserContext *s, AVCodecParser ff_mjpeg_parser = { - { CODEC_ID_MJPEG }, - sizeof(ParseContext), - NULL, - jpeg_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_MJPEG }, + .priv_data_size = sizeof(ParseContext), + .parser_parse = jpeg_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c index e1f4c5610e..0fca1967c5 100644 --- a/libavcodec/mlp_parser.c +++ b/libavcodec/mlp_parser.c @@ -345,9 +345,9 @@ lost_sync: } AVCodecParser ff_mlp_parser = { - { CODEC_ID_MLP, CODEC_ID_TRUEHD }, - sizeof(MLPParseContext), - mlp_init, - mlp_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_MLP, CODEC_ID_TRUEHD }, + .priv_data_size = sizeof(MLPParseContext), + .parser_init = mlp_init, + .parser_parse = mlp_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c index 2e498d100c..162bc1d03e 100644 --- a/libavcodec/mpeg4video_parser.c +++ b/libavcodec/mpeg4video_parser.c @@ -130,10 +130,10 @@ static int mpeg4video_parse(AVCodecParserContext *s, AVCodecParser ff_mpeg4video_parser = { - { CODEC_ID_MPEG4 }, - sizeof(ParseContext1), - mpeg4video_parse_init, - mpeg4video_parse, - ff_parse1_close, - ff_mpeg4video_split, + .codec_ids = { CODEC_ID_MPEG4 }, + .priv_data_size = sizeof(ParseContext1), + .parser_init = mpeg4video_parse_init, + .parser_parse = mpeg4video_parse, + .parser_close = ff_parse1_close, + .split = ff_mpeg4video_split, }; diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index 17d329dc1c..c6d670de2a 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -100,9 +100,8 @@ static int mpegaudio_parse(AVCodecParserContext *s1, AVCodecParser ff_mpegaudio_parser = { - { CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3 }, - sizeof(MpegAudioParseContext), - NULL, - mpegaudio_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3 }, + .priv_data_size = sizeof(MpegAudioParseContext), + .parser_parse = mpegaudio_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index b4066ba720..1798f8386f 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -174,10 +174,9 @@ static int mpegvideo_split(AVCodecContext *avctx, } AVCodecParser ff_mpegvideo_parser = { - { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO }, - sizeof(ParseContext1), - NULL, - mpegvideo_parse, - ff_parse1_close, - mpegvideo_split, + .codec_ids = { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO }, + .priv_data_size = sizeof(ParseContext1), + .parser_parse = mpegvideo_parse, + .parser_close = ff_parse1_close, + .split = mpegvideo_split, }; diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c index 2dc29871c0..89f98715bd 100644 --- a/libavcodec/pnm_parser.c +++ b/libavcodec/pnm_parser.c @@ -84,9 +84,9 @@ retry: } AVCodecParser ff_pnm_parser = { - { CODEC_ID_PGM, CODEC_ID_PGMYUV, CODEC_ID_PPM, CODEC_ID_PBM, CODEC_ID_PAM}, - sizeof(ParseContext), - NULL, - pnm_parse, - ff_parse_close, + .codec_ids = { CODEC_ID_PGM, CODEC_ID_PGMYUV, CODEC_ID_PPM, + CODEC_ID_PBM, CODEC_ID_PAM }, + .priv_data_size = sizeof(ParseContext), + .parser_parse = pnm_parse, + .parser_close = ff_parse_close, }; diff --git a/libavcodec/rv34_parser.c b/libavcodec/rv34_parser.c index ce8604345e..4c1d2e396e 100644 --- a/libavcodec/rv34_parser.c +++ b/libavcodec/rv34_parser.c @@ -78,18 +78,16 @@ static int rv34_parse(AVCodecParserContext *s, #ifdef CONFIG_RV30_PARSER AVCodecParser ff_rv30_parser = { - { CODEC_ID_RV30 }, - sizeof(RV34ParseContext), - NULL, - rv34_parse, + .codec_ids = { CODEC_ID_RV30 }, + .priv_data_size = sizeof(RV34ParseContext), + .parser_parse = rv34_parse, }; #endif #ifdef CONFIG_RV40_PARSER AVCodecParser ff_rv40_parser = { - { CODEC_ID_RV40 }, - sizeof(RV34ParseContext), - NULL, - rv34_parse, + .codec_ids = { CODEC_ID_RV40 }, + .priv_data_size = sizeof(RV34ParseContext), + .parser_parse = rv34_parse, }; #endif diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c index c4c15b326d..c660c9cd0d 100644 --- a/libavcodec/vc1_parser.c +++ b/libavcodec/vc1_parser.c @@ -185,10 +185,9 @@ static int vc1_split(AVCodecContext *avctx, } AVCodecParser ff_vc1_parser = { - { CODEC_ID_VC1 }, - sizeof(VC1ParseContext), - NULL, - vc1_parse, - ff_parse1_close, - vc1_split, + .codec_ids = { CODEC_ID_VC1 }, + .priv_data_size = sizeof(VC1ParseContext), + .parser_parse = vc1_parse, + .parser_close = ff_parse1_close, + .split = vc1_split, }; diff --git a/libavcodec/vp3_parser.c b/libavcodec/vp3_parser.c index cfe6b3f2a3..1d70408cc7 100644 --- a/libavcodec/vp3_parser.c +++ b/libavcodec/vp3_parser.c @@ -36,9 +36,7 @@ static int parse(AVCodecParserContext *s, } AVCodecParser ff_vp3_parser = { - { CODEC_ID_THEORA, CODEC_ID_VP3, - CODEC_ID_VP6, CODEC_ID_VP6F, CODEC_ID_VP6A }, - 0, - NULL, - parse, + .codec_ids = { CODEC_ID_THEORA, CODEC_ID_VP3, CODEC_ID_VP6, + CODEC_ID_VP6F, CODEC_ID_VP6A }, + .parser_parse = parse, }; diff --git a/libavcodec/vp8_parser.c b/libavcodec/vp8_parser.c index fbdd0ee5ac..e6d4151bb5 100644 --- a/libavcodec/vp8_parser.c +++ b/libavcodec/vp8_parser.c @@ -33,8 +33,6 @@ static int parse(AVCodecParserContext *s, } AVCodecParser ff_vp8_parser = { - { CODEC_ID_VP8 }, - 0, - NULL, - parse, + .codec_ids = { CODEC_ID_VP8 }, + .parser_parse = parse, };