diff --git a/CHANGELOG.md b/CHANGELOG.md index 22494889024..44a8ea5fb73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Bundle libraries from raspberrypi/userland to avoid loading issues on `linux-armhf` devices other than Raspberry Pi ([issue bytedeco/javacv#1118](https://github.com/bytedeco/javacv/issues/1118)) * Bundle the new official Java/Scala API of MXNet via the `jnimxnet` library * Add `QuickSpinC.h`, `SpinVideoC.h`, and `TransportLayer*C.h` for Spinnaker ([pull #660](https://github.com/bytedeco/javacpp-presets/pull/660)) * Add `FlyCapture2Video.h` and `FlyCapture2VideoDef.h`, and remove `AVIRecorder.h` for FlyCapture ([pull #613](https://github.com/bytedeco/javacpp-presets/pull/613)) diff --git a/README.md b/README.md index ff28fc3af57..4d846b02f3d 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ Once everything installed and configured, simply execute ```bash $ mvn install --projects .,opencv,ffmpeg,flycapture,libdc1394,libfreenect,videoinput,artoolkitplus,etc. ``` -inside the directory containing the parent `pom.xml` file, by specifying only the desired child modules in the command, but **without the leading period "." in the comma-separated list of projects, the parent `poml.xml` file itself might not get installed.** Also specify `-Djavacpp.cppbuild.skip` as option to skip the execution of the `cppbuild.sh` scripts. Please refer to the comments inside the `pom.xml` file for further details. From the "platform" subdirectory, we can also install the "platform" artifacts with a similar command: +inside the directory containing the parent `pom.xml` file, by specifying only the desired child modules in the command, but **without the leading period "." in the comma-separated list of projects, the parent `poml.xml` file itself might not get installed.** Also specify `-Djavacpp.cppbuild.skip` as option to skip the execution of the `cppbuild.sh` scripts. In addition to `-Djavacpp.platform=...`, some of the presets can also be built against CUDA with `-Djavacpp.platform.extension=-gpu`. Please refer to the comments inside the `pom.xml` file for further details. From the "platform" subdirectory, we can also install the "platform" artifacts with a similar command: ```bash $ cd platform @@ -166,9 +166,9 @@ Running the scripts allows us to install easily the native libraries on multiple With the above in working order, the scripts get launched automatically as part of the Maven build lifecycle, but we can also manually execute ```bash -$ ANDROID_NDK=/path/to/android-ndk/ bash cppbuild.sh [-platform ] [projects] +$ ANDROID_NDK=/path/to/android-ndk/ bash cppbuild.sh [-platform ] [-extension ] [projects] ``` -where possible platform names are: `android-arm`, `android-x86`, `linux-x86`, `linux-x86_64`, `linux-armhf`, `linux-ppc64le`, `linux-mips64el`, `macosx-x86_64`, `windows-x86`, `windows-x86_64`, etc. (The `ANDROID_NDK` variable is required only for Android builds.) Please note that the scripts download source archives from appropriate sites as necessary. +where possible platform names are: `android-arm`, `android-x86`, `linux-x86`, `linux-x86_64`, `linux-armhf`, `linux-ppc64le`, `linux-mips64el`, `macosx-x86_64`, `windows-x86`, `windows-x86_64`, etc. The only extension currently supported by some builds is `-gpu`, requiring CUDA to be installed. (The `ANDROID_NDK` variable is required only for Android builds.) Please note that the scripts download source archives from appropriate sites as necessary. To compile binaries for an Android device with no FPU, first make sure this is what you want. Without FPU, the performance of either OpenCV or FFmpeg is bound to be unacceptable. If you still wish to continue down that road, then replace "armeabi-v7a" by "armeabi" and "-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16" with "-march=armv5te -mtune=xscale -msoft-float", inside various files. diff --git a/ffmpeg/cppbuild.sh b/ffmpeg/cppbuild.sh index a18854df9ef..92fcbc39562 100755 --- a/ffmpeg/cppbuild.sh +++ b/ffmpeg/cppbuild.sh @@ -886,6 +886,8 @@ EOF if [ $CROSSCOMPILE -eq 1 ] then USERLAND_PATH="$(which arm-linux-gnueabihf-gcc | grep -o '.*/tools/')../userland" + mkdir -p ../lib + cp $USERLAND_PATH/build/lib/* ../lib PKG_CONFIG_PATH=../lib/pkgconfig/ ./configure --prefix=.. $DISABLE $ENABLE --enable-omx --enable-mmal --enable-omx-rpi --enable-pthreads --cc="arm-linux-gnueabihf-gcc" --extra-cflags="-I$USERLAND_PATH/ -I$USERLAND_PATH/interface/vmcs_host/khronos/IL/ -I$USERLAND_PATH/host_applications/linux/libs/bcm_host/include/ -I../include/" --extra-ldflags="-L$USERLAND_PATH/build/lib/ -L../lib/" --extra-libs="-lstdc++ -lasound -lvcos -lpthread -ldl -lz -lm" --enable-cross-compile --arch=armhf --target-os=linux --cross-prefix="arm-linux-gnueabihf-" --pkg-config-flags="--static" --pkg-config="pkg-config --static" --disable-doc --disable-programs else PKG_CONFIG_PATH=../lib/pkgconfig/ ./configure --prefix=.. $DISABLE $ENABLE --enable-omx --enable-mmal --enable-omx-rpi --enable-pthreads --extra-cflags="-I../include/" --extra-ldflags="-L../lib/ -L/opt/vc/lib" --extra-libs="-lstdc++ -lasound -lvcos -lpthread -ldl -lz -lm" --pkg-config-flags="--static" --pkg-config="pkg-config --static" diff --git a/ffmpeg/src/main/java/org/bytedeco/javacpp/presets/avcodec.java b/ffmpeg/src/main/java/org/bytedeco/javacpp/presets/avcodec.java index d5714f581b1..0b64fe19085 100644 --- a/ffmpeg/src/main/java/org/bytedeco/javacpp/presets/avcodec.java +++ b/ffmpeg/src/main/java/org/bytedeco/javacpp/presets/avcodec.java @@ -34,6 +34,7 @@ */ @Properties(inherit=swresample.class, target="org.bytedeco.javacpp.avcodec", value={ @Platform(cinclude={"", "", /* "" */}, link="avcodec@.58"), + @Platform(value="linux-arm", preload={"asound@.2", "vchiq_arm", "vcos", "vcsm", "bcm_host", "mmal_core", "mmal_util", "mmal_vc_client"}), @Platform(value="windows", preload="avcodec-58") }) public class avcodec implements InfoMapper { public void map(InfoMap infoMap) {