| Valkka
    1.6.1
    OpenSource Video Management | 
ValkkaFS reader thread. More...
#include <valkkafsreader.h>


| Public Member Functions | |
| ValkkaFSReaderThread (const char *name, ValkkaFS &valkkafs, FrameFilter &outfilter, FrameFifoContext fifo_ctx=FrameFifoContext(10), bool o_direct=false) | |
| void | run () | 
| Main execution loop is defined here. | |
| void | preRun () | 
| Called before entering the main execution loop, but after creating the thread. | |
| void | postRun () | 
| Called after the main execution loop exits, but before joining the thread. | |
| void | sendSignal (ValkkaFSReaderSignalContext signal_ctx) | 
| Insert a signal into the signal_fifo. | |
| FifoFrameFilter & | getFrameFilter () | 
| void | setSlotIdCall (SlotNumber slot, IdNumber id) | 
| Set a id number => slot mapping. | |
| void | unSetSlotIdCall (IdNumber id) | 
| Clear a id number => slot mapping. | |
| void | clearSlotIdCall () | 
| Clear all id number => slot mappings. | |
| void | reportSlotIdCall () | 
| Print id number => slot mappings. | |
| void | pullBlocksCall (std::list< std::size_t > block_list) | 
| void | pullBlocksPyCall (PyObject *pylist) | 
| Request blocks with python list. | |
| void | requestStopCall () | 
| API method: stops the thread.  More... | |
|  Public Member Functions inherited from Thread | |
| Thread (const char *name) | |
| Default constructor.  More... | |
| ~Thread () | |
| Destructor:not virtual.  More... | |
| virtual void | preJoin () | 
| Called before the thread is joined. | |
| virtual void | postJoin () | 
| Called after the thread has been joined. | |
| virtual void | sendSignal (SignalContext signal_ctx) | 
| Send a signal to the thread. | |
| virtual void | sendSignalAndWait (SignalContext signal_ctx) | 
| Send a signal to the thread and wait for all signals to be executed. | |
| void | setAffinity (int i) | 
| API method for setting the thread affinity.  More... | |
| void | startCall () | 
| API method: starts the thread. | |
| virtual void | stopCall () | 
| API method: stops the thread.  More... | |
| virtual void | waitStopCall () | 
| API method: waits until the thread is joined.  More... | |
| virtual void | waitReady () | 
| Wait until thread has processed all its signals. | |
| Protected Member Functions | |
| void | handleSignal (ValkkaFSReaderSignalContext &signal_ctx) | 
| Handle an individual signal. Signal can originate from the frame fifo or from the signal_fifo deque. | |
| void | handleSignals () | 
| Call ValkkaFSReaderThread::handleSignal for every signal in the signal_fifo. | |
| void | setSlotId (SlotNumber slot, IdNumber id) | 
| void | unSetSlotId (IdNumber id) | 
| void | clearSlotId () | 
| void | reportSlotId () | 
| void | pullBlocks (std::list< std::size_t > block_list) | 
|  Protected Member Functions inherited from Thread | |
| void | mainRun () | 
| Does the preRun, run, postRun sequence. | |
| void | closeThread () | 
| Sends exit signal to the thread, calls join. This method blocks until thread has exited. Set Thread::has_thread to false. | |
| Protected Attributes | |
| ValkkaFS & | valkkafs | 
| FrameFilter & | outfilter | 
| std::map< IdNumber, SlotNumber > | id_to_slot | 
| RawReader | raw_reader | 
| FrameFifo | infifo | 
| Incoming frames are read from here. The stream is "stateless", so you have to add SetupFrames (for example, by using FileCacherThread) | |
| FifoFrameFilter | infilter | 
| Write incoming frames here. Only for SignalFrames. | |
| std::deque< ValkkaFSReaderSignalContext > | signal_fifo | 
| Redefinition of signal fifo. | |
|  Protected Attributes inherited from Thread | |
| std::string | name | 
| Name of the thread. | |
| bool | has_thread | 
| true if thread has been started | |
| bool | stop_requested | 
| bool | thread_joined | 
| std::mutex | start_mutex | 
| Mutex protecting start_condition. | |
| std::condition_variable | start_condition | 
| Notified when the thread has been started. | |
| std::mutex | mutex | 
| Mutex protecting the condition variable and signal queue. | |
| std::condition_variable | condition | 
| Condition variable for the signal queue (triggered when all signals processed). Not necessarily used by all subclasses. | |
| std::mutex | loop_mutex | 
| Protects thread's main execution loop (if necessary) | |
| std::deque< SignalContext > | signal_fifo | 
| Signal queue (fifo). Redefine in child classes. | |
| bool | loop | 
| Use this boolean to control if the main loop in Thread:run should exit. | |
| int | core_id | 
| pthread_attr_t | thread_attr | 
| Thread attributes, pthread_* way. | |
| cpu_set_t | cpuset | 
| pthread_t | internal_thread | 
| Additional Inherited Members | |
|  Static Protected Member Functions inherited from Thread | |
| static void * | mainRun_ (void *p) | 
ValkkaFS reader thread.
Frames are requested on per-block basis
This thread just knows how to send a block of frames, so its sending "stateless stream"
That means that there's no notion of stream start = no SetupFrames are sent
SetupFrames are typically added to the stream later on the filterchain, for example, using FileCacherThread.
| 
 | virtual | 
API method: stops the thread.
Like Thread::stopCall() but does not block. Waiting for the thread to join is done in Thread::waitStoppedCall()
Reimplemented from Thread.