pub struct MediaGraphHandle { /* private fields */ }Implementations§
Source§impl MediaGraphHandle
impl MediaGraphHandle
pub fn id(&self) -> &MediaGraphId
Sourcepub fn subscribe_activity(
&self,
) -> Receiver<Option<MediaGraphActivityObservation>>
pub fn subscribe_activity( &self, ) -> Receiver<Option<MediaGraphActivityObservation>>
Subscribe to a bounded retained source-activity observation.
The graph publishes at most one value per configured observation interval and overwrites an unread value with the newest one. A slow observer therefore cannot stall or grow memory in the media path.
pub fn add_sink( &self, codec: CodecInfo, target: Sender<MediaFrame>, ) -> Result<MediaRouteId>
Sourcepub fn add_managed_sink(
&self,
codec: CodecInfo,
target: Sender<MediaFrame>,
) -> Result<ManagedMediaRoute>
pub fn add_managed_sink( &self, codec: CodecInfo, target: Sender<MediaFrame>, ) -> Result<ManagedMediaRoute>
Add a sink and retain a bounded, cloneable lifecycle observer for it.
The legacy Self::add_sink API remains a route-ID-only wrapper.
Sourcepub fn remove_sink(&self, route_id: MediaRouteId) -> bool
pub fn remove_sink(&self, route_id: MediaRouteId) -> bool
Queue a removal command. The return value reports whether the command
was accepted, not whether the route existed. Use
remove_sink_and_wait when route-existence acknowledgement matters.
pub async fn remove_sink_and_wait(&self, route_id: MediaRouteId) -> Result<bool>
Sourcepub async fn update_source_codec(&self, codec: CodecInfo) -> Result<()>
pub async fn update_source_codec(&self, codec: CodecInfo) -> Result<()>
Update the source codec and rebuild every codec group’s transcoder.
Sourcepub async fn update_sink_codec(
&self,
route_id: MediaRouteId,
codec: CodecInfo,
) -> Result<()>
pub async fn update_sink_codec( &self, route_id: MediaRouteId, codec: CodecInfo, ) -> Result<()>
Move one sink to the codec group represented by codec.
Sourcepub async fn update_route(
&self,
route_id: MediaRouteId,
source_pt: u8,
target_pt: u8,
) -> Result<()>
pub async fn update_route( &self, route_id: MediaRouteId, source_pt: u8, target_pt: u8, ) -> Result<()>
Compatibility wrapper for callers that still renegotiate with RTP
payload types. New code should call update_source_codec and
update_sink_codec independently.
Sourcepub async fn snapshot(&self) -> MediaGraphSnapshot
pub async fn snapshot(&self) -> MediaGraphSnapshot
Return a command-barrier-consistent snapshot when this call leads a snapshot batch, a coalesced retained snapshot when another request is already pending, or the final retained snapshot after shutdown.
Sourcepub async fn snapshot_arc(&self) -> Arc<MediaGraphSnapshot> ⓘ
pub async fn snapshot_arc(&self) -> Arc<MediaGraphSnapshot> ⓘ
Arc-returning snapshot API for high-frequency diagnostics. Concurrent callers coalesce behind at most one actor request; followers receive the retained snapshot instead of growing the control queue.
Sourcepub fn latest_snapshot(&self) -> MediaGraphSnapshot
pub fn latest_snapshot(&self) -> MediaGraphSnapshot
Return the most recently published snapshot without waiting on the graph actor.
Sourcepub fn latest_snapshot_arc(&self) -> Arc<MediaGraphSnapshot> ⓘ
pub fn latest_snapshot_arc(&self) -> Arc<MediaGraphSnapshot> ⓘ
Cheap retained-snapshot access. The read lock is held only long enough to clone an Arc; callers never contend while inspecting its contents.
pub fn shutdown(&self)
Sourcepub async fn shutdown_and_wait(&self) -> Result<MediaGraphSourceState>
pub async fn shutdown_and_wait(&self) -> Result<MediaGraphSourceState>
Request graceful shutdown and wait for both the graph actor and every sink-forwarding task to converge on a terminal state.
Sourcepub async fn wait_closed(&self) -> Result<MediaGraphSourceState>
pub async fn wait_closed(&self) -> Result<MediaGraphSourceState>
Wait for graph and sink-task convergence without initiating shutdown.
pub fn abort_handle(&self) -> AbortHandle
Trait Implementations§
Source§impl Clone for MediaGraphHandle
impl Clone for MediaGraphHandle
Source§fn clone(&self) -> MediaGraphHandle
fn clone(&self) -> MediaGraphHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more