pub struct SmoothOrigin { /* private fields */ }std only.Expand description
The live Smooth origin over one Trunk.
Implementations§
Source§impl SmoothOrigin
impl SmoothOrigin
Sourcepub fn new(config: SmoothOriginConfig) -> Self
pub fn new(config: SmoothOriginConfig) -> Self
An origin over config.trunk; it describes whatever segments the
trunk currently holds, once an init segment is stored and at least one
track is announced.
Sourcepub fn stream_keys(&self) -> Vec<StreamKey>
pub fn stream_keys(&self) -> Vec<StreamKey>
The streams this origin currently advertises, in manifest order — the
vocabulary SmoothRequest::parse needs to read a request path.
Empty while the trunk has nothing to describe.
Sourcepub fn set_init(&self, bytes: impl Into<Bytes>)
pub fn set_init(&self, bytes: impl Into<Bytes>)
Store the fMP4 init segment the trunk’s segments are muxed with — the
one thing no Trunk ring holds, and what a fragment request is
re-demuxed against. Storing the segment already held changes nothing,
so a host may call this on every request without invalidating the
cached plan.
Sourcepub fn fragments(&self) -> Result<Vec<FragmentLocation>, SmoothOriginError>
pub fn fragments(&self) -> Result<Vec<FragmentLocation>, SmoothOriginError>
The fragments currently advertised, in manifest order, or None while
the trunk has nothing to advertise yet.
Sourcepub fn manifest(
&self,
now: Timestamp,
await_policy: AwaitPolicy,
) -> EgressResponse<String>
pub fn manifest( &self, now: Timestamp, await_policy: AwaitPolicy, ) -> EgressResponse<String>
Render the live client Manifest, or why it cannot be rendered yet
(EgressResponse::Await) or at all (EgressResponse::BadRequest).
Trait Implementations§
Source§impl ServedEgress for SmoothOrigin
impl ServedEgress for SmoothOrigin
Source§type Request = SmoothRequest
type Request = SmoothRequest
Source§type Body = SmoothBody
type Body = SmoothBody
Source§fn resolve(
&self,
request: SmoothRequest,
now: Timestamp,
await_policy: AwaitPolicy,
) -> EgressResponse<SmoothBody>
fn resolve( &self, request: SmoothRequest, now: Timestamp, await_policy: AwaitPolicy, ) -> EgressResponse<SmoothBody>
request against this implementation’s current state at
time now, bounded by await_policy — see
EgressResponse::Await’s contract.Source§fn is_warm(&self, request: &SmoothRequest) -> bool
fn is_warm(&self, request: &SmoothRequest) -> bool
Source§fn prepare(&self, request: SmoothRequest)
fn prepare(&self, request: SmoothRequest)
request needs so that the next
resolve is warm. Blocking and CPU-bound; call it on
a thread that may block. The default does nothing.