View Source Membrane.WebRTC.Track (Membrane WebRTC plugin v0.6.0)
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 t/0
from SDP m-line with random track id and stream id.
Creates t/0
from SDP m-line with specific track id and stream id.
Creates a new track.
Modifies track properties according to provided constraints.
Generates stream id, that can be used to mark tracks belonging to the same stream.
Link to this section Types
@type encoding() :: :OPUS | :H264 | :VP8
@type id() :: String.t()
@type t() :: %Membrane.WebRTC.Track{ encoding: encoding(), extmaps: [ExSDP.Attribute.Extmap], fmtp: ExSDP.Attribute.FMTP.t() | [ExSDP.Attribute.FMTP.t()], id: id(), mid: binary(), name: String.t(), rid_to_ssrc: %{}, rids: [String.t()] | nil, rtp_mapping: ExSDP.Attribute.RTPMapping.t() | [ExSDP.Attribute.RTPMapping.t()], ssrc: RTP.ssrc_t() | [RTP.ssrc_t()], status: :pending | :ready | :linked | :disabled, stream_id: String.t(), type: :audio | :video }
Link to this section Functions
Given a list of new tracks and a list of already added tracks, adds ssrcs to the new tracks.
@spec from_sdp_media(ExSDP.Media.t()) :: t()
Creates t/0
from SDP m-line with random track id and stream id.
@spec from_sdp_media(ExSDP.Media.t(), id(), String.t()) :: t()
Creates t/0
from SDP m-line with specific track id and stream id.
@spec new(:audio | :video, stream_id :: String.t(), id: String.t(), name: String.t(), ssrc: RTP.ssrc_t() | [RTP.ssrc_t()] | nil, encoding: encoding(), mid: non_neg_integer(), rids: [String.t()] | nil, rtp_mapping: ExSDP.Attribute.RTPMapping.t(), status: :pending | :ready | :linked | :disabled, fmtp: ExSDP.Attribute.FMTP.t(), extmaps: [ExSDP.Attribute.Extmap] ) :: 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
.
Modifies track properties according to provided constraints.
In particular, after setting constraints, track can be disabled.
@spec stream_id() :: String.t()
Generates stream id, that can be used to mark tracks belonging to the same stream.