Opened 5 weeks ago

Closed 2 weeks ago

#11318 closed defect (fixed)

Can not compile mediacodec for android

Reported by: chinshou Owned by:
Priority: normal Component: build system
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When I --enable-mediacodec and compile the library for android. The config.log report unknown type name 'bool'

check_lib mediandk stdint.h media/NdkMediaFormat.h AMediaFormat_new -lmediandk
check_func_headers stdint.h media/NdkMediaFormat.h AMediaFormat_new -lmediandk
test_ld cc -lmediandk
test_cc
BEGIN /tmp/ffconf.FOwksFOk/test.c
    1	#include <stdint.h>
    2	#include <media/NdkMediaFormat.h>
    3	#include <stdint.h>
    4	long check_AMediaFormat_new(void) { return (long) AMediaFormat_new; }
    5	int main(void) { int ret = 0;
    6	 ret |= ((intptr_t)check_AMediaFormat_new) & 0xFFFF;
    7	return ret; }
END /tmp/ffconf.FOwksFOk/test.c
/home/xxx/Projects/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/home/xxx/Projects/android-ndk-r17c/platforms/android-24/arch-arm/ -D_ISOC11_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -I/home/xxx/Projects/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /home/xxx/Projects/android-ndk-r17c/sysroot -D__ANDROID_API__=24 -I/home/xxx/Projects/android-ndk-r9/sources/android/arm/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mfp16-format=ieee -march=armv7-a -std=c11 -fPIE -fomit-frame-pointer -fPIC -marm -c -o /tmp/ffconf.FOwksFOk/test.o /tmp/ffconf.FOwksFOk/test.c
In file included from /tmp/ffconf.FOwksFOk/test.c:2:0:
/home/xxx/Projects/android-ndk-r17c/sysroot/usr/include/media/NdkMediaFormat.h:60:1: error: unknown type name 'bool'
 bool AMediaFormat_getInt32(AMediaFormat*, const char *name, int32_t *out);
 ^

I fixed the problem by adding stdbool.h to mediandk in configure file

check_lib mediandk "stdint.h stdbool.h media/NdkMediaFormat.h" AMediaFormat_new -lmediandk

The fix has referenced the code for cameara2ndk

check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk

best regards

Change History (1)

comment:1 by chinshou, 2 weeks ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.