pub struct FilterGraph { /* private fields */ }Expand description
A filter graph that processes media through connected nodes.
Implementations§
Source§impl FilterGraph
impl FilterGraph
Sourcepub fn builder() -> GraphBuilder<Empty>
pub fn builder() -> GraphBuilder<Empty>
Create a new graph builder.
Sourcepub fn execution_order(&self) -> &[NodeId]
pub fn execution_order(&self) -> &[NodeId]
Get the execution order.
Sourcepub fn source_nodes(&self) -> &[NodeId]
pub fn source_nodes(&self) -> &[NodeId]
Get source nodes.
Sourcepub fn sink_nodes(&self) -> &[NodeId]
pub fn sink_nodes(&self) -> &[NodeId]
Get sink nodes.
Sourcepub fn connections(&self) -> &[Connection]
pub fn connections(&self) -> &[Connection]
Get connections.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes.
Sourcepub fn initialize(&mut self) -> GraphResult<()>
pub fn initialize(&mut self) -> GraphResult<()>
Initialize all nodes for processing.
Sourcepub fn process_step(&mut self) -> GraphResult<bool>
pub fn process_step(&mut self) -> GraphResult<bool>
Process one step of the graph.
Processes nodes in topological order, passing frames through connections.
Sourcepub fn push_frame(
&mut self,
node_id: NodeId,
port: PortId,
frame: FilterFrame,
) -> GraphResult<()>
pub fn push_frame( &mut self, node_id: NodeId, port: PortId, frame: FilterFrame, ) -> GraphResult<()>
Push a frame to a source node.
Sourcepub fn pull_frame(
&mut self,
node_id: NodeId,
port: PortId,
) -> GraphResult<Option<FilterFrame>>
pub fn pull_frame( &mut self, node_id: NodeId, port: PortId, ) -> GraphResult<Option<FilterFrame>>
Pull a frame from a sink node.
Sourcepub fn reset(&mut self) -> GraphResult<()>
pub fn reset(&mut self) -> GraphResult<()>
Reset all nodes to initial state.
Sourcepub fn flush(&mut self) -> GraphResult<Vec<FilterFrame>>
pub fn flush(&mut self) -> GraphResult<Vec<FilterFrame>>
Flush all nodes.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FilterGraph
impl !UnwindSafe for FilterGraph
impl Freeze for FilterGraph
impl Send for FilterGraph
impl Sync for FilterGraph
impl Unpin for FilterGraph
impl UnsafeUnpin for FilterGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more