Skip to content

Commit

Permalink
lavf: use designated initialisers for all (de)muxers.
Browse files Browse the repository at this point in the history
It's more readable and less prone to breakage.
  • Loading branch information
elenril committed Jul 17, 2011
1 parent 6270995 commit dfc2c4d
Show file tree
Hide file tree
Showing 132 changed files with 1,311 additions and 1,466 deletions.
14 changes: 7 additions & 7 deletions libavformat/4xm.c
Expand Up @@ -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,
};
6 changes: 3 additions & 3 deletions libavformat/a64.c
Expand Up @@ -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
};
11 changes: 5 additions & 6 deletions libavformat/aacdec.c
Expand Up @@ -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,
Expand Down
22 changes: 10 additions & 12 deletions libavformat/ac3dec.c
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
18 changes: 9 additions & 9 deletions libavformat/adtsenc.c
Expand Up @@ -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,
};
14 changes: 6 additions & 8 deletions libavformat/aea.c
Expand Up @@ -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",
};
Expand Down
15 changes: 7 additions & 8 deletions libavformat/aiffdec.c
Expand Up @@ -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},
};
20 changes: 10 additions & 10 deletions libavformat/aiffenc.c
Expand Up @@ -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},
};
30 changes: 14 additions & 16 deletions libavformat/amr.c
Expand Up @@ -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
12 changes: 6 additions & 6 deletions libavformat/anm.c
Expand Up @@ -226,10 +226,10 @@ static int read_packet(AVFormatContext *s,
}

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,
};
11 changes: 5 additions & 6 deletions libavformat/apc.c
Expand Up @@ -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,
};
16 changes: 8 additions & 8 deletions libavformat/ape.c
Expand Up @@ -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"
};
16 changes: 8 additions & 8 deletions libavformat/applehttp.c
Expand Up @@ -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,
};
18 changes: 9 additions & 9 deletions libavformat/asfdec.c
Expand Up @@ -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,
};
44 changes: 22 additions & 22 deletions libavformat/asfenc.c
Expand Up @@ -882,41 +882,41 @@ 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},
};
#endif

#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},
};
Expand Down

0 comments on commit dfc2c4d

Please sign in to comment.