#include <livereceiver.h>
Public Member Functions | |
virtual void | open (UpnpOpenFileMode mode) |
virtual int | read (char *buf, size_t buflen) |
virtual int | write (char *buf, size_t buflen) |
virtual int | seek (off_t offset, int whence) |
virtual void | close () |
Static Public Member Functions | |
static cLiveReceiver * | newInstance (cChannel *Channel, int Priority) |
Protected Member Functions | |
virtual void | Receive (uchar *Data, int Length) |
virtual void | Activate (bool On) |
virtual void | Action (void) |
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.
void cLiveReceiver::Action | ( | void | ) | [protected, virtual] |
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
void cLiveReceiver::Activate | ( | bool | On | ) | [protected, virtual] |
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 true
, the receiver will be activated. If it is false
, the receiver will be deactivated and stops its threads.
On | Activates the receiver thread |
void cLiveReceiver::close | ( | ) | [virtual] |
Closes the open file
This will close open file handles and frees the memory obtained by it.
Implements cFileHandle.
cLiveReceiver * cLiveReceiver::newInstance | ( | cChannel * | Channel, | |
int | Priority | |||
) | [static] |
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.
Channel | the channel which shall be tuned | |
Priority | the priority level |
void cLiveReceiver::open | ( | UpnpOpenFileMode | mode | ) | [virtual] |
Opens the file
Opens the file at the given mode. These can be:
mode | The file mode, i.e. one of the following
|
Implements cFileHandle.
int cLiveReceiver::read | ( | char * | buf, | |
size_t | buflen | |||
) | [virtual] |
Reads from the file
Reads from the file a certain amount of bytes and stores them in a buffer
buf | The char buffer | |
buflen | The size of the buffer |
Implements cFileHandle.
void cLiveReceiver::Receive | ( | uchar * | Data, | |
int | Length | |||
) | [protected, virtual] |
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
Data | The data received from VDR | |
Length | The length of the data packet, usually 188 bytes |
int cLiveReceiver::seek | ( | off_t | offset, | |
int | whence | |||
) | [virtual] |
Seeks in the file
Seeks in the file where the offset is the relativ position depending on the second parameter. This means, in case of
offset | The byte offset in the file | |
whence | one of the following
|
Implements cFileHandle.
int cLiveReceiver::write | ( | char * | buf, | |
size_t | buflen | |||
) | [virtual] |
Writes to the file
Writes to the file a certain amount of bytes which are stored in a buffer
buf | The char buffer | |
buflen | The size of the buffer |
Implements cFileHandle.