1 #ifndef cachestream_HEADER_GUARD
2 #define cachestream_HEADER_GUARD
58 slot(slot), framefilter(framefilter)
141 long int getMinTime_() {
return this->
mintime_; }
142 long int getMaxTime_() {
return this->
maxtime_; }
155 int seek(
long int ms_streamtime_);
156 int keySeek(
long int ms_streamtime_);
223 void (*callback)(
long int mstimestamp);
247 void dumpPlayCache();
250 void stopStreams(
bool send_state =
true);
251 void playStreams(
bool send_state =
true);
258 void handleSignals();
259 int safeGetSlot(SlotNumber slot,
FrameFilter *&ff);
264 void setCallback(
void func(
long int));
292 void stopStreamsCall();
293 void playStreamsCall();
FileCacheSignal
Signals for FileCacheThread.
Definition: cachestream.h:83
This class uses AbstractFileStream(s)
Definition: filestream.h:136
Passes frames to a FrameCache.
Definition: cachestream.h:167
CacheFrameFilter(const char *name, FrameCache *framecache)
Default constructor.
Definition: cachestream.cpp:37
void go(Frame *frame)
Does the actual filtering/modification to the Frame. Define in subclass.
Definition: cachestream.cpp:40
Thread that caches frames and streams them into output at play speed.
Definition: cachestream.h:206
void clear()
Removes any reference time. Stops stream.
Definition: cachestream.cpp:543
void sendSetupFrames(SetupFrame *f)
Sends SetupFrame s to all active slots.
Definition: cachestream.cpp:436
void preRun()
Called before entering the main execution loop, but after creating the thread.
Definition: cachestream.cpp:804
SetupFrame state_setupframe
SetupFrame for sending the stream state (seek, play, etc.)
Definition: cachestream.h:231
long int reftime
walltime = frametime_ + reftime
Definition: cachestream.h:228
ForkFrameFilter fork
Write incoming frames here.
Definition: cachestream.h:213
void seekStreamsCall(long int mstimestamp, bool clear=false)
Seek.
Definition: cachestream.cpp:1026
FrameFilter & getFrameFilter()
Framefilter for writing frames to FileCacheThread.
Definition: cachestream.cpp:862
void seekStreams(long int mstimestamp, bool clear, bool send_state=true)
Sets target time. Sets FileCacheThread::next = NULL.
Definition: cachestream.cpp:502
FrameCache * play_cache
Points to the current play cache (default frame_cache_2)
Definition: cachestream.h:221
void requestStopCall()
API method: stops the thread.
Definition: cachestream.cpp:866
void setRefTimeAndStop(bool send_state=true)
Set reference time and set state to stop.
Definition: cachestream.cpp:488
std::deque< FileCacheSignalContext > signal_fifo
Redefinition of signal fifo.
Definition: cachestream.h:234
FrameCache * tmp_cache
Points to current cache receiving frames.
Definition: cachestream.h:222
long int target_mstimestamp_
We should be at this time instant (streamtime)
Definition: cachestream.h:226
PyObject * pyfunc2
Python callback that emits current loaded time limits.
Definition: cachestream.h:225
void registerStreamCall(FileStreamContext &ctx)
Pass frames downstream.
Definition: cachestream.cpp:931
void run()
Main execution loop is defined here.
Definition: cachestream.cpp:558
PyObject * pyfunc
Python callback that emits current time.
Definition: cachestream.h:224
void postRun()
Called after the main execution loop exits, but before joining the thread.
Definition: cachestream.cpp:807
void setPyCallback2(PyObject *pobj)
Define callback.
Definition: cachestream.cpp:349
std::vector< FrameFilter * > slots_
Slot number => output framefilter mapping.
Definition: cachestream.h:235
void setPyCallback(PyObject *pobj)
Define callback.
Definition: cachestream.cpp:330
std::vector< std::vector< SetupFrame * > > setup_frames
Slot number, subsession_index => SetupFrame mapping. Book-keeping of SetupFrames.
Definition: cachestream.h:237
Replicates frame flow to two filters Use this frame filter to create frame filter tree structures.
Definition: framefilter.h:141
FrameCache works like FrameFifo, but frames are not pre-reserved.
Definition: cachestream.h:116
int seek(long int ms_streamtime_)
Seek to a desider stream time. -1 = no frames at left, 1 = no frames at right, 0 = ok.
Definition: cachestream.cpp:144
std::condition_variable ready_condition
The Event/Flag for FrameFifo::ready_mutex.
Definition: cachestream.h:138
Frame * pullNextFrame()
Get the next frame. Returns NULL if no frame was available.
Definition: cachestream.cpp:283
bool has_delta_frames
Does the cache have streams with key-frame, delta-frame sequences.
Definition: cachestream.h:129
void clear()
Clear the cache.
Definition: cachestream.cpp:112
Cache::iterator state
The state of the queue.
Definition: cachestream.h:133
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 begin...
Definition: cachestream.cpp:56
std::mutex mutex
The Lock.
Definition: cachestream.h:136
long int mintime_
smallest frame timestamp (frametime)
Definition: cachestream.h:127
void dump()
Dump frames in the cache.
Definition: cachestream.cpp:133
long int maxtime_
biggest frame timestamp (frametime)
Definition: cachestream.h:128
int keySeek(long int ms_streamtime_)
Seek to a desider stream time. -1 = no frames at left, 1 = no frames at right, 0 = ok....
Definition: cachestream.cpp:199
std::condition_variable condition
The Event/Flag.
Definition: cachestream.h:137
bool isEmpty()
Cache empty or not.
Definition: cachestream.cpp:138
FrameCacheContext ctx
Parameters defining the cache.
Definition: cachestream.h:126
Cache cache
The queue.
Definition: cachestream.h:132
The mother class of all frame filters! FrameFilters are used to create "filter chains".
Definition: framefilter.h:44
Frame: An abstract queueable class.
Definition: frame.h:112
Setup frame.
Definition: frame.h:277
Passes frame to one of the two terminals.
Definition: framefilter.h:401
std::string name
Name of the thread.
Definition: thread.h:116
Passes through frames of certain type only.
Definition: framefilter.h:431
Thread safe system of fifo and a stack.
AbstractFileState
Describes the state of a stream.
Definition: threadsignal.h:43
Encapsulate data sent to FileCacheThread.
Definition: cachestream.h:101
Signal information for FileCacheThread.
Definition: cachestream.h:70
long int mstimestamp
Seek: use existing frames for seek or clear the state.
Definition: cachestream.h:74
FileStreamContext file_stream_ctx
< Identifies the stream
Definition: cachestream.h:72
Definition: cachestream.h:56
Definition: cachestream.h:107
@ none
undefined (initial value)
Definition: usbthread.h:143