bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.56k stars 8.13k forks source link

编译项目时 ffmpeg_arm64 指针类型报错 #5589

Open whhwhhwhh opened 7 months ago

whhwhhwhh commented 7 months ago

CC libavcodec/aarch64/h264dsp_init_aarch64.o

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. Screenshot 2024-04-16 at 17 12 07

whhwhhwhh commented 7 months ago

请大佬帮忙看一下,这是我的电脑环境没配对,还是需要手动改一下指针类型?

xo1988 commented 6 months ago

找到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" # 加上这个就能编译过了

我试了一下是可以的

liuqianteng commented 6 months ago

找到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" # 加上这个就能编译过了

我加了之后,也没有用,还是报错。

acruis commented 6 months ago

To add on, after adding -Wno-error=incompatible-function-pointer-types, I also faced some more errors related to int-conversion.

So you might also want to add -Wno-int-conversion:

FFMPEG_CFLAGS="$FFMPEG_CFLAGS -Wno-error=incompatible-function-pointer-types -Wno-int-conversion"
ApoloAntonOhno commented 5 months ago

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_LDFLAGS="$FFMPEG_CFLAGS"

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" # 加上这个就能编译过了 FFMPEG_LDFLAGS="$FFMPEG_CFLAGS" FFMPEG_DEP_LIBS=

这样改就可,我试过了

hucong730 commented 2 weeks ago

-Wno-error= 改成这个就好了 FFMPEG_CFLAGS="$FFMPEG_CFLAGS -Wno-incompatible-function-pointer-types"