mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
Motivation: the git pre-commit hook is confused by the mix of 2021 and
2024 in the same workspace...
The only problem this raises is the std::env::set_var("LANGUAGE", lang) in
demos/printerdemo/rust/lib.rs, pre-existing but now explicitly marked as unsafe
because it actually is. Added a TODO there.
|
||
|---|---|---|
| .. | ||
| player | ||
| build.rs | ||
| Cargo.toml | ||
| lib.rs | ||
| main.rs | ||
| pause.svg | ||
| play.svg | ||
| player.rs | ||
| README.md | ||
| scene.slint | ||
FFmpeg Example
This example application demonstrates the use of ffmpeg with Rust to play back video.
Building
On Linux, you need to install ffmpeg and alsa. For example on Debian based systems:
sudo apt-get install clang libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev libavdevice-dev libasound2-dev pkg-config
On macOS, you can use brew:
brew install pkg-config ffmpeg
On Windows:
- install vcpkg
vcpkg install ffmpeg --triplet x64-windows- Set
VCPKG_ROOTto wherevcpkgis installed - Add
%VCPKG_ROOT%\installed\x64-windows\binto your path - Run
vcpkg install llvm[clang,target-x86]:x64-windows - Set
LIBCLANG_PATHto where clang is installed:%VCPKG_ROOT%\installed\x64-windows\bin
For Android:
- Set up Rust, cargo-apk, etc. as per https://docs.slint.dev/latest/docs/rust/slint/android/#building-and-deploying
- Set
CARGO_NDK_SYSROOT_PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/sysroot(replacedarwin-x86_64with the tuple suitable for your host OS) - Build the
apkwithcargo apk build --target aarch64-linux-android --lib