Commit dfc2c4d9 authored by Anton Khirnov's avatar Anton Khirnov

lavf: use designated initialisers for all (de)muxers.

It's more readable and less prone to breakage.
parent 62709956
......@@ -345,11 +345,11 @@ static int fourxm_read_close(AVFormatContext *s)
}
AVInputFormat ff_fourxm_demuxer = {
"4xm",
NULL_IF_CONFIG_SMALL("4X Technologies format"),
sizeof(FourxmDemuxContext),
fourxm_probe,
fourxm_read_header,
fourxm_read_packet,
fourxm_read_close,
.name = "4xm",
.long_name = NULL_IF_CONFIG_SMALL("4X Technologies format"),
.priv_data_size = sizeof(FourxmDemuxContext),
.read_probe = fourxm_probe,
.read_header = fourxm_read_header,
.read_packet = fourxm_read_packet,
.read_close = fourxm_read_close,
};
......@@ -170,7 +170,7 @@ AVOutputFormat ff_a64_muxer = {
.extensions = "a64, A64",
.priv_data_size = sizeof (A64Context),
.video_codec = CODEC_ID_A64_MULTI,
a64_write_header,
a64_write_packet,
a64_write_trailer
.write_header = a64_write_header,
.write_packet = a64_write_packet,
.write_trailer = a64_write_trailer
};
......@@ -82,12 +82,11 @@ static int adts_aac_read_header(AVFormatContext *s,
}
AVInputFormat ff_aac_demuxer = {
"aac",
NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
0,
adts_aac_probe,
adts_aac_read_header,
ff_raw_read_partial_packet,
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
.read_probe = adts_aac_probe,
.read_header = adts_aac_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "aac",
.value = CODEC_ID_AAC,
......
......@@ -71,12 +71,11 @@ static int ac3_probe(AVProbeData *p)
}
AVInputFormat ff_ac3_demuxer = {
"ac3",
NULL_IF_CONFIG_SMALL("raw AC-3"),
0,
ac3_probe,
ff_raw_audio_read_header,
ff_raw_read_partial_packet,
.name = "ac3",
.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
.read_probe = ac3_probe,
.read_header = ff_raw_audio_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "ac3",
.value = CODEC_ID_AC3,
......@@ -90,12 +89,11 @@ static int eac3_probe(AVProbeData *p)
}
AVInputFormat ff_eac3_demuxer = {
"eac3",
NULL_IF_CONFIG_SMALL("raw E-AC-3"),
0,
eac3_probe,
ff_raw_audio_read_header,
ff_raw_read_partial_packet,
.name = "eac3",
.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
.read_probe = eac3_probe,
.read_header = ff_raw_audio_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "eac3",
.value = CODEC_ID_EAC3,
......
......@@ -142,13 +142,13 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
}
AVOutputFormat ff_adts_muxer = {
"adts",
NULL_IF_CONFIG_SMALL("ADTS AAC"),
"audio/aac",
"aac,adts",
sizeof(ADTSContext),
CODEC_ID_AAC,
CODEC_ID_NONE,
adts_write_header,
adts_write_packet,
.name = "adts",
.long_name = NULL_IF_CONFIG_SMALL("ADTS AAC"),
.mime_type = "audio/aac",
.extensions = "aac,adts",
.priv_data_size = sizeof(ADTSContext),
.audio_codec = CODEC_ID_AAC,
.video_codec = CODEC_ID_NONE,
.write_header = adts_write_header,
.write_packet = adts_write_packet,
};
......@@ -95,14 +95,12 @@ static int aea_read_packet(AVFormatContext *s, AVPacket *pkt)
}
AVInputFormat ff_aea_demuxer = {
"aea",
NULL_IF_CONFIG_SMALL("MD STUDIO audio"),
0,
aea_read_probe,
aea_read_header,
aea_read_packet,
0,
pcm_read_seek,
.name = "aea",
.long_name = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),
.read_probe = aea_read_probe,
.read_header = aea_read_header,
.read_packet = aea_read_packet,
.read_seek = pcm_read_seek,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "aea",
};
......
......@@ -313,13 +313,12 @@ static int aiff_read_packet(AVFormatContext *s,
}
AVInputFormat ff_aiff_demuxer = {
"aiff",
NULL_IF_CONFIG_SMALL("Audio IFF"),
sizeof(AIFFInputContext),
aiff_probe,
aiff_read_header,
aiff_read_packet,
NULL,
pcm_read_seek,
.name = "aiff",
.long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
.priv_data_size = sizeof(AIFFInputContext),
.read_probe = aiff_probe,
.read_header = aiff_read_header,
.read_packet = aiff_read_packet,
.read_seek = pcm_read_seek,
.codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0},
};
......@@ -148,15 +148,15 @@ static int aiff_write_trailer(AVFormatContext *s)
}
AVOutputFormat ff_aiff_muxer = {
"aiff",
NULL_IF_CONFIG_SMALL("Audio IFF"),
"audio/aiff",
"aif,aiff,afc,aifc",
sizeof(AIFFOutputContext),
CODEC_ID_PCM_S16BE,
CODEC_ID_NONE,
aiff_write_header,
aiff_write_packet,
aiff_write_trailer,
.name = "aiff",
.long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
.mime_type = "audio/aiff",
.extensions = "aif,aiff,afc,aifc",
.priv_data_size = sizeof(AIFFOutputContext),
.audio_codec = CODEC_ID_PCM_S16BE,
.video_codec = CODEC_ID_NONE,
.write_header = aiff_write_header,
.write_packet = aiff_write_packet,
.write_trailer = aiff_write_trailer,
.codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0},
};
......@@ -174,27 +174,25 @@ static int amr_read_packet(AVFormatContext *s,
#if CONFIG_AMR_DEMUXER
AVInputFormat ff_amr_demuxer = {
"amr",
NULL_IF_CONFIG_SMALL("3GPP AMR file format"),
0, /*priv_data_size*/
amr_probe,
amr_read_header,
amr_read_packet,
NULL,
.name = "amr",
.long_name = NULL_IF_CONFIG_SMALL("3GPP AMR file format"),
.priv_data_size = 0, /*priv_data_size*/
.read_probe = amr_probe,
.read_header = amr_read_header,
.read_packet = amr_read_packet,
.flags = AVFMT_GENERIC_INDEX,
};
#endif
#if CONFIG_AMR_MUXER
AVOutputFormat ff_amr_muxer = {
"amr",
NULL_IF_CONFIG_SMALL("3GPP AMR file format"),
"audio/amr",
"amr",
0,
CODEC_ID_AMR_NB,
CODEC_ID_NONE,
amr_write_header,
amr_write_packet,
.name = "amr",
.long_name = NULL_IF_CONFIG_SMALL("3GPP AMR file format"),
.mime_type = "audio/amr",
.extensions = "amr",
.audio_codec = CODEC_ID_AMR_NB,
.video_codec = CODEC_ID_NONE,
.write_header = amr_write_header,
.write_packet = amr_write_packet,
};
#endif
......@@ -226,10 +226,10 @@ repeat:
}
AVInputFormat ff_anm_demuxer = {
"anm",
NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
sizeof(AnmDemuxContext),
probe,
read_header,
read_packet,
.name = "anm",
.long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
.priv_data_size = sizeof(AnmDemuxContext),
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,
};
......@@ -81,10 +81,9 @@ static int apc_read_packet(AVFormatContext *s, AVPacket *pkt)
}
AVInputFormat ff_apc_demuxer = {
"apc",
NULL_IF_CONFIG_SMALL("CRYO APC format"),
0,
apc_probe,
apc_read_header,
apc_read_packet,
.name = "apc",
.long_name = NULL_IF_CONFIG_SMALL("CRYO APC format"),
.read_probe = apc_probe,
.read_header = apc_read_header,
.read_packet = apc_read_packet,
};
......@@ -405,13 +405,13 @@ static int ape_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
}
AVInputFormat ff_ape_demuxer = {
"ape",
NULL_IF_CONFIG_SMALL("Monkey's Audio"),
sizeof(APEContext),
ape_probe,
ape_read_header,
ape_read_packet,
ape_read_close,
ape_read_seek,
.name = "ape",
.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
.priv_data_size = sizeof(APEContext),
.read_probe = ape_probe,
.read_header = ape_read_header,
.read_packet = ape_read_packet,
.read_close = ape_read_close,
.read_seek = ape_read_seek,
.extensions = "ape,apl,mac"
};
......@@ -668,12 +668,12 @@ static int applehttp_probe(AVProbeData *p)
}
AVInputFormat ff_applehttp_demuxer = {
"applehttp",
NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming format"),
sizeof(AppleHTTPContext),
applehttp_probe,
applehttp_read_header,
applehttp_read_packet,
applehttp_close,
applehttp_read_seek,
.name = "applehttp",
.long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming format"),
.priv_data_size = sizeof(AppleHTTPContext),
.read_probe = applehttp_probe,
.read_header = applehttp_read_header,
.read_packet = applehttp_read_packet,
.read_close = applehttp_close,
.read_seek = applehttp_read_seek,
};
......@@ -1289,14 +1289,14 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
}
AVInputFormat ff_asf_demuxer = {
"asf",
NULL_IF_CONFIG_SMALL("ASF format"),
sizeof(ASFContext),
asf_probe,
asf_read_header,
asf_read_packet,
asf_read_close,
asf_read_seek,
asf_read_pts,
.name = "asf",
.long_name = NULL_IF_CONFIG_SMALL("ASF format"),
.priv_data_size = sizeof(ASFContext),
.read_probe = asf_probe,
.read_header = asf_read_header,
.read_packet = asf_read_packet,
.read_close = asf_read_close,
.read_seek = asf_read_seek,
.read_timestamp = asf_read_pts,
.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH,
};
......@@ -882,20 +882,20 @@ static int asf_write_trailer(AVFormatContext *s)
#if CONFIG_ASF_MUXER
AVOutputFormat ff_asf_muxer = {
"asf",
NULL_IF_CONFIG_SMALL("ASF format"),
"video/x-ms-asf",
"asf,wmv,wma",
sizeof(ASFContext),
.name = "asf",
.long_name = NULL_IF_CONFIG_SMALL("ASF format"),
.mime_type = "video/x-ms-asf",
.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),
#if CONFIG_LIBMP3LAME
CODEC_ID_MP3,
.audio_codec = CODEC_ID_MP3,
#else
CODEC_ID_MP2,
.audio_codec = CODEC_ID_MP2,
#endif
CODEC_ID_MSMPEG4V3,
asf_write_header,
asf_write_packet,
asf_write_trailer,
.video_codec = CODEC_ID_MSMPEG4V3,
.write_header = asf_write_header,
.write_packet = asf_write_packet,
.write_trailer = asf_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0},
};
......@@ -903,20 +903,20 @@ AVOutputFormat ff_asf_muxer = {
#if CONFIG_ASF_STREAM_MUXER
AVOutputFormat ff_asf_stream_muxer = {
"asf_stream",
NULL_IF_CONFIG_SMALL("ASF format"),
"video/x-ms-asf",
"asf,wmv,wma",
sizeof(ASFContext),
.name = "asf_stream",
.long_name = NULL_IF_CONFIG_SMALL("ASF format"),
.mime_type = "video/x-ms-asf",
.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),
#if CONFIG_LIBMP3LAME
CODEC_ID_MP3,
.audio_codec = CODEC_ID_MP3,
#else
CODEC_ID_MP2,
.audio_codec = CODEC_ID_MP2,
#endif
CODEC_ID_MSMPEG4V3,
asf_write_stream_header,
asf_write_packet,
asf_write_trailer,
.video_codec = CODEC_ID_MSMPEG4V3,
.write_header = asf_write_stream_header,
.write_packet = asf_write_packet,
.write_trailer = asf_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0},
};
......
......@@ -185,30 +185,27 @@ static int au_read_packet(AVFormatContext *s,
#if CONFIG_AU_DEMUXER
AVInputFormat ff_au_demuxer = {
"au",
NULL_IF_CONFIG_SMALL("SUN AU format"),
0,
au_probe,
au_read_header,
au_read_packet,
NULL,
pcm_read_seek,
.name = "au",
.long_name = NULL_IF_CONFIG_SMALL("SUN AU format"),
.read_probe = au_probe,
.read_header = au_read_header,
.read_packet = au_read_packet,
.read_seek = pcm_read_seek,
.codec_tag= (const AVCodecTag* const []){codec_au_tags, 0},
};
#endif
#if CONFIG_AU_MUXER
AVOutputFormat ff_au_muxer = {
"au",
NULL_IF_CONFIG_SMALL("SUN AU format"),
"audio/basic",
"au",
0,
CODEC_ID_PCM_S16BE,
CODEC_ID_NONE,
au_write_header,
au_write_packet,
au_write_trailer,
.name = "au",
.long_name = NULL_IF_CONFIG_SMALL("SUN AU format"),
.mime_type = "audio/basic",
.extensions = "au",
.audio_codec = CODEC_ID_PCM_S16BE,
.video_codec = CODEC_ID_NONE,
.write_header = au_write_header,
.write_packet = au_write_packet,
.write_trailer = au_write_trailer,
.codec_tag= (const AVCodecTag* const []){codec_au_tags, 0},
};
#endif //CONFIG_AU_MUXER
......@@ -1389,12 +1389,12 @@ static int avi_probe(AVProbeData *p)
}
AVInputFormat ff_avi_demuxer = {
"avi",
NULL_IF_CONFIG_SMALL("AVI format"),
sizeof(AVIContext),
avi_probe,
avi_read_header,
avi_read_packet,
avi_read_close,
avi_read_seek,
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI format"),
.priv_data_size = sizeof(AVIContext),
.read_probe = avi_probe,
.read_header = avi_read_header,
.read_packet = avi_read_packet,
.read_close = avi_read_close,
.read_seek = avi_read_seek,
};
......@@ -639,16 +639,16 @@ static int avi_write_trailer(AVFormatContext *s)
}
AVOutputFormat ff_avi_muxer = {
"avi",
NULL_IF_CONFIG_SMALL("AVI format"),
"video/x-msvideo",
"avi",
sizeof(AVIContext),
CODEC_ID_MP2,
CODEC_ID_MPEG4,
avi_write_header,
avi_write_packet,
avi_write_trailer,
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI format"),
.mime_type = "video/x-msvideo",
.extensions = "avi",
.priv_data_size = sizeof(AVIContext),
.audio_codec = CODEC_ID_MP2,
.video_codec = CODEC_ID_MPEG4,
.write_header = avi_write_header,
.write_packet = avi_write_packet,
.write_trailer = avi_write_trailer,
.codec_tag= (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, 0},
.flags= AVFMT_VARIABLE_FPS,
};
......@@ -208,15 +208,12 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index, int64_t pts,
}
AVInputFormat ff_avisynth_demuxer = {
"avs",
NULL_IF_CONFIG_SMALL("AVISynth"),
sizeof(AVISynthContext),
NULL,
avisynth_read_header,
avisynth_read_packet,
avisynth_read_close,
avisynth_read_seek,
NULL,
0,
"avs",
.name = "avs",
.long_name = NULL_IF_CONFIG_SMALL("AVISynth"),
.priv_data_size = sizeof(AVISynthContext),
.read_header = avisynth_read_header,
.read_packet = avisynth_read_packet,
.read_close = avisynth_read_close,
.read_seek = avisynth_read_seek,
.extensions = "avs",
};
......@@ -216,11 +216,11 @@ static int avs_read_close(AVFormatContext * s)
}
AVInputFormat ff_avs_demuxer = {
"avs",
NULL_IF_CONFIG_SMALL("AVS format"),
sizeof(AvsFormat),
avs_probe,
avs_read_header,
avs_read_packet,
avs_read_close,
.name = "avs",
.long_name = NULL_IF_CONFIG_SMALL("AVS format"),
.priv_data_size = sizeof(AvsFormat),
.read_probe = avs_probe,
.read_header = avs_read_header,
.read_packet = avs_read_packet,
.read_close = avs_read_close,
};
......@@ -223,10 +223,10 @@ static int vid_read_packet(AVFormatContext *s,
}
AVInputFormat ff_bethsoftvid_demuxer = {
"bethsoftvid",
NULL_IF_CONFIG_SMALL("Bethesda Softworks VID format"),
sizeof(BVID_DemuxContext),
vid_probe,
vid_read_header,
vid_read_packet,
.name = "bethsoftvid",
.long_name = NULL_IF_CONFIG_SMALL("Bethesda Softworks VID format"),
.priv_data_size = sizeof(BVID_DemuxContext),
.read_probe = vid_probe,
.read_header = vid_read_header,
.read_packet = vid_read_packet,
};
......@@ -159,10 +159,10 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
}
AVInputFormat ff_bfi_demuxer = {
"bfi",
NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
sizeof(BFIContext),
bfi_probe,
bfi_read_header,
bfi_read_packet,
.name = "bfi",
.long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
.priv_data_size = sizeof(BFIContext),
.read_probe = bfi_probe,
.read_header = bfi_read_header,
.read_packet = bfi_read_packet,
};
......@@ -264,12 +264,11 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, in
}
AVInputFormat ff_bink_demuxer = {
"bink",
NULL_IF_CONFIG_SMALL("Bink"),
sizeof(BinkDemuxContext),
probe,
read_header,
read_packet,
NULL,
read_seek,
.name = "bink",
.long_name = NULL_IF_CONFIG_SMALL("Bink"),
.priv_data_size = sizeof(BinkDemuxContext),
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,
.read_seek = read_seek,
};
......@@ -193,10 +193,10 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
AVInputFormat ff_c93_demuxer = {
"c93",
NULL_IF_CONFIG_SMALL("Interplay C93"),
sizeof(C93DemuxContext),
probe,
read_header,
read_packet,
.name = "c93",
.long_name = NULL_IF_CONFIG_SMALL("Interplay C93"),
.priv_data_size = sizeof(C93DemuxContext),
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,
};
......@@ -384,13 +384,12 @@ static int read_seek(AVFormatContext *s, int stream_index,
}
AVInputFormat ff_caf_demuxer = {
"caf",
NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
sizeof(CaffContext),
probe,
read_header,
read_packet,
NULL,
read_seek,
.name = "caf",
.long_name = NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
.priv_data_size = sizeof(CaffContext),
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,
.read_seek = read_seek,
.codec_tag = (const AVCodecTag*[]){ff_codec_caf_tags, 0},
};
......@@ -56,11 +56,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
AVInputFormat ff_cdg_demuxer = {
"cdg",
NULL_IF_CONFIG_SMALL("CD Graphics Format"),
0,
NULL,
read_header,
read_packet,
.name = "cdg",
.long_name = NULL_IF_CONFIG_SMALL("CD Graphics Format"),
.read_header = read_header,
.read_packet = read_packet,
.extensions = "cdg"
};
......@@ -55,14 +55,13 @@ static int crc_write_trailer(struct AVFormatContext *s)
}
AVOutputFormat ff_crc_muxer = {
"crc",
NULL_IF_CONFIG_SMALL("CRC testing format"),
NULL,
"",
sizeof(CRCState),
CODEC_ID_PCM_S16LE,
CODEC_ID_RAWVIDEO,
crc_write_header,
crc_write_packet,
crc_write_trailer,
.name = "crc",
.long_name = NULL_IF_CONFIG_SMALL("CRC testing format"),
.extensions = "",
.priv_data_size = sizeof(CRCState),
.audio_codec = CODEC_ID_PCM_S16LE,
.video_codec = CODEC_ID_RAWVIDEO,
.write_header = crc_write_header,
.write_packet = crc_write_packet,
.write_trailer = crc_write_trailer,
};
......@@ -71,14 +71,10 @@ static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
#if CONFIG_DAUD_DEMUXER
AVInputFormat ff_daud_demuxer = {
"daud",
NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
0,
NULL,
daud_header,
daud_packet,
NULL,
NULL,
.name = "daud",
.long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio format"),