Opened 3 months ago

Last modified 3 months ago

#7741 new defect

when use ndk bulid the 4.1 code occur error

Reported by: hitvz Owned by:
Priority: minor Component: avformat
Version: git-master Keywords: udp android regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by cehoyos)

the configuration shell script:

#!/bin/bash
NDK=/home/hui/Desktop/android-ndk-r16b
SYSROOT=$NDK/platforms/android-21/arch-arm/
CPU=armv7-a
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
PREFIX=$(pwd)/android/$CPU
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "

export PATH=$PATH:/usr/lib/jvm/java-8-openjdk-amd64/include

function build_android
{
./configure \
--prefix=$PREFIX \
--enable-neon \
--enable-hwaccels \
--enable-shared \
--enable-jni \
--enable-mediacodec \
--enable-decoder=h264_mediacodec \
--disable-static \
--disable-doc \
--enable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--enable-avdevice \
--disable-doc \
--disable-symver \
--cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=android \
--arch=arm \
--cpu=armv7-a \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-shared -I /usr/lib/jvm/java-1.8.0-openjdk-amd64/include/ -I /usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux/ -I /home/hui/Desktop/android-ndk-r16b/sysroot/usr/include -I /home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -Os -fpic $OPTIMIZE_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
}
build_android

---------------------

when i use option --disable-avformat , it is normal to build.

if not, it will occur the below error:
libavformat/udp.c: In function 'udp_set_multicast_sources':
libavformat/udp.c:290:28: error: request for member 's_addr' in something not a structure or union
         mreqs.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
                            ^
libavformat/udp.c:292:32: error: incompatible types when assigning to type '__be32' from type 'struct in_addr'
             mreqs.imr_interface= ((struct sockaddr_in *)local_addr)->sin_addr;
                                ^
libavformat/udp.c:294:32: error: request for member 's_addr' in something not a structure or union
             mreqs.imr_interface.s_addr= INADDR_ANY;
                                ^
libavformat/udp.c:295:29: error: request for member 's_addr' in something not a structure or union
         mreqs.imr_sourceaddr.s_addr = ((struct sockaddr_in *)&sources[i])->sin_addr.s_addr;
                             ^
In file included from /home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/byteorder/little_endian.h:28:0,
                 from /home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi/asm/byteorder.h:21,
                 from /home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/in.h:229,
                 from /home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/netinet/in.h:37,
                 from libavformat/network.h:61,
                 from libavformat/udp.c:41:
libavformat/udp.c: At top level:
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:100:29: warning: '__swab32s' defined but not used [-Wunused-function]
 static __always_inline void __swab32s(__u32 * p) {
                             ^
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:107:29: warning: '__swab64s' defined but not used [-Wunused-function]
 static __always_inline void __swab64s(__u64 * p) {
                             ^
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:107:29: warning: always_inline function might not be inlinable [-Wattributes]
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:100:29: warning: always_inline function might not be inlinable [-Wattributes]
 static __always_inline void __swab32s(__u32 * p) {
                             ^
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:72:30: warning: always_inline function might not be inlinable [-Wattributes]
 static __always_inline __u64 __swab64p(const __u64 * p) {
                              ^
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:65:30: warning: always_inline function might not be inlinable [-Wattributes]
 static __always_inline __u32 __swab32p(const __u32 * p) {
                              ^
/home/hui/Desktop/android-ndk-r16b/sysroot/usr/include/linux/swab.h:58:30: warning: always_inline function might not be inlinable [-Wattributes]
 static __always_inline __u16 __swab16p(const __u16 * p) {
                              ^
make: *** [ffbuild/common.mak:60:libavformat/udp.o] 错误 1

thx to fix it or get some suggestion

Change History (2)

comment:1 Changed 3 months ago by cehoyos

  • Keywords udp android regression added; error occr removed
  • Priority changed from normal to minor
  • Reproduced by developer set

Regression since ab0812c1a8925a95315354b88b41256faad5faa8
Work-around is to update the NDK (NDK 19 supports Android-21).

comment:2 Changed 3 months ago by cehoyos

  • Description modified (diff)
Note: See TracTickets for help on using tickets.