diff options
Diffstat (limited to 'receiver/livereceiver.h')
-rw-r--r-- | receiver/livereceiver.h | 66 |
1 files changed, 63 insertions, 3 deletions
diff --git a/receiver/livereceiver.h b/receiver/livereceiver.h index 6b04619..92fe140 100644 --- a/receiver/livereceiver.h +++ b/receiver/livereceiver.h @@ -17,18 +17,78 @@ #define RECEIVER_WAIT_ON_NODATA 50 // 50 ms #define RECEIVER_WAIT_ON_NODATA_TIMEOUT 1000 * 2 // 2s +/** + * A receiver for live TV + * + * This is a receiver object which is attached to a VDR tv card device. + * It is receiving transport stream packages and generates a single MPEG2 + * transport stream which can be distributed through the network. + * + */ class cLiveReceiver : public cReceiver, public cThread, public cFileHandle { public: - static cLiveReceiver* newInstance(cChannel *Channel, int Priority); + /** + * Creates a new receiver instance + * + * This will create a new instance of a live receiver for the specified + * channel at the specified priority level. + * + * A negativ priority means that the receiver may being detached from a + * device. + * + * The receiver must be free'd with delete after it is not used anylonger. + * + * @return returns a new liveReceiver instance + */ + static cLiveReceiver* newInstance( + cChannel *Channel, ///< the channel which shall be tuned + int Priority ///< the priority level + ); virtual ~cLiveReceiver(void); + /*! @copydoc cFileHandle::open(UpnpOpenFileMode) */ virtual void open(UpnpOpenFileMode mode); + /*! @copydoc cFileHandle::read(char*,size_t) */ virtual int read(char* buf, size_t buflen); + /*! @copydoc cFileHandle::write(char*,size_t) */ virtual int write(char* buf, size_t buflen); + /*! @copydoc cFileHandle::seek(off_t,int) */ virtual int seek(off_t offset, int whence); + /*! @copydoc cFileHandle::close() */ virtual void close(); protected: - virtual void Receive(uchar *Data, int Length); - virtual void Activate(bool On); + /** + * Receives data from VDR + * + * This is the interface for receiving packet data from the VDR. It buffers + * the incoming transport stream packets in a linear ringbuffer and returns + * immediatelly + */ + virtual void Receive( + uchar *Data, ///< The data received from VDR + int Length ///< The length of the data packet, usually 188 bytes + ); + /** + * Activates the receiver + * + * This activates the receiver which initializes internal data structures to + * be prepared for receiving data from the VDR + * + * If the parameter is \bc true, the receiver will be activated. If it is + * \bc false, the receiver will be deactivated and stops its threads. + */ + virtual void Activate( + bool On ///< Activates the receiver thread + ); + /** + * The receiver thread action + * + * This actually is the receiver thread, which runs consequitivelly and + * buffers any received video data from the interal incoming buffer to the + * internal outgoing buffer. + * + * While doing so, it tries to syncronize with the stream and creates new + * MPEG2-TS PATs and PMTs for a single MPEG2-TS stream + */ virtual void Action(void); private: cLiveReceiver(cChannel *Channel, cDevice *Device); |