Go to file
Alaric Senat 90729e2bd4 libvlc-sys: fix cross-platform va_list layout
bindgen spells the log callback's va_list parameter the way the host
that ran it does. The bindings are generated once and compiled
everywhere, so that spelling only happens to be right on the generating
host.
This was alright for most hosts but is fragile on aarch64 where va_list
is a plain 32 bytes struct.

Given we only forward the list to vsnprintf, extracting and simplifying
the cross-platform rust implementation from the unstable std-lib is
cheap and sound. We will just have to re-export the official type once
it's stablilized.
2026-08-25 14:57:31 +02:00
.cargo xtask: commit the lock file 2026-08-19 14:43:27 +02:00
examples Add examples 2015-11-29 17:40:58 +09:00
libvlc-sys libvlc-sys: fix cross-platform va_list layout 2026-08-25 14:57:31 +02:00
src libvlc-sys: fix cross-platform va_list layout 2026-08-25 14:57:31 +02:00
xtask libvlc-sys: fix cross-platform va_list layout 2026-08-25 14:57:31 +02:00
.gitignore build: commit the lock file 2026-08-19 14:45:49 +02:00
.gitlab-ci.yml ci: run the build with --locked 2026-08-19 15:10:13 +02:00
Cargo.lock build: commit the lock file 2026-08-19 14:45:49 +02:00
Cargo.toml build: replace the use-bindgen feature with a `cargo xtask bindgen` tool 2026-07-24 10:05:32 +02:00
LICENSE Initial commit 2015-11-29 10:26:04 +09:00
README.md Add support for building on Windows 2021-04-13 20:22:58 +02:00

README.md

vlc-rs Build Status

Rust bindings for libVLC media framework.

Status

Many missing functions and wrappers.

Use

Please add the following dependencies to your Cargo.toml.

[dependencies]
vlc-rs = "0.3"

Or:

[dependencies.vlc-rs]
git = "https://github.com/garkimasera/vlc-rs.git"

Example

Play for 10 seconds from a media file.

extern crate vlc;
use vlc::{Instance, Media, MediaPlayer};
use std::thread;

fn main() {
    // Create an instance
    let instance = Instance::new().unwrap();
    // Create a media from a file
    let md = Media::new_path(&instance, "path_to_a_media_file.ogg").unwrap();
    // Create a media player
    let mdp = MediaPlayer::new(&instance).unwrap();
    mdp.set_media(&md);

    // Start playing
    mdp.play().unwrap();

    // Wait for 10 seconds
    thread::sleep(::std::time::Duration::from_secs(10));
}

Other examples are in the examples directory.

Building

Windows

To build vlc-rs, you must either build VLC from source or grab one of the pre-built packages from videolan.org.

If you're building for x86_64, then you should grab the download labelled "Installer for 64bit version". That installer is actually a self-extracting ZIP archive, so we can extract the contents without installing VLC itself.

If you're building for x86, then you should either download labelled "7zip package" or the one labelled "Zip package".

Once you've downloaded your chosen package, you should extract it some place such that its path contains no spaces. To point vlc-rs at your VLC package, you should set an appropriate environment variable:

  • VLC_LIB_DIR: Directory of the VLC pacakge, any architecture
  • VLC_LIB_DIR_X86 : Directory of the VLC pacakge, x86-only
  • VLC_LIB_DIR_X86_64 : Directory of the VLC pacakge, x86_64-only

You should also add the package to your PATH variable if you intend to run the program. For distribution of an executable program, you should probably copy over the neccessary DLLs, as well as the plugins directory.

License

MIT (Examples are licensed under CC0)