ToB企服应用市场:ToB评测及商务社交产业平台

标题: ijkplayer iOS编译问题之[-Wincompatible-function-pointer-types] [打印本页]

作者: 八卦阵    时间: 2025-2-12 14:30
标题: ijkplayer iOS编译问题之[-Wincompatible-function-pointer-types]
编译环境 Apple M1 Pro Sonoma 14.1.2
编译的时候出现如下报错:
  1. libavcodec/aarch64/h264dsp_init_aarch64.c:84:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
  2.         c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
  3.                                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. libavcodec/aarch64/h264dsp_init_aarch64.c:85:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
  5.         c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
  6.                                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. libavcodec/aarch64/h264dsp_init_aarch64.c:86:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
  8.         c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
  9.                                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. libavcodec/aarch64/h264dsp_init_aarch64.c:88:40: error: incompatible function pointer types assigning to 'h264_biweight_func' (aka 'void (*)(unsigned char *, unsigned char *, long, int, int, int, int, int)') from 'void (uint8_t *, uint8_t *, int, int, int, int, int, int)' (aka 'void (unsigned char *, unsigned char *, int, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
  11.         c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
  12.                                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  13. libavcodec/aarch64/h264dsp_init_aarch64.c:89:40: error: incompatible function pointer types assigning to 'h264_biweight_func' (aka 'void (*)(unsigned char *, unsigned char *, long, int, int, int, int, int)') from 'void (uint8_t *, uint8_t *, int, int, int, int, int, int)' (aka 'void (unsigned char *, unsigned char *, int, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
  14.         c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
  15.                                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16. libavcodec/aarch64/h264dsp_init_aarch64.c:90:40: error: incompatible function pointer types assigning to 'h264_biweight_func' (aka 'void (*)(unsigned char *, unsigned char *, long, int, int, int, int, int)') from 'void (uint8_t *, uint8_t *, int, int, int, int, int, int)' (aka 'void (unsigned char *, unsigned char *, int, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
  17.         c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
  18.                                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  19. 6 errors generated.
  20. make: *** [libavcodec/aarch64/h264dsp_init_aarch64.o] Error 1
  21. make: *** Waiting for unfinished jobs....
复制代码
搜了搜好像没找到相干编译问题的,但是还需要用这个东西,只能再研究一下日志了,发现每个错误都有一个 [-Wincompatible-function-pointer-types],感觉好像就跟这个有关系了,然后搜了搜尝试修改一下解决了问题。
修改方法如下

找到do-compile-ffmpeg.sh 这个文件
  1. FFMPEG_CFLAGS=
  2. FFMPEG_CFLAGS="$FFMPEG_CFLAGS -arch $FF_ARCH"
  3. FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCRUN_OSVERSION"
  4. FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FFMPEG_EXTRA_CFLAGS"
  5. FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCODE_BITCODE"
  6. FFMPEG_CFLAGS="$FFMPEG_CFLAGS -Wno-error=incompatible-function-pointer-types" # 加上这个就能编译过了
复制代码
接下来就没问题了。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4