Skip to main content

send_packet_until_accepted

Function send_packet_until_accepted 

Source
pub fn send_packet_until_accepted<D, F, E2>(
    dec: &mut D,
    packet: &mut Packet,
    pulse: Option<&dyn Pulse>,
    on_output: F,
) -> Result<(), PumpError<SessionError<D::Error>, E2>>
where D: VideoDecoder + ?Sized, F: FnMut(Frame) -> Result<(), E2>,
Expand description

The backpressure loop every driver writes once: send, and while the codec says ReceivePending, receive output into on_output and retry; then deliver whatever output is ready.

§Errors

The decoder’s error as Upstream, on_output’s as Downstream.