Skip to main content

MediaGraphHandle

Struct MediaGraphHandle 

Source
pub struct MediaGraphHandle { /* private fields */ }

Implementations§

Source§

impl MediaGraphHandle

Source

pub fn id(&self) -> &MediaGraphId

Source

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.

Source

pub fn add_sink( &self, codec: CodecInfo, target: Sender<MediaFrame>, ) -> Result<MediaRouteId>

Source

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.

Source

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.

Source

pub async fn remove_sink_and_wait(&self, route_id: MediaRouteId) -> Result<bool>

Source

pub async fn update_source_codec(&self, codec: CodecInfo) -> Result<()>

Update the source codec and rebuild every codec group’s transcoder.

Source

pub async fn update_sink_codec( &self, route_id: MediaRouteId, codec: CodecInfo, ) -> Result<()>

Move one sink to the codec group represented by codec.

Source

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.

Source

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.

Source

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.

Source

pub fn latest_snapshot(&self) -> MediaGraphSnapshot

Return the most recently published snapshot without waiting on the graph actor.

Source

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.

Source

pub fn shutdown(&self)

Source

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.

Source

pub async fn wait_closed(&self) -> Result<MediaGraphSourceState>

Wait for graph and sink-task convergence without initiating shutdown.

Source

pub fn abort_handle(&self) -> AbortHandle

Trait Implementations§

Source§

impl Clone for MediaGraphHandle

Source§

fn clone(&self) -> MediaGraphHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more