1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00
FFmpeg/libavdevice
Andreas Rheinhardt 3d53cefb49 avcodec/raw: Reduce number of avpriv symbols
libavcodec currently exports four avpriv symbols that deal with
PixelFormatTags: avpriv_get_raw_pix_fmt_tags, avpriv_find_pix_fmt,
avpriv_pix_fmt_bps_avi and avpriv_pix_fmt_bps_mov. The latter two are
lists of PixelFormatTags, the former returns such a list and the second
searches a list for a pixel format that matches a given fourcc; only
one of the aforementioned three lists is ever searched.

Yet for avpriv_pix_fmt_bps_avi, avpriv_pix_fmt_bps_mov and
avpriv_find_pix_fmt the overhead of exporting these functions actually
exceeds the size of said objects (at least for ELF; the following numbers
are for x64 Ubuntu 20.10):
The code size of avpriv_find_pix_fmt is small (GCC 10.2 37B, Clang 11 41B),
yet exporting it adds a 20B string for the name alone to the exporting
as well as to each importing library; there is more: Four bytes in the
exporting libraries .gnu.hash; two bytes each for the exporting as well
as each importing libraries .gnu.version; 24B in the exporting as well
as each importing libraries .dynsym; 16B+24B for an entry in .plt as
well as the accompanying relocation entry in .rela.plt for each
importing library.

The overhead for the lists is similar: The strings are 23B and the
.plt+.rela.plt pair is replaced by 8B+24B for an entry in .got and
a relocation entry in .rela.dyn. These lists have a size of 80 resp.
72 bytes.

Yet for ff_raw_pix_fmt_tags, exporting it is advantageous compared to
duplicating it into libavformat and potentially libavdevice. Therefore
this commit replaces all library uses of the four symbols with a single
function that is exported for shared builds. It has an enum parameter
to choose the desired list besides the parameter for the fourcc. New
lists can be supported with new enum values.

Unfortunately, avpriv_get_raw_pix_fmt_tags could not be removed, as the
fourcc2pixfmt tool uses the table of raw pix fmts. No other user of this
function remains.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-04 13:16:49 +01:00
..
tests
.gitignore
alldevices.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
alsa_dec.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
alsa_enc.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
alsa.c avdevice/alsa_dec: make sure we have enough data in non-blocking mode 2021-03-12 23:55:30 +01:00
alsa.h avdevice/alsa_dec: make sure we have enough data in non-blocking mode 2021-03-12 23:55:30 +01:00
android_camera.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
audiotoolbox.m avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
avdevice.c avdevice: add info about media types(s) to AVDeviceInfo 2021-12-24 14:06:45 +05:30
avdevice.h avdevice: add info about media types(s) to AVDeviceInfo 2021-12-24 14:06:45 +05:30
avdeviceres.rc
avfoundation.m libavdevice/avfoundation.m: fix potential unreleased lock issue 2021-09-17 15:31:40 +02:00
bktr.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
caca.c avdevice/caca: Don't free AVOpt-enabled string manually 2021-10-09 14:18:12 +02:00
decklink_common_c.h avdevice/decklink: add level_a configuration option 2021-08-16 10:00:39 +08:00
decklink_common.cpp avdevice/decklink: support for more duplex mode for Decklink 8K Pro 2021-08-16 10:00:39 +08:00
decklink_common.h avdevice/decklink: support for more duplex mode for Decklink 8K Pro 2021-08-16 10:00:39 +08:00
decklink_dec_c.c avdevice/decklink: support for more duplex mode for Decklink 8K Pro 2021-08-16 10:00:39 +08:00
decklink_dec.cpp avutil/buffer: Switch AVBuffer API to size_t 2021-04-27 10:43:13 -03:00
decklink_dec.h
decklink_enc_c.c avdevice/decklink: support for more duplex mode for Decklink 8K Pro 2021-08-16 10:00:39 +08:00
decklink_enc.cpp avdevice/decklink: add link configuration option 2021-08-16 10:00:39 +08:00
decklink_enc.h
dshow_capture.h avdevice/dshow: fix crash on x86 2022-01-04 17:40:54 +05:30
dshow_common.c
dshow_crossbar.c avdevice/dshow: tv_tuner_audio_dialog cleanup missing 2022-01-04 17:40:29 +05:30
dshow_enummediatypes.c avdevice/dshow: fix crash on x86 2022-01-04 17:40:54 +05:30
dshow_enumpins.c avdevice/dshow: fix crash on x86 2022-01-04 17:40:54 +05:30
dshow_filter.c avdevice/dshow: fix crash on x86 2022-01-04 17:40:54 +05:30
dshow_pin.c avdevice/dshow: fix crash on x86 2022-01-04 17:40:54 +05:30
dshow.c avcodec/raw: Reduce number of avpriv symbols 2022-01-04 13:16:49 +01:00
fbdev_common.c
fbdev_common.h
fbdev_dec.c Remove unnecessary mem.h inclusions 2021-07-22 14:47:57 +02:00
fbdev_enc.c Remove unnecessary mem.h inclusions 2021-07-22 14:47:57 +02:00
file_open.c
gdigrab.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
iec61883.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
internal.h avformat: Constify the API wrt AV(In|Out)putFormat 2021-04-27 10:43:08 -03:00
jack.c lavd/jack: increase buffer size for snprintf() 2021-12-07 11:16:14 +01:00
kmsgrab.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
lavfi.c avdevice/lavfi: Don't require AV_PIX_FMT_NONE == -1 2021-12-03 17:01:24 +01:00
libavdevice.v
libcdio.c Remove unnecessary mem.h inclusions 2021-07-22 14:47:57 +02:00
libdc1394.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
Makefile Makefile: Redo duplicating object files in shared builds 2022-01-04 05:01:04 +01:00
openal-dec.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
opengl_enc_shaders.h
opengl_enc.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
oss_dec.c Remove/replace some unnecessary avcodec.h inclusions 2021-07-22 15:29:46 +02:00
oss_enc.c Remove/replace some unnecessary avcodec.h inclusions 2021-07-22 15:29:46 +02:00
oss.c Remove/replace some unnecessary avcodec.h inclusions 2021-07-22 15:29:46 +02:00
oss.h Remove/replace some unnecessary avcodec.h inclusions 2021-07-22 15:29:46 +02:00
pulse_audio_common.c
pulse_audio_common.h
pulse_audio_dec.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
pulse_audio_enc.c avcodec/avcodec: Stop including channel_layout.h in avcodec.h 2021-07-22 11:14:31 +02:00
reverse.c
sdl2.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
sndio_dec.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
sndio_enc.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
sndio.c
sndio.h
timefilter.c
timefilter.h avdevice/timefilter: remove obsolete comments from the docs 2021-02-27 21:30:41 +01:00
utils.c avformat: Constify the API wrt AV(In|Out)putFormat 2021-04-27 10:43:08 -03:00
v4l2-common.c lavd/v4l2-common: Add an entry for Z16. 2019-03-22 12:30:47 +01:00
v4l2-common.h Remove unnecessary avassert.h inclusions 2021-07-22 15:02:30 +02:00
v4l2.c lavd/v4l2: detect device name truncation 2021-12-07 11:16:14 +01:00
v4l2enc.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
version.h lib*/version.h: Bump Versions after release/5.0 branch 2022-01-03 22:10:46 +01:00
vfwcap.c avdevice: Constify all devices 2021-04-27 11:48:05 -03:00
xcbgrab.c av(codec|device): Don't cast pointers to int 2021-11-21 00:35:30 +01:00
xv.c avdevice/xv: Increase array size 2021-10-09 13:24:38 +02:00