mediabus-0.4.0.1: Multimedia streaming on top of Conduit

Safe HaskellNone
LanguageHaskell2010

Data.MediaBus.Conduit.Reorder

Description

Reorder the Frames in Conduit of a Stream.

Synopsis

Documentation

reorderFramesBySeqNumC Source #

Arguments

:: (Default s, Default i, Default t, Default p, Num s, Ord s, Monad m) 
=> Int

The maximun number of out-of-order frames to buffer.

-> Conduit (Stream i s t p c) m (Stream i s t p c) 

Reorder the Frames in Conduit of a Stream according to the Ord instance of the the sequence numbers of seqNum. This function will buffer e certain number of frames that are out of order, and drops frames if they are too late. Also, when too many consecutive frames have all been dropped, a new Start will be created, and the buffered elements are silently dropped, too. When a Start is received that internal buffer is flushed and all queued frames are transmitted.

reorderFramesByC Source #

Arguments

:: (Monad m, Ord rank, Default i, Default t, Default s, Default p, Default rank) 
=> Lens' (Stream i s t p c) rank

A lens for the value to be used as comparison

-> (rank -> rank)

A function that returns the **expected next value** of the comparison value

-> Int

The maximum number of frames to buffer

-> Conduit (Stream i s t p c) m (Stream i s t p c) 

Like reorderFramesBySeqNumC but more general. This function allows to pass a Lens to the specific field of each Frame, that shall be used for comparison, which governs the order.