Files
client-sdk-rust/README.md
T
Théo Monnom a07b3451a3 publish client-sdk-native (#12)
* Create README.md

* add example

* crates & examples

* fix syntax

* add LICENSE

* thirdparty LICENSE

* rearrange repo

* fix build

* egui versions

* prepare publish

* fix demo compilation

* add test ci

* Update rust.yml

* forgot runs-on

* install protoc before building

* avoid rate limit

* include submodules

* updates to readme

* cache rust builds

Co-authored-by: David Zhao <dz@livekit.io>
Co-authored-by: David Zhao <david@davidzhao.com>
2023-01-02 20:13:48 +01:00

2.4 KiB

LiveKit: Native SDK

Warning

This SDK is a developer preview and is not ready for production use. There will be bugs and the APIs may change during this period. All feedbacks/contributions are appreciated. You can create issues or discuss with us on the #rust-developer-preview channel in our Slack

Features

  • Receiving tracks ( VP8, Software decoder only )
  • Cross-platform ( currently tested on Windows & MacOS )
  • Publishing tracks
  • Adaptive Streaming
  • Dynacast
  • Simulcast
  • Hardware video enc/dec
    • NvEnc for Windows
    • VideoToolbox for MacOS/iOS

Crates

  • livekit-core: LiveKit protocol implementation
  • livekit-utils: Shared utilities between our crates
  • livekit-ffi: Use livekit-core on foreign languages
  • livekit-webrtc: Safe Rust bindings to libwebrtc
  • webrtc-sys: Unsafe bindings to libwebrtc

Motivation and Design Goals

At LiveKit, we've developed a number of client SDKs for different platforms. This is necessary to our goal of providing an end-to-end WebRTC stack for every platform. However, we've encountered a few challenges during this process:

  • there's significant of business/control logic with our signaling protocol and WebRTC. currently they are re-written for each platform that we support
  • interactions with media devices and encoding/decoding are platform and framework specific
  • doing both of the above for multi-platform frameworks (like Unity, Flutter, and React-Native) proved to be extremely painful

We would like this SDK to:

  • Encapsulate all of the business logic and platform-specific APIs into a clean
  • Standalone cross-platform, native SDK for Rust and C/C++
  • Serve as a common core for other platform-specific SDKs (i.e. Unity, iOS, Android)

Getting started

Tokio is required to use the SDK, we have plan to make the async executor agnostic

Connecting to a Room and listen to events:

#[tokio::main]
async fn main() -> Result<()> {
   let (room, room_events) = Room::connect(&url, &token).await?;

   while let Some(event) = room_events.recv().await {
      match event {
         RoomEvent::TrackSubscribed { track, publication, participant } => {
            // ...
         }
         _ => {}
      }
   }

   Ok(())
}

Examples

We made simple room demo using all features of the SDK. We render videos using wgpu and egui.