webrtc-sys

Crates.iowebrtc-sys
lib.rswebrtc-sys
version0.3.2
sourcesrc
created_at2023-01-02 16:37:22.394956
updated_at2024-02-28 18:10:30.902964
descriptionUnsafe bindings to libwebrtc
homepagehttps://livekit.io
repositoryhttps://github.com/livekit/client-sdk-rust
max_upload_size
id749500
size360,254
Théo Monnom (theomonnom)

documentation

README

webrtc-sys

This crate provides wrapper over the WebRTC API for use from Rust. We use the crate cxx.rs to simplify our bindings.

Wrappers

Most of our wrappers use the cxx.rs types compatible with Rust. As most of our wrappers are stateless, we allow multiple instances of a specific wrapper to point to the same underlying webrtc pointer. (e.g: multiple livekit::MediaStreamTrack pointing to the same webrtc::MediaStreamTrackInterface).

Threadsafe methods use the const keyword so we can easily call them from the Rust side without worrying about the mutability of the object. (This is similar on how Cell/UnsafeCell works but implemented on the C++ side: interior mutability).

Code

We also use this C++ code to provide other needed utilities/features on the Rust side (e.g: tiny bindings to libyuv).

Commit count: 284

cargo fmt