Valkka  0.10.0
OpenSource Video Management
Public Member Functions | Public Attributes | Protected Attributes | List of all members
CacheStream Class Reference

Caches (a large amount of) frames and pushes them forward at a rate corresponding to play speed. More...

#include <cachestream.h>

Inheritance diagram for CacheStream:
Inheritance graph
[legend]
Collaboration diagram for CacheStream:
Collaboration graph
[legend]

Public Member Functions

 CacheStream (const char *name, FrameCacheContext cache_ctx=FrameCacheContext())
 
virtual ~CacheStream ()
 Default virtual destructor.
 
long int getMinTime_ ()
 
long int getMaxTime_ ()
 
CacheFrameFiltergetFrameFilter ()
 
void dumpCache ()
 
void seek (long int ms_streamtime_)
 Set the state of CacheStream::cache to frame corresponding to this time.
 
long int pullNextFrame ()
 Pulls the next frame. More...
 
long int update (long int mstimestamp)
 Calculates FileStream::target_mstimestamp_ and calls pullNextFrame. Returns the timeout for the next frame.
 
- Public Member Functions inherited from AbstractFileStream
 AbstractFileStream ()
 Default constructor. More...
 
AbstractFileState getState ()
 
void setRefMstime (long int ms_streamtime_)
 Creates a correspondence with the current wallclock time and a desider stream time, by calculating FileStream::reftime. See Presention timing and playing.
 
void play ()
 Start playing the stream.
 
void stop ()
 Stop playing the strem.
 
long int update (long int mstimestamp)
 Tries to achieve mstimestamp: calculates FileStream::target_mstimestamp_ and calls pullNextFrame. Returns the timeout for the next frame.
 

Public Attributes

std::map< SlotNumber, FrameFilter * > slots_
 Manipulated by the thread that's using CacheStream.
 

Protected Attributes

FrameCache cache
 
CacheFrameFilter infilter
 
AbstractFileState state
 
long int reftime
 Relation between the stream time and wallclock time. See Presention timing and playing.
 
long int target_mstimestamp_
 Where the stream would like to be (underscore means stream time)
 
long int frame_mstimestamp_
 Timestamp of previous frame sent, -1 means there was no previous frame (underscore means stream time)
 
- Protected Attributes inherited from AbstractFileStream
long int reftime
 Relation between the stream time and wallclock time. See Presention timing and playing.
 
long int target_mstimestamp_
 Where the stream would like to be (underscore means stream time)
 
long int frame_mstimestamp_
 Timestamp of previous frame sent, -1 means there was no previous frame (underscore means stream time)
 
AbstractFileState state
 Decribes the FileStream state: errors, stopped, playing, etc.
 
Framenext_frame
 Pointer to the next frame about to be presented.
 
BasicFrame out_frame
 BasicFrame payload that's passed on to the filterchain.
 

Detailed Description

Caches (a large amount of) frames and pushes them forward at a rate corresponding to play speed.

CacheStream CacheFrameFilter (pyapi) –> FrameCache getFrameFilter : returns CacheFrameFilter

FileCacheThread (pyapi) uses CacheStream getFrameFilter : uses CacheStream::getFrameFilter Similar to LiveThread, give output contexes (certain slot to certain framefilter)

Filesystem thread writes to FileCacheThread::getFrameFilter

Member Function Documentation

◆ pullNextFrame()

long int CacheStream::pullNextFrame ( )
virtual

Pulls the next frame.

  • Transmits this->next_frame
  • Gets the next frame in going towards the target_mstimestamps_
  • .. and puts it into this->next_frame
  • Returns the timeout, i.e. the difference between target_mstimestamp_ and this->next_frame.mstimestamp
  • If timeout is = 0, calls itself recursively

Reimplemented from AbstractFileStream.


The documentation for this class was generated from the following files: