Skip to content

synchronal/specter

Repository files navigation

Specter

Specter is a wrapper for webrtc.rs as an Elixir NIF, using Rustler.

This library is a low-level interface to the data structures and entities provided by Rust, with a minimal set of opinions.

Installation

def deps do
  [
    {:specter, "~> 0.1"}
  ]
end

Checklist

  • Specter.init/1 takes (opts)
    • opts: (ice_servers)
  • Specter.config/1 (ref), returning Specter.Config.t()
  • Specter.new_media_engine/1 (ref), returning UUID
  • Specter.new_registry/2 (ref, uuid), returning UUID
  • Specter.new_api/3 (ref, uuid, uuid), returning UUID
    • arg1: media engine uuid
    • arg2: registry uuid
  • Specter.PeerConnection.new/2 (ref, uuid), returning UUID
    • arg1: api builder uuid
  • Specter.PeerConnection.close/2 (ref, uuid)
  • Specter.PeerConnection.set_remote_description/3 (ref, uuid, json)
  • Specter.PeerConnection.create_offer/3 (ref, uuid, opts)
    • opts: (voice_activity_detection: bool, ice_restart: bool)
  • Specter.PeerConnection.create_data_channel/3 (ref, uuid, label)
  • Specter.PeerConnection.create_answer/3 (ref, uuid, opts)
    • opts: (voice_activity_detection: bool)
  • Specter.PeerConnection.set_local_description/3 (ref, uuid, json)
  • Specter.PeerConnection.current_local_description/2
  • Specter.PeerConnection.pending_local_description/2
  • Specter.PeerConnection.local_description/2
  • pc.on_ice_candidate sends candidate to callback process
  • Specter.PeerConnection.add_ice_candidate/3 (ref, uuid, string)
  • Specter.PeerConnection.current_remote_description/2
  • Specter.PeerConnection.pending_remote_description/2
  • Specter.PeerConnection.remote_description/2
  • Specter.PeerConnection.ice_connection_state/2
  • Specter.PeerConnection.ice_gathering_state/2
  • Specter.PeerConnection.signaling_state/2
  • Specter.PeerConnection.connection_state/2
  • Specter.PeerConnection.get_stats/2
  • pc state changes sent to Elixir pid
  • pc.gathering_complete_promise sends message to callback process
    • might not want to impement this
  • Specter.close (ref, uuid)
  • RTC metrics sent to Elixir
  • Specter.add_track (ref, uuid, ?)
  • Specter.remove_track (ref, uuid, ?)

Development

Development of Specter depends on Elixir, Erlang, and Rust being available in the environment. Suggested setup:

asdf plugin-add erlang
asdf plugin-add elixir
asdf plugin-add rust

bin/dev/doctor

CI will run tests and audit the repository, but to make sure all checks locally, the following commands can be run:

bin/dev/audit
bin/dev/test

The following script is encouraged to run all checks as a part of pushing commits:

bin/dev/shipit

References / Thank yous

This project is indebted to the following sites and references (at the very least).