Open lattice0 opened 4 years ago
Here's a draft:
https://github.com/meh/rust-ffmpeg-sys/compare/master...lucaszanella:master
It's working when build to linux on linux. When building to android on linux using https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-21-rust-on-android.html (make standalone toolchain script), it starts selecting the dependencies and include paths correctly but it currently fails with this:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', build.rs:1249:6
probably something related with bindings library, gonna investigate.
Installing libc6-dev-i386
fixed the last error.
I removed avdevice
since I dont have this lib for android. Using:
cargo build --verbose -vv --target aarch64-linux-android --release --no-default-features --features "avcodec avfilter avformat swresample swscale"
made the building work!
Gonna take a while to test on Android with real video data but it seems everything is ok :+1:
I think I'm gonna wait a little to send a PR though? Don't know, gonna test more. I plan to add support for raspberry pi and nvidia jetson nano because I'm gonna use them in my project in the future, but cross compiling for them is kinda hard I guess.
Thanks for this work. It's fine if you send a PR early. Others can help testing too.
Hi, I'll add support for other architectures. Take a look at the structure of the prebuilt binaries I have:
they're respecting android's jniLibs search model (even though we won't use it in this project). I have a docker container that builds then in this structure. For desktop this container builds with some hardware decoding support which is nice, I may link it here in the future, gotta clean it.
Anyways, looks like for now,
rust-ffmpeg-sys
supports specifying a folder that containslib, bin, include
. I'm planning to add an environment variable calledMULTI_ARCHITECTURE_PREBUILT
which would point to the root of my tree I just pasted here. Then if it's android it goes into android + right arch. I think I might changedesktop/{x86_64,aarch64,x86_64_generic}
todesktop/{linux/macos/windows}/{x86_64,aarch64,x86_64_generic}
. Also there should be aniOS
folder. What you think?I'll have to delay
iOS
,Windows
andmacOS
support because I dont have them now to build, but I plan to support them.I also didn't look at how to use cargo to cross compile (for android for now) using build.rs. Gonna look on that. If somebody have a tip I appreciate. I want to build for android on linux, and for linux on linux (which already works)