]> git.sesse.net Git - ffmpeg/commitdiff
Use more designated initializers.
authorPaul B Mahol <onemda@gmail.com>
Fri, 30 Dec 2011 19:00:53 +0000 (20:00 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 30 Dec 2011 19:00:53 +0000 (20:00 +0100)
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.

21 files changed:
libavcodec/bintext.c
libavcodec/diracdec.c
libavcodec/flashsv2enc.c
libavcodec/g729dec.c
libavcodec/j2kdec.c
libavcodec/j2kenc.c
libavcodec/libaacplus.c
libavcodec/libopenjpegenc.c
libavcodec/msvideo1enc.c
libavcodec/pictordec.c
libavcodec/proresenc.c
libavcodec/sonic.c
libavformat/cafenc.c
libavformat/crcenc.c
libavformat/ffmenc.c
libavformat/framecrcenc.c
libavformat/g723_1.c
libavformat/md5enc.c
libavformat/mkvtimestamp_v2.c
libavformat/vc1testenc.c
libavformat/yuv4mpeg.c

index df37feea1298738a5603fe0511b90f7daafef1e5..0b46dd444e5ce5fb5b1832440cba72dbf7721a17 100644 (file)
@@ -211,40 +211,37 @@ static av_cold int decode_end(AVCodecContext *avctx)
 }
 
 AVCodec ff_bintext_decoder = {
-    "bintext",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_BINTEXT,
-    sizeof(XbinContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
+    .name           = "bintext",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_BINTEXT,
+    .priv_data_size = sizeof(XbinContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("Binary text"),
 };
 
 AVCodec ff_xbin_decoder = {
-    "xbin",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_XBIN,
-    sizeof(XbinContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
+    .name           = "xbin",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_XBIN,
+    .priv_data_size = sizeof(XbinContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"),
 };
 
 AVCodec ff_idf_decoder = {
-    "idf",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_IDF,
-    sizeof(XbinContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
+    .name           = "idf",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_IDF,
+    .priv_data_size = sizeof(XbinContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"),
 };
index 1ace7bd42556a4d77feb42d9398d2445b7bc2d05..1bc73349e018a2828fb7764afd01190b4fd4f94c 100644 (file)
@@ -1898,7 +1898,6 @@ AVCodec ff_dirac_decoder = {
     .id             = CODEC_ID_DIRAC,
     .priv_data_size = sizeof(DiracContext),
     .init           = dirac_decode_init,
-    .encode         = NULL,
     .close          = dirac_decode_end,
     .decode         = dirac_decode_frame,
     .capabilities   = CODEC_CAP_DELAY,
index 27bd87816b01e9a210142766b4aad8fb3270e7c2..9f7017e033f420ea21b490818b77b83a9a0f66f3 100644 (file)
@@ -894,13 +894,13 @@ static av_cold int flashsv2_encode_end(AVCodecContext * avctx)
 }
 
 AVCodec ff_flashsv2_encoder = {
-    "flashsv2",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_FLASHSV2,
-    sizeof(FlashSV2Context),
-    flashsv2_encode_init,
-    flashsv2_encode_frame,
-    flashsv2_encode_end,
+    .name           = "flashsv2",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_FLASHSV2,
+    .priv_data_size = sizeof(FlashSV2Context),
+    .init           = flashsv2_encode_init,
+    .encode         = flashsv2_encode_frame,
+    .close          = flashsv2_encode_end,
     .pix_fmts = (enum PixelFormat[]) {PIX_FMT_BGR24, PIX_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"),
     .capabilities   =  CODEC_CAP_EXPERIMENTAL,
index 4714f19554974dc6b652cc2b07d15214aa990535..191794b6e71e33e9e9038b20ce06ef55ca46d73f 100644 (file)
@@ -714,14 +714,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
 
 AVCodec ff_g729_decoder =
 {
-    "g729",
-    AVMEDIA_TYPE_AUDIO,
-    CODEC_ID_G729,
-    sizeof(G729Context),
-    decoder_init,
-    NULL,
-    NULL,
-    decode_frame,
+    .name           = "g729",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_G729,
+    .priv_data_size = sizeof(G729Context),
+    .init           = decoder_init,
+    .decode         = decode_frame,
     .capabilities = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("G.729"),
 };
index e35c97d86003aa5274af3f10bdc42479a189bda0..d605b13ea73dd2bfa45b0f411c00129a484a4c5f 100644 (file)
@@ -1068,14 +1068,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
 }
 
 AVCodec ff_jpeg2000_decoder = {
-    "j2k",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_JPEG2000,
-    sizeof(J2kDecoderContext),
-    j2kdec_init,
-    NULL,
-    decode_end,
-    decode_frame,
+    .name           = "j2k",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_JPEG2000,
+    .priv_data_size = sizeof(J2kDecoderContext),
+    .init           = j2kdec_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
     .capabilities = CODEC_CAP_EXPERIMENTAL,
     .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
     .pix_fmts =
index 58789c9a86e77dd5d9b08534c27d25f58d138a86..37e31a9c691cecf066818ee1f1929a0941830243 100644 (file)
@@ -1036,13 +1036,13 @@ static int j2kenc_destroy(AVCodecContext *avctx)
 }
 
 AVCodec ff_jpeg2000_encoder = {
-    "j2k",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_JPEG2000,
-    sizeof(J2kEncoderContext),
-    j2kenc_init,
-    encode_frame,
-    j2kenc_destroy,
+    .name           = "j2k",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_JPEG2000,
+    .priv_data_size = sizeof(J2kEncoderContext),
+    .init           = j2kenc_init,
+    .encode         = encode_frame,
+    .close          = j2kenc_destroy,
     .capabilities= CODEC_CAP_EXPERIMENTAL,
     .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
     .pix_fmts =
index a5ededbf399b1a57dcc991dd89891dc9cdafee83..3ab4e0362c330bb6cc31c3b44734ad93bd33c8ec 100644 (file)
@@ -122,13 +122,13 @@ static av_cold int aacPlus_encode_close(AVCodecContext *avctx)
 }
 
 AVCodec ff_libaacplus_encoder = {
-    "libaacplus",
-    AVMEDIA_TYPE_AUDIO,
-    CODEC_ID_AAC,
-    sizeof(aacPlusAudioContext),
-    aacPlus_encode_init,
-    aacPlus_encode_frame,
-    aacPlus_encode_close,
+    .name           = "libaacplus",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_AAC,
+    .priv_data_size = sizeof(aacPlusAudioContext),
+    .init           = aacPlus_encode_init,
+    .encode         = aacPlus_encode_frame,
+    .close          = aacPlus_encode_close,
     .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)"),
 };
index 6b37fb08cf1614a3b74709cdec13a8acbdbbe593..c088acccc9f410392dc00edce2268e82197e8366 100644 (file)
@@ -365,7 +365,6 @@ AVCodec ff_libopenjpeg_encoder = {
     .init           = libopenjpeg_encode_init,
     .encode         = libopenjpeg_encode_frame,
     .close          = libopenjpeg_encode_close,
-    .decode         = NULL,
     .capabilities   = 0,
     .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24,PIX_FMT_RGBA,PIX_FMT_GRAY8,
                                            PIX_FMT_YUV420P,PIX_FMT_YUV422P,PIX_FMT_YUVA420P,
index 09cc7a196d357c3807ef51ff0c840bffe342f8c3..401ac2a2ae89c0fe5d094e135d89cbd43dd0a075 100644 (file)
@@ -290,13 +290,13 @@ static av_cold int encode_end(AVCodecContext *avctx)
 }
 
 AVCodec ff_msvideo1_encoder = {
-    "msvideo1",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_MSVIDEO1,
-    sizeof(Msvideo1EncContext),
-    encode_init,
-    encode_frame,
-    encode_end,
+    .name           = "msvideo1",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_MSVIDEO1,
+    .priv_data_size = sizeof(Msvideo1EncContext),
+    .init           = encode_init,
+    .encode         = encode_frame,
+    .close          = encode_end,
     .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB555, PIX_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"),
 };
index 7c95f89bbde8ade77166b20a9881ba9f71237774..b3b5f7ef4fd06901ea91cc814f814a37bffefa74 100644 (file)
@@ -253,7 +253,7 @@ AVCodec ff_pictor_decoder = {
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = CODEC_ID_PICTOR,
     .priv_data_size = sizeof(PicContext),
-    decode_init,
+    .init           = decode_init,
     .close          = decode_end,
     .decode         = decode_frame,
     .capabilities   = CODEC_CAP_DR1,
index 8cdcff3c49c6f8cc531068a21ba4e0bbb5a64485..09678a002f584395d27acdd08a438418c2e28ccb 100644 (file)
@@ -594,6 +594,5 @@ AVCodec ff_prores_encoder = {
     .encode         = prores_encode_frame,
     .pix_fmts       = (const enum PixelFormat[]){PIX_FMT_YUV422P10, PIX_FMT_NONE},
     .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes"),
-    .capabilities   = 0,
     .profiles       = profiles
 };
index e7cdb3ba8141ee8182aa37d85f83f27c082c8232..71641f95ffa78baf085411db3194efd9200a7be6 100644 (file)
@@ -936,42 +936,39 @@ static int sonic_decode_frame(AVCodecContext *avctx,
 }
 
 AVCodec ff_sonic_decoder = {
-    "sonic",
-    AVMEDIA_TYPE_AUDIO,
-    CODEC_ID_SONIC,
-    sizeof(SonicContext),
-    sonic_decode_init,
-    NULL,
-    sonic_decode_close,
-    sonic_decode_frame,
+    .name           = "sonic",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_SONIC,
+    .priv_data_size = sizeof(SonicContext),
+    .init           = sonic_decode_init,
+    .close          = sonic_decode_close,
+    .decode         = sonic_decode_frame,
     .long_name = NULL_IF_CONFIG_SMALL("Sonic"),
 };
 #endif /* CONFIG_SONIC_DECODER */
 
 #if CONFIG_SONIC_ENCODER
 AVCodec ff_sonic_encoder = {
-    "sonic",
-    AVMEDIA_TYPE_AUDIO,
-    CODEC_ID_SONIC,
-    sizeof(SonicContext),
-    sonic_encode_init,
-    sonic_encode_frame,
-    sonic_encode_close,
-    NULL,
+    .name           = "sonic",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_SONIC,
+    .priv_data_size = sizeof(SonicContext),
+    .init           = sonic_encode_init,
+    .encode         = sonic_encode_frame,
+    .close          = sonic_encode_close,
     .long_name = NULL_IF_CONFIG_SMALL("Sonic"),
 };
 #endif
 
 #if CONFIG_SONIC_LS_ENCODER
 AVCodec ff_sonic_ls_encoder = {
-    "sonicls",
-    AVMEDIA_TYPE_AUDIO,
-    CODEC_ID_SONIC_LS,
-    sizeof(SonicContext),
-    sonic_encode_init,
-    sonic_encode_frame,
-    sonic_encode_close,
-    NULL,
+    .name           = "sonicls",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_SONIC_LS,
+    .priv_data_size = sizeof(SonicContext),
+    .init           = sonic_encode_init,
+    .encode         = sonic_encode_frame,
+    .close          = sonic_encode_close,
     .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
 };
 #endif
index 0dd4b349ca4b4a3de95ce8adf26452a4d8ca512d..699c67df7a0c995582c33c0e96d43d8330fac6d8 100644 (file)
@@ -248,15 +248,15 @@ static int caf_write_trailer(AVFormatContext *s)
 }
 
 AVOutputFormat ff_caf_muxer = {
-    "caf",
-    NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
-    "audio/x-caf",
-    "caf",
-    sizeof(CAFContext),
-    CODEC_ID_PCM_S16BE,
-    CODEC_ID_NONE,
-    caf_write_header,
-    caf_write_packet,
-    caf_write_trailer,
+    .name           = "caf",
+    .long_name      = NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
+    .mime_type      = "audio/x-caf",
+    .extensions     = "caf",
+    .priv_data_size = sizeof(CAFContext),
+    .audio_codec    = CODEC_ID_PCM_S16BE,
+    .video_codec    = CODEC_ID_NONE,
+    .write_header   = caf_write_header,
+    .write_packet   = caf_write_packet,
+    .write_trailer  = caf_write_trailer,
     .codec_tag= (const AVCodecTag* const []){ff_codec_caf_tags, 0},
 };
index d0ca8352d91cacf51b91b837b41e652bd96ea09f..1f5854e08028a7f74ca4250daa1637cca93f6646 100644 (file)
@@ -57,7 +57,6 @@ static int crc_write_trailer(struct AVFormatContext *s)
 AVOutputFormat ff_crc_muxer = {
     .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,
index 7378808567a52abbeaff2761f1d4e087117fe42f..cd4ee613267572c5137204f87febf7bfb37ff39b 100644 (file)
@@ -244,7 +244,6 @@ static int ffm_write_trailer(AVFormatContext *s)
 AVOutputFormat ff_ffm_muxer = {
     .name              = "ffm",
     .long_name         = NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"),
-    .mime_type         = "",
     .extensions        = "ffm",
     .priv_data_size    = sizeof(FFMContext),
     .audio_codec       = CODEC_ID_MP2,
index 5798560cbe5cbe637de91d00e5db9b2d808fa290..8e66a8daf31fd6eda33343edded1dca1245aeb04 100644 (file)
@@ -36,7 +36,6 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 AVOutputFormat ff_framecrc_muxer = {
     .name              = "framecrc",
     .long_name         = NULL_IF_CONFIG_SMALL("framecrc testing format"),
-    .extensions        = "",
     .audio_codec       = CODEC_ID_PCM_S16LE,
     .video_codec       = CODEC_ID_RAWVIDEO,
     .write_packet      = framecrc_write_packet,
index 86ef540edf604b5efb66e532211353cfd5fdc364..00cfe16266a3e891a86695378c29dc95a829155c 100644 (file)
@@ -73,12 +73,10 @@ static int g723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
 }
 
 AVInputFormat ff_g723_1_demuxer = {
-    "g723_1",
-    NULL_IF_CONFIG_SMALL("G.723.1 format"),
-    0,
-    NULL,
-    g723_1_init,
-    g723_1_read_packet,
+    .name        = "g723_1",
+    .long_name   = NULL_IF_CONFIG_SMALL("G.723.1 format"),
+    .read_header = g723_1_init,
+    .read_packet = g723_1_read_packet,
     .extensions = "tco,rco",
     .flags = AVFMT_GENERIC_INDEX
 };
index c18d6e4cbdb82c5e09193d753f6b6194b7886659..052061f039f56421886b577e1e2313512ec186df 100644 (file)
@@ -68,7 +68,6 @@ static int write_trailer(struct AVFormatContext *s)
 AVOutputFormat ff_md5_muxer = {
     .name              = "md5",
     .long_name         = NULL_IF_CONFIG_SMALL("MD5 testing format"),
-    .extensions        = "",
     .priv_data_size    = PRIVSIZE,
     .audio_codec       = CODEC_ID_PCM_S16LE,
     .video_codec       = CODEC_ID_RAWVIDEO,
@@ -98,7 +97,6 @@ static int framemd5_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 AVOutputFormat ff_framemd5_muxer = {
     .name              = "framemd5",
     .long_name         = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing format"),
-    .extensions        = "",
     .priv_data_size    = PRIVSIZE,
     .audio_codec       = CODEC_ID_PCM_S16LE,
     .video_codec       = CODEC_ID_RAWVIDEO,
index f12046005723a79e6de52b476c95d43e8045941d..469b75db4176ec3356c1550b7f504ceab176aa59 100644 (file)
@@ -42,13 +42,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 }
 
 AVOutputFormat ff_mkvtimestamp_v2_muxer = {
-    "mkvtimestamp_v2",
-    NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
-    NULL,
-    "",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_RAWVIDEO,
-    write_header,
-    write_packet,
+    .name         = "mkvtimestamp_v2",
+    .long_name    = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
+    .audio_codec  = CODEC_ID_NONE,
+    .video_codec  = CODEC_ID_RAWVIDEO,
+    .write_header = write_header,
+    .write_packet = write_packet,
 };
index b1ed43d62eeb0e536812568b745640e36e45f962..10b7b64819f6aaa72f2d74d7ec678e117213ad6c 100644 (file)
@@ -85,7 +85,6 @@ static int vc1test_write_trailer(AVFormatContext *s)
 AVOutputFormat ff_vc1t_muxer = {
     .name              = "rcv",
     .long_name         = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
-    .mime_type         = "",
     .extensions        = "rcv",
     .priv_data_size    = sizeof(RCVContext),
     .audio_codec       = CODEC_ID_NONE,
index dad29d8d550404a48b155935d14dde77df552f1e..61c72f5d825d8b23ba91649a49bce6d54855f561 100644 (file)
@@ -181,7 +181,6 @@ static int yuv4_write_header(AVFormatContext *s)
 AVOutputFormat ff_yuv4mpegpipe_muxer = {
     .name              = "yuv4mpegpipe",
     .long_name         = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe format"),
-    .mime_type         = "",
     .extensions        = "y4m",
     .priv_data_size    = sizeof(int),
     .audio_codec       = CODEC_ID_NONE,