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

FrameCache works like FrameFifo, but frames are not pre-reserved. More...

#include <cachestream.h>

Collaboration diagram for FrameCache:
Collaboration graph
[legend]

Public Member Functions

 FrameCache (const char *name, FrameCacheContext ctx=FrameCacheContext())
 
 ban_copy_ctor (FrameCache)
 
 ban_copy_asm (FrameCache)
 
long int getMinTime_ ()
 
long int getMaxTime_ ()
 
bool hasDeltaFrames ()
 
virtual bool writeCopy (Frame *f, bool wait=false)
 Take a frame "ftmp" from the stack, copy contents of "f" into "ftmp" and insert "ftmp" into the beginning of the fifo (i.e. perform "copy-on-insert"). The size of "ftmp" is also checked and set to target_size, if necessary. If wait is set to true, will wait until there are frames available in the stack.
 
void clear ()
 Clear the cache.
 
void dump ()
 Dump frames in the cache.
 
bool isEmpty ()
 Cache empty or not.
 
int seek (long int ms_streamtime_)
 Seek to a desider stream time. -1 = no frames at left, 1 = no frames at right, 0 = ok.
 
int keySeek (long int ms_streamtime_)
 Seek to a desider stream time. -1 = no frames at left, 1 = no frames at right, 0 = ok. From the nearest key-frame to the target frame.
 
FramepullNextFrame ()
 Get the next frame. Returns NULL if no frame was available.
 

Protected Member Functions

void dump_ ()
 
void clear_ ()
 

Protected Attributes

std::string name
 
FrameCacheContext ctx
 Parameters defining the cache.
 
long int mintime_
 smallest frame timestamp (frametime)
 
long int maxtime_
 biggest frame timestamp (frametime)
 
bool has_delta_frames
 Does the cache have streams with key-frame, delta-frame sequences.
 
Cache cache
 The queue.
 
Cache::iterator state
 The state of the queue.
 
std::mutex mutex
 The Lock.
 
std::condition_variable condition
 The Event/Flag.
 
std::condition_variable ready_condition
 The Event/Flag for FrameFifo::ready_mutex.
 

Detailed Description

FrameCache works like FrameFifo, but frames are not pre-reserved.

They are reserved / released on-the-spot


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