Stream< T > Class Template Reference

A container class representing a stream of OpenViBE. More...

Inheritance diagram for Stream< T >:
StreamBase Contexted

Detailed Description

template<class T>
class OpenViBETracker::Stream< T >

A container class representing a stream of OpenViBE.

Author
J. T. Lindgren

Stream is basically a specific kind of time-ordered container of timestamped, typed elements.

Unlike OpenViBE streams in general, the Stream content in Tracker is stored in memory unencoded, and hence if its content is written to an .ov file, passed to a box, or Designer, it must be encoded first.

Stream must have a 'header' representing the stream parameters, a sequence of 'buffers' containing the data, and an 'end' indicating the end of the stream.

    Time ----------------------->
       0    

"front" [header][chk1][chk2]....[end] "tail"

The stream additionally has a 'position' that always points to one of the above elements and starts from front. Stepping the stream moves the stream position +1 chunk forward towards the tail.

The stream API can be used in a way that chunks can be pushed to the tail while the position counter is advancing from the head towards the tail. Although this would allow interleaving pushes and reads, currently the Tracker works in a way that when a track is loaded or recorded, only push() operations are done until the finish. On the other hand, when the track is sent out, only peek() and step() are used to retrieve the chunks.

Currently Tracker Plugins are allowed to access the tracks in a random access fashion, as well as the GUI.