1.24.3 [libav]: build fails with `-Wincompatible-pointer-types` error nad not ready for ffmpeg 7.0
With latest glibc and -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
in $CFLAGS some warnings are turned into errors
[tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ ninja -k 0
[3/5] Compiling C object ext/libav/libgstlibav.so.p/gstavprotocol.c.o
FAILED: ext/libav/libgstlibav.so.p/gstavprotocol.c.o
/usr/bin/gcc -Iext/libav/libgstlibav.so.p -Iext/libav -I../ext/libav -I. -I.. -I/usr/include/ffmpeg -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -fvisibility=hidden -fno-strict-aliasing -Wno-unused -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wredundant-decls -Wundef -Wwrite-strings -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Waggregate-return -Wvla -Wpointer-arith -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -mtls-dialect=gnu2 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -fPIC -DHAVE_CONFIG_H -MD -MQ ext/libav/libgstlibav.so.p/gstavprotocol.c.o -MF ext/libav/libgstlibav.so.p/gstavprotocol.c.o.d -o ext/libav/libgstlibav.so.p/gstavprotocol.c.o -c ../ext/libav/gstavprotocol.c
../ext/libav/gstavprotocol.c: In function ‘gst_ffmpegdata_open’:
../ext/libav/gstavprotocol.c:272:28: error: passing argument 6 of ‘avio_alloc_context’ from incompatible pointer type [-Wincompatible-pointer-types]
272 | gst_ffmpegdata_read, gst_ffmpegdata_write, gst_ffmpegdata_seek);
| ^~~~~~~~~~~~~~~~~~~~
| |
| int (*)(void *, uint8_t *, int) {aka int (*)(void *, unsigned char *, int)}
In file included from /usr/include/ffmpeg/libavformat/avformat.h:319,
from ../ext/libav/gstavprotocol.c:27:
/usr/include/ffmpeg/libavformat/avio.h:404:25: note: expected ‘int (*)(void *, const uint8_t *, int)’ {aka ‘int (*)(void *, const unsigned char *, int)’} but argument is of type ‘int (*)(void *, uint8_t *, int)’ {aka ‘int (*)(void *, unsigned char *, int)’}
404 | int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[4/5] Compiling C object ext/libav/libgstlibav.so.p/gstavdemux.c.o
FAILED: ext/libav/libgstlibav.so.p/gstavdemux.c.o
/usr/bin/gcc -Iext/libav/libgstlibav.so.p -Iext/libav -I../ext/libav -I. -I.. -I/usr/include/ffmpeg -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -fvisibility=hidden -fno-strict-aliasing -Wno-unused -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wredundant-decls -Wundef -Wwrite-strings -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Waggregate-return -Wvla -Wpointer-arith -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -mtls-dialect=gnu2 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -fPIC -DHAVE_CONFIG_H -MD -MQ ext/libav/libgstlibav.so.p/gstavdemux.c.o -MF ext/libav/libgstlibav.so.p/gstavdemux.c.o.d -o ext/libav/libgstlibav.so.p/gstavdemux.c.o -c ../ext/libav/gstavdemux.c
../ext/libav/gstavdemux.c: In function ‘gst_ffmpegdemux_type_find’:
../ext/libav/gstavdemux.c:1403:16: error: ‘AVInputFormat’ has no member named ‘read_probe’
1403 | if (in_plugin->read_probe &&
| ^~
../ext/libav/gstavdemux.c:1411:20: error: ‘AVInputFormat’ has no member named ‘read_probe’
1411 | res = in_plugin->read_probe (&probe_data);
| ^~
ninja: build stopped: cannot make progress due to previous errors.
``