mediabus-0.3.3.0: Multimedia streaming on top of Conduit

Safe HaskellNone
LanguageHaskell2010

Data.MediaBus.Media.SyncStream

Description

Naturally ordered Streams. A Stream without sequence numbers and timestamps has no means to represent Frames that have varying sequence numbers or timestamps, hence they cannot be part of a stream that is not perfectly synchronized, therefore when consuming such Stream values, the corresponding callers must work under the assumption that the frames are perfectly synchronous.

Synopsis

Documentation

type SyncStream i p c = Stream i () () p c Source #

A Stream without a meaningful sequence number or timestamp.

assumeSynchronized :: Stream i s t p c -> SyncStream i p c Source #

Convert a Stream to a SyncStream by simply forgetting the sequence numbers and timestamps of the input. This expresses the assumption that the Frames are either perfectly lined sequential or that this doesn't matter at all.

setSequenceNumbersAndTimestamps :: (Num s, CanBeTicks r t, HasDuration c) => SyncStream i p c -> (s, Ticks r t) -> (Stream i s (Ticks r t) p c, (s, Ticks r t)) Source #

Set sequence numbers and timestamps. Increment the sequence numbers starting from 0 for every frame. Start the timestamp at 0 and add the Frame duration of the Next frame in the stream. This function has the signature required to turn it into a State monad.