Commit 30b4ee79 authored by Diego Biurrun's avatar Diego Biurrun
Browse files

Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations.

parent 9ff6d079
......@@ -164,13 +164,12 @@ static const AVClass alsa_demuxer_class = {
};
AVInputFormat ff_alsa_demuxer = {
"alsa",
NULL_IF_CONFIG_SMALL("ALSA audio input"),
sizeof(AlsaData),
NULL,
audio_read_header,
audio_read_packet,
ff_alsa_close,
.flags = AVFMT_NOFILE,
.priv_class = &alsa_demuxer_class,
.name = "alsa",
.long_name = NULL_IF_CONFIG_SMALL("ALSA audio input"),
.priv_data_size = sizeof(AlsaData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
.read_close = ff_alsa_close,
.flags = AVFMT_NOFILE,
.priv_class = &alsa_demuxer_class,
};
......@@ -102,15 +102,13 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
}
AVOutputFormat ff_alsa_muxer = {
"alsa",
NULL_IF_CONFIG_SMALL("ALSA audio output"),
"",
"",
sizeof(AlsaData),
DEFAULT_CODEC_ID,
CODEC_ID_NONE,
audio_write_header,
audio_write_packet,
ff_alsa_close,
.flags = AVFMT_NOFILE,
.name = "alsa",
.long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"),
.priv_data_size = sizeof(AlsaData),
.audio_codec = DEFAULT_CODEC_ID,
.video_codec = CODEC_ID_NONE,
.write_header = audio_write_header,
.write_packet = audio_write_packet,
.write_trailer = ff_alsa_close,
.flags = AVFMT_NOFILE,
};
......@@ -345,13 +345,12 @@ static const AVClass bktr_class = {
};
AVInputFormat ff_bktr_demuxer = {
"bktr",
NULL_IF_CONFIG_SMALL("video grab"),
sizeof(VideoData),
NULL,
grab_read_header,
grab_read_packet,
grab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &bktr_class,
.name = "bktr",
.long_name = NULL_IF_CONFIG_SMALL("video grab"),
.priv_data_size = sizeof(VideoData),
.read_header = grab_read_header,
.read_packet = grab_read_packet,
.read_close = grab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &bktr_class,
};
......@@ -326,13 +326,12 @@ static const AVClass jack_indev_class = {
};
AVInputFormat ff_jack_demuxer = {
"jack",
NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
sizeof(JackData),
NULL,
audio_read_header,
audio_read_packet,
audio_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &jack_indev_class,
.name = "jack",
.long_name = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
.priv_data_size = sizeof(JackData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
.read_close = audio_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &jack_indev_class,
};
......@@ -295,33 +295,30 @@ static const AVClass oss_demuxer_class = {
};
AVInputFormat ff_oss_demuxer = {
"oss",
NULL_IF_CONFIG_SMALL("Open Sound System capture"),
sizeof(AudioData),
NULL,
audio_read_header,
audio_read_packet,
audio_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &oss_demuxer_class,
.name = "oss",
.long_name = NULL_IF_CONFIG_SMALL("Open Sound System capture"),
.priv_data_size = sizeof(AudioData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
.read_close = audio_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &oss_demuxer_class,
};
#endif
#if CONFIG_OSS_OUTDEV
AVOutputFormat ff_oss_muxer = {
"oss",
NULL_IF_CONFIG_SMALL("Open Sound System playback"),
"",
"",
sizeof(AudioData),
.name = "oss",
.long_name = NULL_IF_CONFIG_SMALL("Open Sound System playback"),
.priv_data_size = sizeof(AudioData),
/* XXX: we make the assumption that the soundcard accepts this format */
/* XXX: find better solution with "preinit" method, needed also in
other formats */
AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE),
CODEC_ID_NONE,
audio_write_header,
audio_write_packet,
audio_write_trailer,
.flags = AVFMT_NOFILE,
.audio_codec = AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE),
.video_codec = CODEC_ID_NONE,
.write_header = audio_write_header,
.write_packet = audio_write_packet,
.write_trailer = audio_write_trailer,
.flags = AVFMT_NOFILE,
};
#endif
......@@ -354,14 +354,13 @@ static const AVClass v4l_class = {
};
AVInputFormat ff_v4l_demuxer = {
"video4linux",
NULL_IF_CONFIG_SMALL("Video4Linux device grab"),
sizeof(VideoData),
NULL,
grab_read_header,
grab_read_packet,
grab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &v4l_class,
.name = "video4linux",
.long_name = NULL_IF_CONFIG_SMALL("Video4Linux device grab"),
.priv_data_size = sizeof(VideoData),
.read_header = grab_read_header,
.read_packet = grab_read_packet,
.read_close = grab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &v4l_class,
};
#endif /* FF_API_V4L */
......@@ -725,13 +725,12 @@ static const AVClass v4l2_class = {
};
AVInputFormat ff_v4l2_demuxer = {
"video4linux2",
NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
sizeof(struct video_data),
NULL,
v4l2_read_header,
v4l2_read_packet,
v4l2_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &v4l2_class,
.name = "video4linux2",
.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
.priv_data_size = sizeof(struct video_data),
.read_header = v4l2_read_header,
.read_packet = v4l2_read_packet,
.read_close = v4l2_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &v4l2_class,
};
......@@ -470,13 +470,12 @@ static const AVClass vfw_class = {
};
AVInputFormat ff_vfwcap_demuxer = {
"vfwcap",
NULL_IF_CONFIG_SMALL("VFW video capture"),
sizeof(struct vfw_ctx),
NULL,
vfw_read_header,
vfw_read_packet,
vfw_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &vfw_class,
.name = "vfwcap",
.long_name = NULL_IF_CONFIG_SMALL("VfW video capture"),
.priv_data_size = sizeof(struct vfw_ctx),
.read_header = vfw_read_header,
.read_packet = vfw_read_packet,
.read_close = vfw_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &vfw_class,
};
......@@ -598,15 +598,13 @@ static const AVClass x11_class = {
};
/** x11 grabber device demuxer declaration */
AVInputFormat ff_x11_grab_device_demuxer =
{
"x11grab",
NULL_IF_CONFIG_SMALL("X11grab"),
sizeof(struct x11_grab),
NULL,
x11grab_read_header,
x11grab_read_packet,
x11grab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &x11_class,
AVInputFormat ff_x11_grab_device_demuxer = {
.name = "x11grab",
.long_name = NULL_IF_CONFIG_SMALL("X11grab"),
.priv_data_size = sizeof(struct x11_grab),
.read_header = x11grab_read_header,
.read_packet = x11grab_read_packet,
.read_close = x11grab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &x11_class,
};
......@@ -80,17 +80,14 @@ AVInputFormat ff_daud_demuxer = {
#endif
#if CONFIG_DAUD_MUXER
AVOutputFormat ff_daud_muxer =
{
"daud",
NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
NULL,
"302",
0,
CODEC_ID_PCM_S24DAUD,
CODEC_ID_NONE,
daud_write_header,
daud_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
AVOutputFormat ff_daud_muxer = {
.name = "daud",
.long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
.extensions = "302",
.audio_codec = CODEC_ID_PCM_S24DAUD,
.video_codec = CODEC_ID_NONE,
.write_header = daud_write_header,
.write_packet = daud_write_packet,
.flags = AVFMT_NOTIMESTAMPS,
};
#endif
......@@ -35,15 +35,12 @@ static int roq_write_header(struct AVFormatContext *s)
return 0;
}
AVOutputFormat ff_roq_muxer =
{
"RoQ",
NULL_IF_CONFIG_SMALL("raw id RoQ format"),
NULL,
"roq",
0,
CODEC_ID_ROQ_DPCM,
CODEC_ID_ROQ,
roq_write_header,
ff_raw_write_packet,
AVOutputFormat ff_roq_muxer = {
.name = "RoQ",
.long_name = NULL_IF_CONFIG_SMALL("raw id RoQ format"),
.extensions = "roq",
.audio_codec = CODEC_ID_ROQ_DPCM,
.video_codec = CODEC_ID_ROQ,
.write_header = roq_write_header,
.write_packet = ff_raw_write_packet,
};
......@@ -54,26 +54,24 @@ static const AVOption pcm_options[] = {
{ NULL },
};
#define PCMDEF(name, long_name, ext, codec) \
static const AVClass name ## _demuxer_class = {\
.class_name = #name " demuxer",\
.item_name = av_default_item_name,\
.option = pcm_options,\
.version = LIBAVUTIL_VERSION_INT,\
};\
AVInputFormat ff_pcm_ ## name ## _demuxer = {\
#name,\
NULL_IF_CONFIG_SMALL(long_name),\
sizeof(RawAudioDemuxerContext),\
NULL,\
ff_raw_read_header,\
raw_read_packet,\
NULL,\
pcm_read_seek,\
.flags= AVFMT_GENERIC_INDEX,\
.extensions = ext,\
.value = codec,\
.priv_class = &name ## _demuxer_class,\
#define PCMDEF(name_, long_name_, ext, codec) \
static const AVClass name_ ## _demuxer_class = { \
.class_name = #name_ " demuxer", \
.item_name = av_default_item_name, \
.option = pcm_options, \
.version = LIBAVUTIL_VERSION_INT, \
}; \
AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
.name = #name_, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.priv_data_size = sizeof(RawAudioDemuxerContext), \
.read_header = ff_raw_read_header, \
.read_packet = raw_read_packet, \
.read_seek = pcm_read_seek, \
.flags = AVFMT_GENERIC_INDEX, \
.extensions = ext, \
.value = codec, \
.priv_class = &name_ ## _demuxer_class, \
};
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
......
......@@ -22,18 +22,15 @@
#include "avformat.h"
#include "rawenc.h"
#define PCMDEF(name, long_name, ext, codec) \
AVOutputFormat ff_pcm_ ## name ## _muxer = {\
#name,\
NULL_IF_CONFIG_SMALL(long_name),\
NULL,\
ext,\
0,\
codec,\
CODEC_ID_NONE,\
NULL,\
ff_raw_write_packet,\
.flags= AVFMT_NOTIMESTAMPS,\
#define PCMDEF(name_, long_name_, ext, codec) \
AVOutputFormat ff_pcm_ ## name_ ## _muxer = { \
.name = #name_, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.extensions = ext, \
.audio_codec = codec, \
.video_codec = CODEC_ID_NONE, \
.write_packet = ff_raw_write_packet, \
.flags = AVFMT_NOTIMESTAMPS, \
};
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
......
......@@ -90,12 +90,10 @@ next_chunk:
return 0;
}
AVInputFormat ff_txd_demuxer =
{
"txd",
NULL_IF_CONFIG_SMALL("Renderware TeXture Dictionary"),
0,
txd_probe,
txd_read_header,
txd_read_packet,
AVInputFormat ff_txd_demuxer = {
.name = "txd",
.long_name = NULL_IF_CONFIG_SMALL("Renderware TeXture Dictionary"),
.read_probe = txd_probe,
.read_header = txd_read_header,
.read_packet = txd_read_packet,
};
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