Commit ba10207b authored by Paul B Mahol's avatar Paul B Mahol Committed by Carl Eugen Hoyos

Use more designated initializers.

Also remove some pointless NULL/0 assigments.

C++ code must be left as it is because named struct
initializers are not supported by C++ standard.
parent 73ba2c1e
...@@ -211,40 +211,37 @@ static av_cold int decode_end(AVCodecContext *avctx) ...@@ -211,40 +211,37 @@ static av_cold int decode_end(AVCodecContext *avctx)
} }
AVCodec ff_bintext_decoder = { AVCodec ff_bintext_decoder = {
"bintext", .name = "bintext",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_BINTEXT, .id = CODEC_ID_BINTEXT,
sizeof(XbinContext), .priv_data_size = sizeof(XbinContext),
decode_init, .init = decode_init,
NULL, .close = decode_end,
decode_end, .decode = decode_frame,
decode_frame, .capabilities = CODEC_CAP_DR1,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Binary text"), .long_name = NULL_IF_CONFIG_SMALL("Binary text"),
}; };
AVCodec ff_xbin_decoder = { AVCodec ff_xbin_decoder = {
"xbin", .name = "xbin",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_XBIN, .id = CODEC_ID_XBIN,
sizeof(XbinContext), .priv_data_size = sizeof(XbinContext),
decode_init, .init = decode_init,
NULL, .close = decode_end,
decode_end, .decode = decode_frame,
decode_frame, .capabilities = CODEC_CAP_DR1,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"), .long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"),
}; };
AVCodec ff_idf_decoder = { AVCodec ff_idf_decoder = {
"idf", .name = "idf",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_IDF, .id = CODEC_ID_IDF,
sizeof(XbinContext), .priv_data_size = sizeof(XbinContext),
decode_init, .init = decode_init,
NULL, .close = decode_end,
decode_end, .decode = decode_frame,
decode_frame, .capabilities = CODEC_CAP_DR1,
CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"), .long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"),
}; };
...@@ -1898,7 +1898,6 @@ AVCodec ff_dirac_decoder = { ...@@ -1898,7 +1898,6 @@ AVCodec ff_dirac_decoder = {
.id = CODEC_ID_DIRAC, .id = CODEC_ID_DIRAC,
.priv_data_size = sizeof(DiracContext), .priv_data_size = sizeof(DiracContext),
.init = dirac_decode_init, .init = dirac_decode_init,
.encode = NULL,
.close = dirac_decode_end, .close = dirac_decode_end,
.decode = dirac_decode_frame, .decode = dirac_decode_frame,
.capabilities = CODEC_CAP_DELAY, .capabilities = CODEC_CAP_DELAY,
......
...@@ -894,13 +894,13 @@ static av_cold int flashsv2_encode_end(AVCodecContext * avctx) ...@@ -894,13 +894,13 @@ static av_cold int flashsv2_encode_end(AVCodecContext * avctx)
} }
AVCodec ff_flashsv2_encoder = { AVCodec ff_flashsv2_encoder = {
"flashsv2", .name = "flashsv2",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_FLASHSV2, .id = CODEC_ID_FLASHSV2,
sizeof(FlashSV2Context), .priv_data_size = sizeof(FlashSV2Context),
flashsv2_encode_init, .init = flashsv2_encode_init,
flashsv2_encode_frame, .encode = flashsv2_encode_frame,
flashsv2_encode_end, .close = flashsv2_encode_end,
.pix_fmts = (enum PixelFormat[]) {PIX_FMT_BGR24, PIX_FMT_NONE}, .pix_fmts = (enum PixelFormat[]) {PIX_FMT_BGR24, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"),
.capabilities = CODEC_CAP_EXPERIMENTAL, .capabilities = CODEC_CAP_EXPERIMENTAL,
......
...@@ -714,14 +714,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, ...@@ -714,14 +714,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
AVCodec ff_g729_decoder = AVCodec ff_g729_decoder =
{ {
"g729", .name = "g729",
AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
CODEC_ID_G729, .id = CODEC_ID_G729,
sizeof(G729Context), .priv_data_size = sizeof(G729Context),
decoder_init, .init = decoder_init,
NULL, .decode = decode_frame,
NULL,
decode_frame,
.capabilities = CODEC_CAP_DR1, .capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("G.729"), .long_name = NULL_IF_CONFIG_SMALL("G.729"),
}; };
...@@ -1068,14 +1068,13 @@ static av_cold int decode_end(AVCodecContext *avctx) ...@@ -1068,14 +1068,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
} }
AVCodec ff_jpeg2000_decoder = { AVCodec ff_jpeg2000_decoder = {
"j2k", .name = "j2k",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_JPEG2000, .id = CODEC_ID_JPEG2000,
sizeof(J2kDecoderContext), .priv_data_size = sizeof(J2kDecoderContext),
j2kdec_init, .init = j2kdec_init,
NULL, .close = decode_end,
decode_end, .decode = decode_frame,
decode_frame,
.capabilities = CODEC_CAP_EXPERIMENTAL, .capabilities = CODEC_CAP_EXPERIMENTAL,
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
.pix_fmts = .pix_fmts =
......
...@@ -1036,13 +1036,13 @@ static int j2kenc_destroy(AVCodecContext *avctx) ...@@ -1036,13 +1036,13 @@ static int j2kenc_destroy(AVCodecContext *avctx)
} }
AVCodec ff_jpeg2000_encoder = { AVCodec ff_jpeg2000_encoder = {
"j2k", .name = "j2k",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_JPEG2000, .id = CODEC_ID_JPEG2000,
sizeof(J2kEncoderContext), .priv_data_size = sizeof(J2kEncoderContext),
j2kenc_init, .init = j2kenc_init,
encode_frame, .encode = encode_frame,
j2kenc_destroy, .close = j2kenc_destroy,
.capabilities= CODEC_CAP_EXPERIMENTAL, .capabilities= CODEC_CAP_EXPERIMENTAL,
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
.pix_fmts = .pix_fmts =
......
...@@ -122,13 +122,13 @@ static av_cold int aacPlus_encode_close(AVCodecContext *avctx) ...@@ -122,13 +122,13 @@ static av_cold int aacPlus_encode_close(AVCodecContext *avctx)
} }
AVCodec ff_libaacplus_encoder = { AVCodec ff_libaacplus_encoder = {
"libaacplus", .name = "libaacplus",
AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
CODEC_ID_AAC, .id = CODEC_ID_AAC,
sizeof(aacPlusAudioContext), .priv_data_size = sizeof(aacPlusAudioContext),
aacPlus_encode_init, .init = aacPlus_encode_init,
aacPlus_encode_frame, .encode = aacPlus_encode_frame,
aacPlus_encode_close, .close = aacPlus_encode_close,
.sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libaacplus AAC+ (Advanced Audio Codec with SBR+PS)"), .long_name = NULL_IF_CONFIG_SMALL("libaacplus AAC+ (Advanced Audio Codec with SBR+PS)"),
}; };
...@@ -365,7 +365,6 @@ AVCodec ff_libopenjpeg_encoder = { ...@@ -365,7 +365,6 @@ AVCodec ff_libopenjpeg_encoder = {
.init = libopenjpeg_encode_init, .init = libopenjpeg_encode_init,
.encode = libopenjpeg_encode_frame, .encode = libopenjpeg_encode_frame,
.close = libopenjpeg_encode_close, .close = libopenjpeg_encode_close,
.decode = NULL,
.capabilities = 0, .capabilities = 0,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24,PIX_FMT_RGBA,PIX_FMT_GRAY8, .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24,PIX_FMT_RGBA,PIX_FMT_GRAY8,
PIX_FMT_YUV420P,PIX_FMT_YUV422P,PIX_FMT_YUVA420P, PIX_FMT_YUV420P,PIX_FMT_YUV422P,PIX_FMT_YUVA420P,
......
...@@ -290,13 +290,13 @@ static av_cold int encode_end(AVCodecContext *avctx) ...@@ -290,13 +290,13 @@ static av_cold int encode_end(AVCodecContext *avctx)
} }
AVCodec ff_msvideo1_encoder = { AVCodec ff_msvideo1_encoder = {
"msvideo1", .name = "msvideo1",
AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
CODEC_ID_MSVIDEO1, .id = CODEC_ID_MSVIDEO1,
sizeof(Msvideo1EncContext), .priv_data_size = sizeof(Msvideo1EncContext),
encode_init, .init = encode_init,
encode_frame, .encode = encode_frame,
encode_end, .close = encode_end,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB555, PIX_FMT_NONE}, .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB555, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"), .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"),
}; };
...@@ -253,7 +253,7 @@ AVCodec ff_pictor_decoder = { ...@@ -253,7 +253,7 @@ AVCodec ff_pictor_decoder = {
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_PICTOR, .id = CODEC_ID_PICTOR,
.priv_data_size = sizeof(PicContext), .priv_data_size = sizeof(PicContext),
decode_init, .init = decode_init,
.close = decode_end, .close = decode_end,
.decode = decode_frame, .decode = decode_frame,
.capabilities = CODEC_CAP_DR1, .capabilities = CODEC_CAP_DR1,
......
...@@ -594,6 +594,5 @@ AVCodec ff_prores_encoder = { ...@@ -594,6 +594,5 @@ AVCodec ff_prores_encoder = {
.encode = prores_encode_frame, .encode = prores_encode_frame,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P10, PIX_FMT_NONE}, .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P10, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"),
.capabilities = 0,
.profiles = profiles .profiles = profiles
}; };
...@@ -936,42 +936,39 @@ static int sonic_decode_frame(AVCodecContext *avctx, ...@@ -936,42 +936,39 @@ static int sonic_decode_frame(AVCodecContext *avctx,
} }
AVCodec ff_sonic_decoder = { AVCodec ff_sonic_decoder = {
"sonic", .name = "sonic",
AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
CODEC_ID_SONIC, .id = CODEC_ID_SONIC,
sizeof(SonicContext), .priv_data_size = sizeof(SonicContext),
sonic_decode_init, .init = sonic_decode_init,
NULL, .close = sonic_decode_close,
sonic_decode_close, .decode = sonic_decode_frame,
sonic_decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("Sonic"), .long_name = NULL_IF_CONFIG_SMALL("Sonic"),
}; };
#endif /* CONFIG_SONIC_DECODER */ #endif /* CONFIG_SONIC_DECODER */
#if CONFIG_SONIC_ENCODER #if CONFIG_SONIC_ENCODER
AVCodec ff_sonic_encoder = { AVCodec ff_sonic_encoder = {
"sonic", .name = "sonic",
AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
CODEC_ID_SONIC, .id = CODEC_ID_SONIC,
sizeof(SonicContext), .priv_data_size = sizeof(SonicContext),
sonic_encode_init, .init = sonic_encode_init,
sonic_encode_frame, .encode = sonic_encode_frame,
sonic_encode_close, .close = sonic_encode_close,
NULL,
.long_name = NULL_IF_CONFIG_SMALL("Sonic"), .long_name = NULL_IF_CONFIG_SMALL("Sonic"),
}; };
#endif #endif
#if CONFIG_SONIC_LS_ENCODER #if CONFIG_SONIC_LS_ENCODER
AVCodec ff_sonic_ls_encoder = { AVCodec ff_sonic_ls_encoder = {
"sonicls", .name = "sonicls",
AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
CODEC_ID_SONIC_LS, .id = CODEC_ID_SONIC_LS,
sizeof(SonicContext), .priv_data_size = sizeof(SonicContext),
sonic_encode_init, .init = sonic_encode_init,
sonic_encode_frame, .encode = sonic_encode_frame,
sonic_encode_close, .close = sonic_encode_close,
NULL,
.long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"), .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
}; };
#endif #endif
...@@ -248,15 +248,15 @@ static int caf_write_trailer(AVFormatContext *s) ...@@ -248,15 +248,15 @@ static int caf_write_trailer(AVFormatContext *s)
} }
AVOutputFormat ff_caf_muxer = { AVOutputFormat ff_caf_muxer = {
"caf", .name = "caf",
NULL_IF_CONFIG_SMALL("Apple Core Audio Format"), .long_name = NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
"audio/x-caf", .mime_type = "audio/x-caf",
"caf", .extensions = "caf",
sizeof(CAFContext), .priv_data_size = sizeof(CAFContext),
CODEC_ID_PCM_S16BE, .audio_codec = CODEC_ID_PCM_S16BE,
CODEC_ID_NONE, .video_codec = CODEC_ID_NONE,
caf_write_header, .write_header = caf_write_header,
caf_write_packet, .write_packet = caf_write_packet,
caf_write_trailer, .write_trailer = caf_write_trailer,
.codec_tag= (const AVCodecTag* const []){ff_codec_caf_tags, 0}, .codec_tag= (const AVCodecTag* const []){ff_codec_caf_tags, 0},
}; };
...@@ -57,7 +57,6 @@ static int crc_write_trailer(struct AVFormatContext *s) ...@@ -57,7 +57,6 @@ static int crc_write_trailer(struct AVFormatContext *s)
AVOutputFormat ff_crc_muxer = { AVOutputFormat ff_crc_muxer = {
.name = "crc", .name = "crc",
.long_name = NULL_IF_CONFIG_SMALL("CRC testing format"), .long_name = NULL_IF_CONFIG_SMALL("CRC testing format"),
.extensions = "",
.priv_data_size = sizeof(CRCState), .priv_data_size = sizeof(CRCState),
.audio_codec = CODEC_ID_PCM_S16LE, .audio_codec = CODEC_ID_PCM_S16LE,
.video_codec = CODEC_ID_RAWVIDEO, .video_codec = CODEC_ID_RAWVIDEO,
......
...@@ -244,7 +244,6 @@ static int ffm_write_trailer(AVFormatContext *s) ...@@ -244,7 +244,6 @@ static int ffm_write_trailer(AVFormatContext *s)
AVOutputFormat ff_ffm_muxer = { AVOutputFormat ff_ffm_muxer = {
.name = "ffm", .name = "ffm",
.long_name = NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"), .long_name = NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"),
.mime_type = "",
.extensions = "ffm", .extensions = "ffm",
.priv_data_size = sizeof(FFMContext), .priv_data_size = sizeof(FFMContext),
.audio_codec = CODEC_ID_MP2, .audio_codec = CODEC_ID_MP2,
......
...@@ -36,7 +36,6 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) ...@@ -36,7 +36,6 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
AVOutputFormat ff_framecrc_muxer = { AVOutputFormat ff_framecrc_muxer = {
.name = "framecrc", .name = "framecrc",
.long_name = NULL_IF_CONFIG_SMALL("framecrc testing format"), .long_name = NULL_IF_CONFIG_SMALL("framecrc testing format"),
.extensions = "",
.audio_codec = CODEC_ID_PCM_S16LE, .audio_codec = CODEC_ID_PCM_S16LE,
.video_codec = CODEC_ID_RAWVIDEO, .video_codec = CODEC_ID_RAWVIDEO,
.write_packet = framecrc_write_packet, .write_packet = framecrc_write_packet,
......
...@@ -73,12 +73,10 @@ static int g723_1_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -73,12 +73,10 @@ static int g723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
} }
AVInputFormat ff_g723_1_demuxer = { AVInputFormat ff_g723_1_demuxer = {
"g723_1", .name = "g723_1",
NULL_IF_CONFIG_SMALL("G.723.1 format"), .long_name = NULL_IF_CONFIG_SMALL("G.723.1 format"),
0, .read_header = g723_1_init,
NULL, .read_packet = g723_1_read_packet,
g723_1_init,
g723_1_read_packet,
.extensions = "tco,rco", .extensions = "tco,rco",
.flags = AVFMT_GENERIC_INDEX .flags = AVFMT_GENERIC_INDEX
}; };
...@@ -68,7 +68,6 @@ static int write_trailer(struct AVFormatContext *s) ...@@ -68,7 +68,6 @@ static int write_trailer(struct AVFormatContext *s)
AVOutputFormat ff_md5_muxer = { AVOutputFormat ff_md5_muxer = {
.name = "md5", .name = "md5",
.long_name = NULL_IF_CONFIG_SMALL("MD5 testing format"), .long_name = NULL_IF_CONFIG_SMALL("MD5 testing format"),
.extensions = "",
.priv_data_size = PRIVSIZE, .priv_data_size = PRIVSIZE,
.audio_codec = CODEC_ID_PCM_S16LE, .audio_codec = CODEC_ID_PCM_S16LE,
.video_codec = CODEC_ID_RAWVIDEO, .video_codec = CODEC_ID_RAWVIDEO,
...@@ -98,7 +97,6 @@ static int framemd5_write_packet(struct AVFormatContext *s, AVPacket *pkt) ...@@ -98,7 +97,6 @@ static int framemd5_write_packet(struct AVFormatContext *s, AVPacket *pkt)
AVOutputFormat ff_framemd5_muxer = { AVOutputFormat ff_framemd5_muxer = {
.name = "framemd5", .name = "framemd5",
.long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing format"), .long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing format"),
.extensions = "",
.priv_data_size = PRIVSIZE, .priv_data_size = PRIVSIZE,
.audio_codec = CODEC_ID_PCM_S16LE, .audio_codec = CODEC_ID_PCM_S16LE,
.video_codec = CODEC_ID_RAWVIDEO, .video_codec = CODEC_ID_RAWVIDEO,
......
...@@ -42,13 +42,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -42,13 +42,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
} }
AVOutputFormat ff_mkvtimestamp_v2_muxer = { AVOutputFormat ff_mkvtimestamp_v2_muxer = {
"mkvtimestamp_v2", .name = "mkvtimestamp_v2",
NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"), .long_name = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
NULL, .audio_codec = CODEC_ID_NONE,
"", .video_codec = CODEC_ID_RAWVIDEO,
0, .write_header = write_header,
CODEC_ID_NONE, .write_packet = write_packet,
CODEC_ID_RAWVIDEO,
write_header,
write_packet,
}; };
...@@ -85,7 +85,6 @@ static int vc1test_write_trailer(AVFormatContext *s) ...@@ -85,7 +85,6 @@ static int vc1test_write_trailer(AVFormatContext *s)
AVOutputFormat ff_vc1t_muxer = { AVOutputFormat ff_vc1t_muxer = {
.name = "rcv", .name = "rcv",
.long_name = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"), .long_name = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
.mime_type = "",
.extensions = "rcv", .extensions = "rcv",
.priv_data_size = sizeof(RCVContext), .priv_data_size = sizeof(RCVContext),
.audio_codec = CODEC_ID_NONE, .audio_codec = CODEC_ID_NONE,
......
...@@ -181,7 +181,6 @@ static int yuv4_write_header(AVFormatContext *s) ...@@ -181,7 +181,6 @@ static int yuv4_write_header(AVFormatContext *s)
AVOutputFormat ff_yuv4mpegpipe_muxer = { AVOutputFormat ff_yuv4mpegpipe_muxer = {
.name = "yuv4mpegpipe", .name = "yuv4mpegpipe",
.long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe format"), .long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe format"),
.mime_type = "",
.extensions = "y4m", .extensions = "y4m",
.priv_data_size = sizeof(int), .priv_data_size = sizeof(int),
.audio_codec = CODEC_ID_NONE, .audio_codec = CODEC_ID_NONE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment