Membrane.WebRTC.Track (Membrane WebRTC plugin v0.1.0-alpha) View Source

Module representing a WebRTC track.

Link to this section Summary

Functions

Given a list of new tracks and a list of already added tracks, adds ssrcs to the new tracks.

Creates a new track.

Generates stream id, that can be used to mark tracks belonging to the same stream.

Link to this section Types

Specs

encoding() :: :OPUS | :H264 | :VP8

Specs

id() :: String.t()

Specs

t() :: %Membrane.WebRTC.Track{
  enabled?: boolean(),
  encoding: encoding(),
  id: id(),
  name: String.t(),
  ssrc: Membrane.RTP.ssrc_t(),
  stream_id: String.t(),
  timestamp: any(),
  type: :audio | :video
}

Link to this section Functions

Link to this function

add_ssrc(tracks, present_tracks)

View Source

Specs

add_ssrc(t() | [t()], [t()]) :: [t()]

Given a list of new tracks and a list of already added tracks, adds ssrcs to the new tracks.

Link to this function

new(type, stream_id, opts \\ [])

View Source

Specs

new(:audio | :video, stream_id :: String.t(),
  id: String.t(),
  name: String.t(),
  ssrc: Membrane.RTP.ssrc_t(),
  encoding: encoding()
) :: t()

Creates a new track.

Tracks belonging to the same stream should have the same stream_id, that can be generated with stream_id/0.

Specs

stream_id() :: String.t()

Generates stream id, that can be used to mark tracks belonging to the same stream.