Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations.

pull/2/head
Diego Biurrun 13 years ago
parent 9ff6d0791b
commit 30b4ee7901
  1. 13
      libavdevice/alsa-audio-dec.c
  2. 18
      libavdevice/alsa-audio-enc.c
  3. 13
      libavdevice/bktr.c
  4. 13
      libavdevice/jack_audio.c
  5. 31
      libavdevice/oss_audio.c
  6. 13
      libavdevice/v4l.c
  7. 13
      libavdevice/v4l2.c
  8. 13
      libavdevice/vfwcap.c
  9. 16
      libavdevice/x11grab.c
  10. 19
      libavformat/daud.c
  11. 19
      libavformat/idroqenc.c
  12. 24
      libavformat/pcmdec.c
  13. 19
      libavformat/pcmenc.c
  14. 14
      libavformat/txd.c

@ -164,13 +164,12 @@ static const AVClass alsa_demuxer_class = {
}; };
AVInputFormat ff_alsa_demuxer = { AVInputFormat ff_alsa_demuxer = {
"alsa", .name = "alsa",
NULL_IF_CONFIG_SMALL("ALSA audio input"), .long_name = NULL_IF_CONFIG_SMALL("ALSA audio input"),
sizeof(AlsaData), .priv_data_size = sizeof(AlsaData),
NULL, .read_header = audio_read_header,
audio_read_header, .read_packet = audio_read_packet,
audio_read_packet, .read_close = ff_alsa_close,
ff_alsa_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &alsa_demuxer_class, .priv_class = &alsa_demuxer_class,
}; };

@ -102,15 +102,13 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
} }
AVOutputFormat ff_alsa_muxer = { AVOutputFormat ff_alsa_muxer = {
"alsa", .name = "alsa",
NULL_IF_CONFIG_SMALL("ALSA audio output"), .long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"),
"", .priv_data_size = sizeof(AlsaData),
"", .audio_codec = DEFAULT_CODEC_ID,
sizeof(AlsaData), .video_codec = CODEC_ID_NONE,
DEFAULT_CODEC_ID, .write_header = audio_write_header,
CODEC_ID_NONE, .write_packet = audio_write_packet,
audio_write_header, .write_trailer = ff_alsa_close,
audio_write_packet,
ff_alsa_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
}; };

@ -345,13 +345,12 @@ static const AVClass bktr_class = {
}; };
AVInputFormat ff_bktr_demuxer = { AVInputFormat ff_bktr_demuxer = {
"bktr", .name = "bktr",
NULL_IF_CONFIG_SMALL("video grab"), .long_name = NULL_IF_CONFIG_SMALL("video grab"),
sizeof(VideoData), .priv_data_size = sizeof(VideoData),
NULL, .read_header = grab_read_header,
grab_read_header, .read_packet = grab_read_packet,
grab_read_packet, .read_close = grab_read_close,
grab_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &bktr_class, .priv_class = &bktr_class,
}; };

@ -326,13 +326,12 @@ static const AVClass jack_indev_class = {
}; };
AVInputFormat ff_jack_demuxer = { AVInputFormat ff_jack_demuxer = {
"jack", .name = "jack",
NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"), .long_name = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
sizeof(JackData), .priv_data_size = sizeof(JackData),
NULL, .read_header = audio_read_header,
audio_read_header, .read_packet = audio_read_packet,
audio_read_packet, .read_close = audio_read_close,
audio_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &jack_indev_class, .priv_class = &jack_indev_class,
}; };

@ -295,13 +295,12 @@ static const AVClass oss_demuxer_class = {
}; };
AVInputFormat ff_oss_demuxer = { AVInputFormat ff_oss_demuxer = {
"oss", .name = "oss",
NULL_IF_CONFIG_SMALL("Open Sound System capture"), .long_name = NULL_IF_CONFIG_SMALL("Open Sound System capture"),
sizeof(AudioData), .priv_data_size = sizeof(AudioData),
NULL, .read_header = audio_read_header,
audio_read_header, .read_packet = audio_read_packet,
audio_read_packet, .read_close = audio_read_close,
audio_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &oss_demuxer_class, .priv_class = &oss_demuxer_class,
}; };
@ -309,19 +308,17 @@ AVInputFormat ff_oss_demuxer = {
#if CONFIG_OSS_OUTDEV #if CONFIG_OSS_OUTDEV
AVOutputFormat ff_oss_muxer = { AVOutputFormat ff_oss_muxer = {
"oss", .name = "oss",
NULL_IF_CONFIG_SMALL("Open Sound System playback"), .long_name = NULL_IF_CONFIG_SMALL("Open Sound System playback"),
"", .priv_data_size = sizeof(AudioData),
"",
sizeof(AudioData),
/* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: we make the assumption that the soundcard accepts this format */
/* XXX: find better solution with "preinit" method, needed also in /* XXX: find better solution with "preinit" method, needed also in
other formats */ other formats */
AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), .audio_codec = AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE),
CODEC_ID_NONE, .video_codec = CODEC_ID_NONE,
audio_write_header, .write_header = audio_write_header,
audio_write_packet, .write_packet = audio_write_packet,
audio_write_trailer, .write_trailer = audio_write_trailer,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
}; };
#endif #endif

@ -354,13 +354,12 @@ static const AVClass v4l_class = {
}; };
AVInputFormat ff_v4l_demuxer = { AVInputFormat ff_v4l_demuxer = {
"video4linux", .name = "video4linux",
NULL_IF_CONFIG_SMALL("Video4Linux device grab"), .long_name = NULL_IF_CONFIG_SMALL("Video4Linux device grab"),
sizeof(VideoData), .priv_data_size = sizeof(VideoData),
NULL, .read_header = grab_read_header,
grab_read_header, .read_packet = grab_read_packet,
grab_read_packet, .read_close = grab_read_close,
grab_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &v4l_class, .priv_class = &v4l_class,
}; };

@ -725,13 +725,12 @@ static const AVClass v4l2_class = {
}; };
AVInputFormat ff_v4l2_demuxer = { AVInputFormat ff_v4l2_demuxer = {
"video4linux2", .name = "video4linux2",
NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"), .long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
sizeof(struct video_data), .priv_data_size = sizeof(struct video_data),
NULL, .read_header = v4l2_read_header,
v4l2_read_header, .read_packet = v4l2_read_packet,
v4l2_read_packet, .read_close = v4l2_read_close,
v4l2_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &v4l2_class, .priv_class = &v4l2_class,
}; };

@ -470,13 +470,12 @@ static const AVClass vfw_class = {
}; };
AVInputFormat ff_vfwcap_demuxer = { AVInputFormat ff_vfwcap_demuxer = {
"vfwcap", .name = "vfwcap",
NULL_IF_CONFIG_SMALL("VFW video capture"), .long_name = NULL_IF_CONFIG_SMALL("VfW video capture"),
sizeof(struct vfw_ctx), .priv_data_size = sizeof(struct vfw_ctx),
NULL, .read_header = vfw_read_header,
vfw_read_header, .read_packet = vfw_read_packet,
vfw_read_packet, .read_close = vfw_read_close,
vfw_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &vfw_class, .priv_class = &vfw_class,
}; };

@ -598,15 +598,13 @@ static const AVClass x11_class = {
}; };
/** x11 grabber device demuxer declaration */ /** x11 grabber device demuxer declaration */
AVInputFormat ff_x11_grab_device_demuxer = AVInputFormat ff_x11_grab_device_demuxer = {
{ .name = "x11grab",
"x11grab", .long_name = NULL_IF_CONFIG_SMALL("X11grab"),
NULL_IF_CONFIG_SMALL("X11grab"), .priv_data_size = sizeof(struct x11_grab),
sizeof(struct x11_grab), .read_header = x11grab_read_header,
NULL, .read_packet = x11grab_read_packet,
x11grab_read_header, .read_close = x11grab_read_close,
x11grab_read_packet,
x11grab_read_close,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
.priv_class = &x11_class, .priv_class = &x11_class,
}; };

@ -80,17 +80,14 @@ AVInputFormat ff_daud_demuxer = {
#endif #endif
#if CONFIG_DAUD_MUXER #if CONFIG_DAUD_MUXER
AVOutputFormat ff_daud_muxer = AVOutputFormat ff_daud_muxer = {
{ .name = "daud",
"daud", .long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
NULL_IF_CONFIG_SMALL("D-Cinema audio format"), .extensions = "302",
NULL, .audio_codec = CODEC_ID_PCM_S24DAUD,
"302", .video_codec = CODEC_ID_NONE,
0, .write_header = daud_write_header,
CODEC_ID_PCM_S24DAUD, .write_packet = daud_write_packet,
CODEC_ID_NONE,
daud_write_header,
daud_write_packet,
.flags = AVFMT_NOTIMESTAMPS, .flags = AVFMT_NOTIMESTAMPS,
}; };
#endif #endif

@ -35,15 +35,12 @@ static int roq_write_header(struct AVFormatContext *s)
return 0; return 0;
} }
AVOutputFormat ff_roq_muxer = AVOutputFormat ff_roq_muxer = {
{ .name = "RoQ",
"RoQ", .long_name = NULL_IF_CONFIG_SMALL("raw id RoQ format"),
NULL_IF_CONFIG_SMALL("raw id RoQ format"), .extensions = "roq",
NULL, .audio_codec = CODEC_ID_ROQ_DPCM,
"roq", .video_codec = CODEC_ID_ROQ,
0, .write_header = roq_write_header,
CODEC_ID_ROQ_DPCM, .write_packet = ff_raw_write_packet,
CODEC_ID_ROQ,
roq_write_header,
ff_raw_write_packet,
}; };

@ -54,26 +54,24 @@ static const AVOption pcm_options[] = {
{ NULL }, { NULL },
}; };
#define PCMDEF(name, long_name, ext, codec) \ #define PCMDEF(name_, long_name_, ext, codec) \
static const AVClass name ## _demuxer_class = {\ static const AVClass name_ ## _demuxer_class = { \
.class_name = #name " demuxer",\ .class_name = #name_ " demuxer", \
.item_name = av_default_item_name, \ .item_name = av_default_item_name, \
.option = pcm_options, \ .option = pcm_options, \
.version = LIBAVUTIL_VERSION_INT, \ .version = LIBAVUTIL_VERSION_INT, \
}; \ }; \
AVInputFormat ff_pcm_ ## name ## _demuxer = {\ AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
#name,\ .name = #name_, \
NULL_IF_CONFIG_SMALL(long_name),\ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
sizeof(RawAudioDemuxerContext),\ .priv_data_size = sizeof(RawAudioDemuxerContext), \
NULL,\ .read_header = ff_raw_read_header, \
ff_raw_read_header,\ .read_packet = raw_read_packet, \
raw_read_packet,\ .read_seek = pcm_read_seek, \
NULL,\
pcm_read_seek,\
.flags = AVFMT_GENERIC_INDEX, \ .flags = AVFMT_GENERIC_INDEX, \
.extensions = ext, \ .extensions = ext, \
.value = codec, \ .value = codec, \
.priv_class = &name ## _demuxer_class,\ .priv_class = &name_ ## _demuxer_class, \
}; };
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format", PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",

@ -22,17 +22,14 @@
#include "avformat.h" #include "avformat.h"
#include "rawenc.h" #include "rawenc.h"
#define PCMDEF(name, long_name, ext, codec) \ #define PCMDEF(name_, long_name_, ext, codec) \
AVOutputFormat ff_pcm_ ## name ## _muxer = {\ AVOutputFormat ff_pcm_ ## name_ ## _muxer = { \
#name,\ .name = #name_, \
NULL_IF_CONFIG_SMALL(long_name),\ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
NULL,\ .extensions = ext, \
ext,\ .audio_codec = codec, \
0,\ .video_codec = CODEC_ID_NONE, \
codec,\ .write_packet = ff_raw_write_packet, \
CODEC_ID_NONE,\
NULL,\
ff_raw_write_packet,\
.flags = AVFMT_NOTIMESTAMPS, \ .flags = AVFMT_NOTIMESTAMPS, \
}; };

@ -90,12 +90,10 @@ next_chunk:
return 0; return 0;
} }
AVInputFormat ff_txd_demuxer = AVInputFormat ff_txd_demuxer = {
{ .name = "txd",
"txd", .long_name = NULL_IF_CONFIG_SMALL("Renderware TeXture Dictionary"),
NULL_IF_CONFIG_SMALL("Renderware TeXture Dictionary"), .read_probe = txd_probe,
0, .read_header = txd_read_header,
txd_probe, .read_packet = txd_read_packet,
txd_read_header,
txd_read_packet,
}; };

Loading…
Cancel
Save