From 30b4ee7901ec5dbe24f1c75c0c0b43ba551c858b Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 23 Sep 2011 20:50:11 +0200 Subject: Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations. --- libavdevice/alsa-audio-dec.c | 17 ++++++++--------- libavdevice/alsa-audio-enc.c | 20 +++++++++----------- libavdevice/bktr.c | 17 ++++++++--------- libavdevice/jack_audio.c | 17 ++++++++--------- libavdevice/oss_audio.c | 37 +++++++++++++++++-------------------- libavdevice/v4l.c | 17 ++++++++--------- libavdevice/v4l2.c | 17 ++++++++--------- libavdevice/vfwcap.c | 17 ++++++++--------- libavdevice/x11grab.c | 20 +++++++++----------- 9 files changed, 83 insertions(+), 96 deletions(-) (limited to 'libavdevice') diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c index 05f68d3cdc..8eae021213 100644 --- a/libavdevice/alsa-audio-dec.c +++ b/libavdevice/alsa-audio-dec.c @@ -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, }; diff --git a/libavdevice/alsa-audio-enc.c b/libavdevice/alsa-audio-enc.c index f3782c5ab6..95887c19ed 100644 --- a/libavdevice/alsa-audio-enc.c +++ b/libavdevice/alsa-audio-enc.c @@ -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, }; diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index 7ff46cf8a3..f03cf2f192 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -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, }; diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c index 029ace6dc0..c59a22d113 100644 --- a/libavdevice/jack_audio.c +++ b/libavdevice/jack_audio.c @@ -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, }; diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 6df7f34d7e..c19c67784d 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -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 diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index b0f0452d8e..5c1caf858a 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -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 */ diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 7a501a901c..2ae5a3fe17 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -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, }; diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 47a9ebeb9c..4faf2d937d 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -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, }; diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 5cc32dc20d..1a8a9963ed 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -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, }; -- cgit v1.2.3