pub struct StreamKey {
pub app: AppName,
pub stream_id: StreamId,
}Expand description
Composite key uniquely identifying a stream: (app_name, stream_id).
Fields§
§app: AppNameApplication the stream belongs to.
stream_id: StreamIdStream identifier within the application.
Implementations§
Source§impl StreamKey
impl StreamKey
Sourcepub fn new(app: impl Into<AppName>, stream_id: impl Into<StreamId>) -> Self
pub fn new(app: impl Into<AppName>, stream_id: impl Into<StreamId>) -> Self
Build a key from an application name and stream id.
Sourcepub fn layer(&self, variant: &str) -> StreamKey
pub fn layer(&self, variant: &str) -> StreamKey
The key for an adaptive-bitrate layer of this stream: <stream>~<variant>
in the same application.
This is the one convention shared across the media plane — the WebRTC simulcast demux (one key per RID), an ABR transcoder (one per rendition rung), and the WHEP layer selector that discovers and switches between them all agree on it, so a transcoded rung and a simulcast layer are interchangeable to a viewer.
Sourcepub fn layer_base(&self) -> &str
pub fn layer_base(&self) -> &str
The base stream id of a layer key (everything before the first ~), i.e.
the inverse of layer. Returns the whole id when it carries
no ~ (already a base stream).