ijkplayer iOS编译问题之[-Wincompatible-function-pointer-types]

八卦阵  金牌会员 | 2025-2-12 14:30:37 | 来自手机 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 844|帖子 844|积分 2532

编译环境 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企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

八卦阵

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表