diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-02-10 15:50:43 +0100 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-03-07 08:53:31 -0300 |
commit | b800327f4c7233d09baca958121722a04c2035ff (patch) | |
tree | df7ca79d0050cbbe27eda932d7047e3f53f281ae /libavdevice/alldevices.c | |
parent | bb81c60927d8ff53286ffe1b5d9607757180b8ae (diff) | |
download | ffmpeg-b800327f4c7233d09baca958121722a04c2035ff.tar.gz |
avformat/avformat: Add FFInputFormat, hide internals of AVInputFormat
This commit does for AVInputFormat what commit
59c9dc82f450638a3068deeb1db5c56f6d155752 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 50f34172e0cca2cabc5836308ec66dbf93f5f2a3
(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>
Diffstat (limited to 'libavdevice/alldevices.c')
-rw-r--r-- | libavdevice/alldevices.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c index 8a90fcb5d7..5ee97c56b6 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -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; |