lavc: use designated initialisers for parsers.

This commit is contained in:
Anton Khirnov 2011-11-02 09:34:41 +01:00
parent da24963725
commit 5511ad14fe
23 changed files with 106 additions and 122 deletions

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};