pub struct RtviObserver { /* private fields */ }Expand description
Pure frame→RTVI-message observer (PROCESSOR-DESIGN §5.1; pipecat
RTVIObserver). Plugs into the pipeline Observer
fan-out via FrameObserver; for each pushed frame it emits zero or more
RtviMessages to the injected RtviSink.
Like pipecat, it observes on the push hook (on_push_frame), processes
only the downstream copy of broadcast frames, and de-duplicates by frame
id so a frame seen at multiple links is mapped once.
Implementations§
Source§impl RtviObserver
impl RtviObserver
Sourcepub fn new(sink: Arc<dyn RtviSink>) -> Self
pub fn new(sink: Arc<dyn RtviSink>) -> Self
Build an observer that maps frames to sink with default params.
Sourcepub fn with_params(sink: Arc<dyn RtviSink>, params: RtviObserverParams) -> Self
pub fn with_params(sink: Arc<dyn RtviSink>, params: RtviObserverParams) -> Self
Build an observer with explicit RtviObserverParams.
Trait Implementations§
Source§impl FrameObserver for RtviObserver
impl FrameObserver for RtviObserver
Source§fn on_push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
e: &'life1 FramePushEvent<'life2>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
e: &'life1 FramePushEvent<'life2>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
A frame was pushed source→destination (
base_observer.py:91).Source§fn on_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_e: &'life1 FrameEvent<'life2>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_e: &'life1 FrameEvent<'life2>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
A processor is about to handle a frame (
base_observer.py:79).Auto Trait Implementations§
impl !Freeze for RtviObserver
impl !RefUnwindSafe for RtviObserver
impl !UnwindSafe for RtviObserver
impl Send for RtviObserver
impl Sync for RtviObserver
impl Unpin for RtviObserver
impl UnsafeUnpin for RtviObserver
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