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


    编译环境 Apple M1 Pro Sonoma 14.1.2
    编译的时候出现如下报错:

    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]
            c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
                                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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]
            c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
                                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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]
            c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
                                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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]
            c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
                                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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]
            c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
                                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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]
            c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
                                           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 errors generated.
    make: *** [libavcodec/aarch64/h264dsp_init_aarch64.o] Error 1
    make: *** Waiting for unfinished jobs....
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    搜了搜好像没找到相关编译问题的,但是还需要用这个东西,只能再研究一下日志了,发现每个错误都有一个 [-Wincompatible-function-pointer-types],感觉好像就跟这个有关系了,然后搜了搜尝试修改一下解决了问题。

    修改方法如下

    找到do-compile-ffmpeg.sh 这个文件

    FFMPEG_CFLAGS=
    FFMPEG_CFLAGS="$FFMPEG_CFLAGS -arch $FF_ARCH"
    FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCRUN_OSVERSION"
    FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FFMPEG_EXTRA_CFLAGS"
    FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCODE_BITCODE"
    FFMPEG_CFLAGS="$FFMPEG_CFLAGS -Wno-error=incompatible-function-pointer-types" # 加上这个就能编译过了
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    接下来就没问题了。

  • 相关阅读:
    【每日一题】打卡 55
    自动巡查、自动换充电……浙江这两台无人机“巢穴”派大用场
    UDP 报文结构与注意事项全解析
    HDLC协议的特点及功能,让你一看就会
    java毕业设计爱宠医院管理系统mybatis+源码+调试部署+系统+数据库+lw
    【AXI】解读AXI协议事务属性(Transaction Attributes)
    三维重建---第一章 摄像机几何
    路由是什么
    AOP:分页参数统一校验
    java毕业设计点播影院运营系统mybatis+源码+调试部署+系统+数据库+lw
  • 原文地址:https://blog.csdn.net/xo19882011/article/details/138162135