1
0
Fork 0

avformat/avformat: Add FFInputFormat, hide internals of AVInputFormat

This commit does for AVInputFormat what commit
59c9dc82f4 did for AVOutputFormat:
It adds a new type FFInputFormat, moves all the internals
of AVInputFormat to it and adds a now reduced AVInputFormat
as first member.

This does not affect/improve extensibility of both public
or private fields for demuxers (it is still a mess due to lavd).

This is possible since 50f34172e0
(which removed the last usage of an internal field of AVInputFormat
in fftools).

(Hint: tools/probetest.c accesses the internals of FFInputFormat
as well, but given that it is a testing tool this is not considered
a problem.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-10 15:50:43 +01:00 committed by James Almer
parent bb81c60927
commit b800327f4c
300 changed files with 2187 additions and 1948 deletions

8
configure vendored
View File

@ -4128,9 +4128,9 @@ find_filters_extern(){
FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
INDEV_LIST=$(find_things_extern demuxer FFInputFormat libavdevice/alldevices.c indev)
MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
DEMUXER_LIST=$(find_things_extern demuxer FFInputFormat libavformat/allformats.c)
ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
CODEC_LIST="
@ -8202,9 +8202,9 @@ print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_
print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
print_enabled_components libavformat/demuxer_list.c FFInputFormat demuxer_list $DEMUXER_LIST
print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
print_enabled_components libavdevice/indev_list.c FFInputFormat indev_list $INDEV_LIST
print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST

View File

@ -18,46 +18,47 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavformat/mux.h"
#include "avdevice.h"
/* devices */
extern const AVInputFormat ff_alsa_demuxer;
extern const FFInputFormat ff_alsa_demuxer;
extern const FFOutputFormat ff_alsa_muxer;
extern const AVInputFormat ff_android_camera_demuxer;
extern const FFInputFormat ff_android_camera_demuxer;
extern const FFOutputFormat ff_audiotoolbox_muxer;
extern const AVInputFormat ff_avfoundation_demuxer;
extern const AVInputFormat ff_bktr_demuxer;
extern const FFInputFormat ff_avfoundation_demuxer;
extern const FFInputFormat ff_bktr_demuxer;
extern const FFOutputFormat ff_caca_muxer;
extern const AVInputFormat ff_decklink_demuxer;
extern const FFInputFormat ff_decklink_demuxer;
extern const FFOutputFormat ff_decklink_muxer;
extern const AVInputFormat ff_dshow_demuxer;
extern const AVInputFormat ff_fbdev_demuxer;
extern const FFInputFormat ff_dshow_demuxer;
extern const FFInputFormat ff_fbdev_demuxer;
extern const FFOutputFormat ff_fbdev_muxer;
extern const AVInputFormat ff_gdigrab_demuxer;
extern const AVInputFormat ff_iec61883_demuxer;
extern const AVInputFormat ff_jack_demuxer;
extern const AVInputFormat ff_kmsgrab_demuxer;
extern const AVInputFormat ff_lavfi_demuxer;
extern const AVInputFormat ff_openal_demuxer;
extern const FFInputFormat ff_gdigrab_demuxer;
extern const FFInputFormat ff_iec61883_demuxer;
extern const FFInputFormat ff_jack_demuxer;
extern const FFInputFormat ff_kmsgrab_demuxer;
extern const FFInputFormat ff_lavfi_demuxer;
extern const FFInputFormat ff_openal_demuxer;
extern const FFOutputFormat ff_opengl_muxer;
extern const AVInputFormat ff_oss_demuxer;
extern const FFInputFormat ff_oss_demuxer;
extern const FFOutputFormat ff_oss_muxer;
extern const AVInputFormat ff_pulse_demuxer;
extern const FFInputFormat ff_pulse_demuxer;
extern const FFOutputFormat ff_pulse_muxer;
extern const FFOutputFormat ff_sdl2_muxer;
extern const AVInputFormat ff_sndio_demuxer;
extern const FFInputFormat ff_sndio_demuxer;
extern const FFOutputFormat ff_sndio_muxer;
extern const AVInputFormat ff_v4l2_demuxer;
extern const FFInputFormat ff_v4l2_demuxer;
extern const FFOutputFormat ff_v4l2_muxer;
extern const AVInputFormat ff_vfwcap_demuxer;
extern const AVInputFormat ff_xcbgrab_demuxer;
extern const FFInputFormat ff_vfwcap_demuxer;
extern const FFInputFormat ff_xcbgrab_demuxer;
extern const FFOutputFormat ff_xv_muxer;
/* external libraries */
extern const AVInputFormat ff_libcdio_demuxer;
extern const AVInputFormat ff_libdc1394_demuxer;
extern const FFInputFormat ff_libcdio_demuxer;
extern const FFInputFormat ff_libdc1394_demuxer;
#include "libavdevice/outdev_list.c"
#include "libavdevice/indev_list.c"
@ -72,12 +73,12 @@ static const void *next_input(const AVInputFormat *prev, AVClassCategory c2)
const AVClass *pc;
const AVClassCategory c1 = AV_CLASS_CATEGORY_DEVICE_INPUT;
AVClassCategory category = AV_CLASS_CATEGORY_NA;
const AVInputFormat *fmt = NULL;
const FFInputFormat *fmt = NULL;
int i = 0;
while (prev && (fmt = indev_list[i])) {
i++;
if (prev == fmt)
if (prev == &fmt->p)
break;
}
@ -85,7 +86,7 @@ static const void *next_input(const AVInputFormat *prev, AVClassCategory c2)
fmt = indev_list[i++];
if (!fmt)
break;
pc = fmt->priv_class;
pc = fmt->p.priv_class;
if (!pc)
continue;
category = pc->category;

View File

@ -52,6 +52,7 @@
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "avdevice.h"
@ -157,14 +158,14 @@ static const AVClass alsa_demuxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_alsa_demuxer = {
.name = "alsa",
.long_name = NULL_IF_CONFIG_SMALL("ALSA audio input"),
const FFInputFormat ff_alsa_demuxer = {
.p.name = "alsa",
.p.long_name = NULL_IF_CONFIG_SMALL("ALSA audio input"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &alsa_demuxer_class,
.priv_data_size = sizeof(AlsaData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
.read_close = ff_alsa_close,
.get_device_list = audio_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &alsa_demuxer_class,
};

View File

@ -33,6 +33,7 @@
#include <media/NdkImageReader.h>
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavutil/avstring.h"
#include "libavutil/display.h"
@ -860,13 +861,13 @@ static const AVClass android_camera_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_android_camera_demuxer = {
.name = "android_camera",
.long_name = NULL_IF_CONFIG_SMALL("Android camera input device"),
const FFInputFormat ff_android_camera_demuxer = {
.p.name = "android_camera",
.p.long_name = NULL_IF_CONFIG_SMALL("Android camera input device"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &android_camera_class,
.priv_data_size = sizeof(AndroidCameraCtx),
.read_header = android_camera_read_header,
.read_packet = android_camera_read_packet,
.read_close = android_camera_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &android_camera_class,
};

View File

@ -19,6 +19,7 @@
#include "libavutil/avassert.h"
#include "avdevice.h"
#include "internal.h"
#include "libavformat/demux.h"
#include "libavformat/mux.h"
int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type,
@ -44,7 +45,7 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
av_assert0(device_list);
av_assert0(s->oformat || s->iformat);
if ((s->oformat && !ffofmt(s->oformat)->get_device_list) ||
(s->iformat && !s->iformat->get_device_list)) {
(s->iformat && !ffifmt(s->iformat)->get_device_list)) {
*device_list = NULL;
return AVERROR(ENOSYS);
}
@ -56,7 +57,7 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
if (s->oformat)
ret = ffofmt(s->oformat)->get_device_list(s, *device_list);
else
ret = s->iformat->get_device_list(s, *device_list);
ret = ffifmt(s->iformat)->get_device_list(s, *device_list);
if (ret < 0) {
avdevice_free_list_devices(device_list);
return ret;

View File

@ -24,6 +24,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
@ -352,13 +353,13 @@ static const AVClass bktr_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_bktr_demuxer = {
.name = "bktr",
.long_name = NULL_IF_CONFIG_SMALL("video grab"),
const FFInputFormat ff_bktr_demuxer = {
.p.name = "bktr",
.p.long_name = NULL_IF_CONFIG_SMALL("video grab"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &bktr_class,
.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,
};

View File

@ -21,6 +21,7 @@
*/
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavutil/opt.h"
#include "decklink_common_c.h"
@ -111,11 +112,11 @@ static const AVClass decklink_demuxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_decklink_demuxer = {
.name = "decklink",
.long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink input"),
.flags = AVFMT_NOFILE,
.priv_class = &decklink_demuxer_class,
const FFInputFormat ff_decklink_demuxer = {
.p.name = "decklink",
.p.long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink input"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &decklink_demuxer_class,
.priv_data_size = sizeof(struct decklink_cctx),
.get_device_list = ff_decklink_list_input_devices,
.read_header = ff_decklink_read_header,

View File

@ -24,6 +24,7 @@
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavformat/riff.h"
#include "avdevice.h"
@ -1924,14 +1925,15 @@ static const AVClass dshow_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_dshow_demuxer = {
.name = "dshow",
.long_name = NULL_IF_CONFIG_SMALL("DirectShow capture"),
const FFInputFormat ff_dshow_demuxer = {
.p.name = "dshow",
.p.long_name = NULL_IF_CONFIG_SMALL("DirectShow capture"),
.p.flags = AVFMT_NOFILE | AVFMT_NOBINSEARCH |
AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK,
.p.priv_class = &dshow_class,
.priv_data_size = sizeof(struct dshow_ctx),
.read_header = dshow_read_header,
.read_packet = dshow_read_packet,
.read_close = dshow_read_close,
.get_device_list= dshow_get_device_list,
.flags = AVFMT_NOFILE | AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK,
.priv_class = &dshow_class,
};

View File

@ -41,6 +41,7 @@
#include "libavutil/time.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "avdevice.h"
#include "fbdev_common.h"
@ -232,14 +233,14 @@ static const AVClass fbdev_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_fbdev_demuxer = {
.name = "fbdev",
.long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
const FFInputFormat ff_fbdev_demuxer = {
.p.name = "fbdev",
.p.long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &fbdev_class,
.priv_data_size = sizeof(FBDevContext),
.read_header = fbdev_read_header,
.read_packet = fbdev_read_packet,
.read_close = fbdev_read_close,
.get_device_list = fbdev_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &fbdev_class,
};

View File

@ -29,6 +29,7 @@
*/
#include "config.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
@ -677,13 +678,13 @@ static const AVClass gdigrab_class = {
};
/** gdi grabber device demuxer declaration */
const AVInputFormat ff_gdigrab_demuxer = {
.name = "gdigrab",
.long_name = NULL_IF_CONFIG_SMALL("GDI API Windows frame grabber"),
const FFInputFormat ff_gdigrab_demuxer = {
.p.name = "gdigrab",
.p.long_name = NULL_IF_CONFIG_SMALL("GDI API Windows frame grabber"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &gdigrab_class,
.priv_data_size = sizeof(struct gdigrab),
.read_header = gdigrab_read_header,
.read_packet = gdigrab_read_packet,
.read_close = gdigrab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &gdigrab_class,
};

View File

@ -30,6 +30,7 @@
#include <libavc1394/avc1394.h>
#include <libavc1394/rom1394.h>
#include <libiec61883/iec61883.h>
#include "libavformat/demux.h"
#include "libavformat/dv.h"
#include "libavformat/mpegts.h"
#include "libavutil/opt.h"
@ -502,13 +503,13 @@ static const AVClass iec61883_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_iec61883_demuxer = {
.name = "iec61883",
.long_name = NULL_IF_CONFIG_SMALL("libiec61883 (new DV1394) A/V input device"),
const FFInputFormat ff_iec61883_demuxer = {
.p.name = "iec61883",
.p.long_name = NULL_IF_CONFIG_SMALL("libiec61883 (new DV1394) A/V input device"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &iec61883_class,
.priv_data_size = sizeof(struct iec61883_data),
.read_header = iec61883_read_header,
.read_packet = iec61883_read_packet,
.read_close = iec61883_close,
.flags = AVFMT_NOFILE,
.priv_class = &iec61883_class,
};

View File

@ -30,6 +30,7 @@
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "timefilter.h"
#include "avdevice.h"
@ -341,13 +342,13 @@ static const AVClass jack_indev_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_jack_demuxer = {
.name = "jack",
.long_name = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
const FFInputFormat ff_jack_demuxer = {
.p.name = "jack",
.p.long_name = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &jack_indev_class,
.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,
};

View File

@ -42,6 +42,7 @@
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
typedef struct KMSGrabContext {
@ -708,13 +709,13 @@ static const AVClass kmsgrab_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_kmsgrab_demuxer = {
.name = "kmsgrab",
.long_name = NULL_IF_CONFIG_SMALL("KMS screen capture"),
const FFInputFormat ff_kmsgrab_demuxer = {
.p.name = "kmsgrab",
.p.long_name = NULL_IF_CONFIG_SMALL("KMS screen capture"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &kmsgrab_class,
.priv_data_size = sizeof(KMSGrabContext),
.read_header = &kmsgrab_read_header,
.read_packet = &kmsgrab_read_packet,
.read_close = &kmsgrab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &kmsgrab_class,
};

View File

@ -39,6 +39,7 @@
#include "libavutil/pixdesc.h"
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersink.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "avdevice.h"
@ -493,14 +494,14 @@ static const AVClass lavfi_class = {
.category = AV_CLASS_CATEGORY_DEVICE_INPUT,
};
const AVInputFormat ff_lavfi_demuxer = {
.name = "lavfi",
.long_name = NULL_IF_CONFIG_SMALL("Libavfilter virtual input device"),
const FFInputFormat ff_lavfi_demuxer = {
.p.name = "lavfi",
.p.long_name = NULL_IF_CONFIG_SMALL("Libavfilter virtual input device"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &lavfi_class,
.priv_data_size = sizeof(LavfiContext),
.read_header = lavfi_read_header,
.read_packet = lavfi_read_packet,
.read_close = lavfi_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &lavfi_class,
.flags_internal = FF_FMT_INIT_CLEANUP,
};

View File

@ -180,13 +180,13 @@ static const AVClass libcdio_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_libcdio_demuxer = {
.name = "libcdio",
const FFInputFormat ff_libcdio_demuxer = {
.p.name = "libcdio",
.p.flags = AVFMT_NOFILE,
.p.priv_class = &libcdio_class,
.read_header = read_header,
.read_packet = read_packet,
.read_close = read_close,
.read_seek = read_seek,
.priv_data_size = sizeof(CDIOContext),
.flags = AVFMT_NOFILE,
.priv_class = &libcdio_class,
};

View File

@ -31,6 +31,7 @@
#include "libavutil/pixdesc.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
typedef struct dc1394_data {
@ -288,13 +289,13 @@ static int dc1394_close(AVFormatContext * context)
return 0;
}
const AVInputFormat ff_libdc1394_demuxer = {
.name = "libdc1394",
.long_name = NULL_IF_CONFIG_SMALL("dc1394 v.2 A/V grab"),
const FFInputFormat ff_libdc1394_demuxer = {
.p.name = "libdc1394",
.p.long_name = NULL_IF_CONFIG_SMALL("dc1394 v.2 A/V grab"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &libdc1394_class,
.priv_data_size = sizeof(struct dc1394_data),
.read_header = dc1394_read_header,
.read_packet = dc1394_read_packet,
.read_close = dc1394_close,
.flags = AVFMT_NOFILE,
.priv_class = &libdc1394_class,
};

View File

@ -26,6 +26,7 @@
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "avdevice.h"
@ -248,14 +249,14 @@ static const AVClass class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_openal_demuxer = {
.name = "openal",
.long_name = NULL_IF_CONFIG_SMALL("OpenAL audio capture device"),
const FFInputFormat ff_openal_demuxer = {
.p.name = "openal",
.p.long_name = NULL_IF_CONFIG_SMALL("OpenAL audio capture device"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &class,
.priv_data_size = sizeof(al_data),
.read_probe = NULL,
.read_header = read_header,
.read_packet = read_packet,
.read_close = read_close,
.flags = AVFMT_NOFILE,
.priv_class = &class
};

View File

@ -35,6 +35,7 @@
#include "libavutil/time.h"
#include "avdevice.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "oss.h"
@ -130,13 +131,13 @@ static const AVClass oss_demuxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_oss_demuxer = {
.name = "oss",
.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) capture"),
const FFInputFormat ff_oss_demuxer = {
.p.name = "oss",
.p.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) capture"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &oss_demuxer_class,
.priv_data_size = sizeof(OSSAudioData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
.read_close = audio_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &oss_demuxer_class,
};

View File

@ -29,6 +29,7 @@
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavformat/version.h"
#include "pulse_audio_common.h"
@ -393,14 +394,14 @@ static const AVClass pulse_demuxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_pulse_demuxer = {
.name = "pulse",
.long_name = NULL_IF_CONFIG_SMALL("Pulse audio input"),
const FFInputFormat ff_pulse_demuxer = {
.p.name = "pulse",
.p.long_name = NULL_IF_CONFIG_SMALL("Pulse audio input"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &pulse_demuxer_class,
.priv_data_size = sizeof(PulseData),
.read_header = pulse_read_header,
.read_packet = pulse_read_packet,
.read_close = pulse_close,
.get_device_list = pulse_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &pulse_demuxer_class,
};

View File

@ -27,6 +27,7 @@
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "libavdevice/sndio.h"
@ -109,13 +110,13 @@ static const AVClass sndio_demuxer_class = {
.category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
};
const AVInputFormat ff_sndio_demuxer = {
.name = "sndio",
.long_name = NULL_IF_CONFIG_SMALL("sndio audio capture"),
const FFInputFormat ff_sndio_demuxer = {
.p.name = "sndio",
.p.long_name = NULL_IF_CONFIG_SMALL("sndio audio capture"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &sndio_demuxer_class,
.priv_data_size = sizeof(SndioData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
.read_close = audio_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &sndio_demuxer_class,
};

View File

@ -19,6 +19,7 @@
#include "internal.h"
#include "libavutil/opt.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
int ff_alloc_input_device_context(AVFormatContext **avctx, const AVInputFormat *iformat, const char *format)
{
@ -38,8 +39,8 @@ int ff_alloc_input_device_context(AVFormatContext **avctx, const AVInputFormat *
goto error;
}
s->iformat = iformat;
if (s->iformat->priv_data_size > 0) {
s->priv_data = av_mallocz(s->iformat->priv_data_size);
if (ffifmt(s->iformat)->priv_data_size > 0) {
s->priv_data = av_mallocz(ffifmt(s->iformat)->priv_data_size);
if (!s->priv_data) {
ret = AVERROR(ENOMEM);
goto error;

View File

@ -1134,15 +1134,15 @@ static const AVClass v4l2_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
const AVInputFormat ff_v4l2_demuxer = {
.name = "video4linux2,v4l2",
.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
const FFInputFormat ff_v4l2_demuxer = {
.p.name = "video4linux2,v4l2",
.p.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &v4l2_class,
.priv_data_size = sizeof(struct video_data),
.read_probe = v4l2_read_probe,
.read_header = v4l2_read_header,
.read_packet = v4l2_read_packet,
.read_close = v4l2_read_close,
.get_device_list = v4l2_get_device_list,
.flags = AVFMT_NOFILE,
.priv_class = &v4l2_class,
};

View File

@ -25,6 +25,7 @@
#include "libavutil/parseutils.h"
#include "libavcodec/packet_internal.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
// windows.h must no be included before winsock2.h, and libavformat internal
@ -482,13 +483,13 @@ static const AVClass vfw_class = {
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
};
const AVInputFormat ff_vfwcap_demuxer = {
.name = "vfwcap",
.long_name = NULL_IF_CONFIG_SMALL("VfW video capture"),
const FFInputFormat ff_vfwcap_demuxer = {
.p.name = "vfwcap",
.p.long_name = NULL_IF_CONFIG_SMALL("VfW video capture"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &vfw_class,
.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,
};

View File

@ -45,6 +45,7 @@
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
typedef struct XCBGrabContext {
@ -900,13 +901,13 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
return 0;
}
const AVInputFormat ff_xcbgrab_demuxer = {
.name = "x11grab",
.long_name = NULL_IF_CONFIG_SMALL("X11 screen capture, using XCB"),
const FFInputFormat ff_xcbgrab_demuxer = {
.p.name = "x11grab",
.p.long_name = NULL_IF_CONFIG_SMALL("X11 screen capture, using XCB"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &xcbgrab_class,
.priv_data_size = sizeof(XCBGrabContext),
.read_header = xcbgrab_read_header,
.read_packet = xcbgrab_read_packet,
.read_close = xcbgrab_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &xcbgrab_class,
};

View File

@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
static int threedostr_probe(const AVProbeData *p)
@ -191,12 +192,12 @@ static int threedostr_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_EOF;
}
const AVInputFormat ff_threedostr_demuxer = {
.name = "3dostr",
.long_name = NULL_IF_CONFIG_SMALL("3DO STR"),
const FFInputFormat ff_threedostr_demuxer = {
.p.name = "3dostr",
.p.long_name = NULL_IF_CONFIG_SMALL("3DO STR"),
.p.extensions = "str",
.p.flags = AVFMT_GENERIC_INDEX,
.read_probe = threedostr_probe,
.read_header = threedostr_read_header,
.read_packet = threedostr_read_packet,
.extensions = "str",
.flags = AVFMT_GENERIC_INDEX,
};

View File

@ -31,6 +31,7 @@
#include "libavutil/intfloat.h"
#include "libavcodec/internal.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
@ -396,9 +397,9 @@ static int fourxm_read_close(AVFormatContext *s)
return 0;
}
const AVInputFormat ff_fourxm_demuxer = {
.name = "4xm",
.long_name = NULL_IF_CONFIG_SMALL("4X Technologies"),
const FFInputFormat ff_fourxm_demuxer = {
.p.name = "4xm",
.p.long_name = NULL_IF_CONFIG_SMALL("4X Technologies"),
.priv_data_size = sizeof(FourxmDemuxContext),
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = fourxm_probe,

View File

@ -24,6 +24,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
#include "id3v1.h"
#include "id3v2.h"
@ -208,14 +209,14 @@ retry:
return ret;
}
const AVInputFormat ff_aac_demuxer = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
const FFInputFormat ff_aac_demuxer = {
.p.name = "aac",
.p.long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "aac",
.p.mime_type = "audio/aac,audio/aacp,audio/x-aac",
.read_probe = adts_aac_probe,
.read_header = adts_aac_read_header,
.read_packet = adts_aac_read_packet,
.flags = AVFMT_GENERIC_INDEX,
.extensions = "aac",
.mime_type = "audio/aac,audio/aacp,audio/x-aac",
.raw_codec_id = AV_CODEC_ID_AAC,
};

View File

@ -371,17 +371,17 @@ static const AVClass aa_class = {
.version = LIBAVUTIL_VERSION_INT,
};
const AVInputFormat ff_aa_demuxer = {
.name = "aa",
.long_name = NULL_IF_CONFIG_SMALL("Audible AA format files"),
.priv_class = &aa_class,
const FFInputFormat ff_aa_demuxer = {
.p.name = "aa",
.p.long_name = NULL_IF_CONFIG_SMALL("Audible AA format files"),
.p.priv_class = &aa_class,
.p.extensions = "aa",
.p.flags = AVFMT_NO_BYTE_SEEK | AVFMT_NOGENSEARCH,
.priv_data_size = sizeof(AADemuxContext),
.extensions = "aa",
.read_probe = aa_probe,
.read_header = aa_read_header,
.read_packet = aa_read_packet,
.read_seek = aa_read_seek,
.read_close = aa_read_close,
.flags = AVFMT_NO_BYTE_SEEK | AVFMT_NOGENSEARCH,
.flags_internal = FF_FMT_INIT_CLEANUP,
};

View File

@ -383,15 +383,15 @@ static int aax_read_close(AVFormatContext *s)
return 0;
}
const AVInputFormat ff_aax_demuxer = {
.name = "aax",
.long_name = NULL_IF_CONFIG_SMALL("CRI AAX"),
const FFInputFormat ff_aax_demuxer = {
.p.name = "aax",
.p.long_name = NULL_IF_CONFIG_SMALL("CRI AAX"),
.p.extensions = "aax",
.p.flags = AVFMT_GENERIC_INDEX,
.priv_data_size = sizeof(AAXContext),
.flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = aax_probe,
.read_header = aax_read_header,
.read_packet = aax_read_packet,
.read_close = aax_read_close,
.extensions = "aax",
.flags = AVFMT_GENERIC_INDEX,
};

View File

@ -25,6 +25,7 @@
#include "libavutil/crc.h"
#include "libavcodec/ac3_parser.h"
#include "avformat.h"
#include "demux.h"
#include "rawdec.h"
static int ac3_eac3_probe(const AVProbeData *p, enum AVCodecID expected_codec_id)
@ -104,17 +105,17 @@ static int ac3_probe(const AVProbeData *p)
return ac3_eac3_probe(p, AV_CODEC_ID_AC3);
}
const AVInputFormat ff_ac3_demuxer = {
.name = "ac3",
.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
const FFInputFormat ff_ac3_demuxer = {
.p.name = "ac3",
.p.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "ac3",
.p.priv_class = &ff_raw_demuxer_class,
.read_probe = ac3_probe,
.read_header = ff_raw_audio_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "ac3",
.raw_codec_id = AV_CODEC_ID_AC3,
.priv_data_size = sizeof(FFRawDemuxerContext),
.priv_class = &ff_raw_demuxer_class,
};
#endif
@ -124,16 +125,16 @@ static int eac3_probe(const AVProbeData *p)
return ac3_eac3_probe(p, AV_CODEC_ID_EAC3);
}
const AVInputFormat ff_eac3_demuxer = {
.name = "eac3",
.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
const FFInputFormat ff_eac3_demuxer = {
.p.name = "eac3",
.p.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "eac3,ec3",
.p.priv_class = &ff_raw_demuxer_class,
.read_probe = eac3_probe,
.read_header = ff_raw_audio_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags = AVFMT_GENERIC_INDEX,
.extensions = "eac3,ec3",
.raw_codec_id = AV_CODEC_ID_EAC3,
.priv_data_size = sizeof(FFRawDemuxerContext),
.priv_class = &ff_raw_demuxer_class,
};
#endif

View File

@ -22,6 +22,7 @@
#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "avformat.h"
#include "demux.h"
#include "rawdec.h"
static int ac4_probe(const AVProbeData *p)
@ -93,12 +94,12 @@ static int ac4_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
const AVInputFormat ff_ac4_demuxer = {
.name = "ac4",
.long_name = NULL_IF_CONFIG_SMALL("raw AC-4"),
const FFInputFormat ff_ac4_demuxer = {
.p.name = "ac4",
.p.long_name = NULL_IF_CONFIG_SMALL("raw AC-4"),
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "ac4",
.read_probe = ac4_probe,
.read_header = ac4_read_header,
.read_packet = ac4_read_packet,
.flags = AVFMT_GENERIC_INDEX,
.extensions = "ac4",
};

View File

@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
static int ace_probe(const AVProbeData *p)
@ -104,11 +105,11 @@ static int ace_read_packet(AVFormatContext *s, AVPacket *pkt)
return av_get_packet(s->pb, pkt, par->block_align);
}
const AVInputFormat ff_ace_demuxer = {
.name = "ace",
.long_name = NULL_IF_CONFIG_SMALL("tri-Ace Audio Container"),
const FFInputFormat ff_ace_demuxer = {
.p.name = "ace",
.p.long_name = NULL_IF_CONFIG_SMALL("tri-Ace Audio Container"),
.p.flags = AVFMT_GENERIC_INDEX,
.read_probe = ace_probe,
.read_header = ace_read_header,
.read_packet = ace_read_packet,
.flags = AVFMT_GENERIC_INDEX,
};

View File

@ -61,15 +61,15 @@ static int acm_read_header(AVFormatContext *s)
return 0;
}
const AVInputFormat ff_acm_demuxer = {
.name = "acm",
.long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"),
const FFInputFormat ff_acm_demuxer = {
.p.name = "acm",
.p.long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"),
.p.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS,
.p.extensions = "acm",
.p.priv_class = &ff_raw_demuxer_class,
.read_probe = acm_probe,
.read_header = acm_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS,
.extensions = "acm",
.raw_codec_id = AV_CODEC_ID_INTERPLAY_ACM,
.priv_data_size = sizeof(FFRawDemuxerContext),
.priv_class = &ff_raw_demuxer_class,
};

View File

@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "riff.h"
#include "internal.h"
@ -198,9 +199,9 @@ static int read_packet(AVFormatContext *s,
return ret;
}
const AVInputFormat ff_act_demuxer = {
.name = "act",
.long_name = "ACT Voice file format",
const FFInputFormat ff_act_demuxer = {
.p.name = "act",
.p.long_name = "ACT Voice file format",
.priv_data_size = sizeof(ACTContext),
.read_probe = probe,
.read_header = read_header,

View File

@ -22,6 +22,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
static int adp_probe(const AVProbeData *p)
@ -82,11 +83,11 @@ static int adp_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
const AVInputFormat ff_adp_demuxer = {
.name = "adp",
.long_name = NULL_IF_CONFIG_SMALL("ADP"),
const FFInputFormat ff_adp_demuxer = {
.p.name = "adp",
.p.long_name = NULL_IF_CONFIG_SMALL("ADP"),
.p.extensions = "adp,dtk",
.read_probe = adp_probe,
.read_header = adp_read_header,
.read_packet = adp_read_packet,
.extensions = "adp,dtk",
};

View File

@ -21,6 +21,7 @@
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
static int ads_probe(const AVProbeData *p)
@ -80,11 +81,11 @@ static int ads_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
const AVInputFormat ff_ads_demuxer = {
.name = "ads",
.long_name = NULL_IF_CONFIG_SMALL("Sony PS2 ADS"),
const FFInputFormat ff_ads_demuxer = {
.p.name = "ads",
.p.long_name = NULL_IF_CONFIG_SMALL("Sony PS2 ADS"),
.p.extensions = "ads,ss2",
.read_probe = ads_probe,
.read_header = ads_read_header,
.read_packet = ads_read_packet,
.extensions = "ads,ss2",
};

View File

@ -128,14 +128,14 @@ static int adx_read_header(AVFormatContext *s)
return 0;
}
const AVInputFormat ff_adx_demuxer = {
.name = "adx",
.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
const FFInputFormat ff_adx_demuxer = {
.p.name = "adx",
.p.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
.p.extensions = "adx",
.p.flags = AVFMT_GENERIC_INDEX,
.read_probe = adx_probe,
.priv_data_size = sizeof(ADXDemuxerContext),
.read_header = adx_read_header,
.read_packet = adx_read_packet,
.extensions = "adx",
.raw_codec_id = AV_CODEC_ID_ADPCM_ADX,
.flags = AVFMT_GENERIC_INDEX,
};

View File

@ -23,6 +23,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "pcm.h"
#define AT1_SU_SIZE 212
@ -89,13 +90,13 @@ static int aea_read_packet(AVFormatContext *s, AVPacket *pkt)
return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
}
const AVInputFormat ff_aea_demuxer = {
.name = "aea",
.long_name = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),
const FFInputFormat ff_aea_demuxer = {
.p.name = "aea",
.p.long_name = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "aea",
.read_probe = aea_read_probe,
.read_header = aea_read_header,
.read_packet = aea_read_packet,
.read_seek = ff_pcm_read_seek,
.flags = AVFMT_GENERIC_INDEX,
.extensions = "aea",
};

View File

@ -21,6 +21,7 @@
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
typedef struct AFCDemuxContext {
@ -68,12 +69,12 @@ static int afc_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
const AVInputFormat ff_afc_demuxer = {
.name = "afc",
.long_name = NULL_IF_CONFIG_SMALL("AFC"),
const FFInputFormat ff_afc_demuxer = {
.p.name = "afc",
.p.long_name = NULL_IF_CONFIG_SMALL("AFC"),
.p.extensions = "afc",
.p.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK,
.priv_data_size = sizeof(AFCDemuxContext),
.read_header = afc_read_header,
.read_packet = afc_read_packet,
.extensions = "afc",
.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK,
};

View File

@ -433,13 +433,13 @@ static int aiff_read_packet(AVFormatContext *s,
return 0;
}
const AVInputFormat ff_aiff_demuxer = {
.name = "aiff",
.long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
const FFInputFormat ff_aiff_demuxer = {
.p.name = "aiff",
.p.long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
.p.codec_tag = ff_aiff_codec_tags_list,
.priv_data_size = sizeof(AIFFInputContext),
.read_probe = aiff_probe,
.read_header = aiff_read_header,
.read_packet = aiff_read_packet,
.read_seek = ff_pcm_read_seek,
.codec_tag = ff_aiff_codec_tags_list,
};

View File

@ -130,12 +130,12 @@ static int aix_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
const AVInputFormat ff_aix_demuxer = {
.name = "aix",
.long_name = NULL_IF_CONFIG_SMALL("CRI AIX"),
const FFInputFormat ff_aix_demuxer = {
.p.name = "aix",
.p.long_name = NULL_IF_CONFIG_SMALL("CRI AIX"),
.p.extensions= "aix",
.p.flags = AVFMT_GENERIC_INDEX,
.read_probe = aix_probe,
.read_header = aix_read_header,
.read_packet = aix_read_packet,
.extensions = "aix",
.flags = AVFMT_GENERIC_INDEX,