openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
itssource.h
Go to the documentation of this file.
1 #ifndef __lib_base_idatasource_h
2 #define __lib_base_idatasource_h
3 
4 #include <lib/base/object.h>
5 
6 class iTsSource: public iObject
7 {
8 protected:
9  unsigned int packetSize;
10 
11 public:
12  iTsSource(unsigned int packetsize = 188) : packetSize(packetsize) {}
13 
14  /* NOTE: you must be able to handle short reads! */
15  virtual ssize_t read(off_t offset, void *buf, size_t count)=0; /* NOTE: this is what you in normal case have to use!! */
16 
17  /* Fetch the length, without side-effects like seeking */
18  virtual off_t length()=0;
19  virtual int valid()=0;
20  virtual off_t offset() = 0;
21  virtual bool isStream() { return false; }
22  virtual int reconnect() { return 0; }
23  unsigned int getPacketSize() const { return packetSize; }
24 };
25 
26 #endif
Definition: object.h:15
Definition: itssource.h:7
virtual off_t offset()=0
virtual ssize_t read(off_t offset, void *buf, size_t count)=0
virtual bool isStream()
Definition: itssource.h:21
unsigned int packetSize
Definition: itssource.h:9
unsigned int getPacketSize() const
Definition: itssource.h:23
virtual int valid()=0
iTsSource(unsigned int packetsize=188)
Definition: itssource.h:12
virtual int reconnect()
Definition: itssource.h:22
virtual off_t length()=0
int count
Definition: newplugin.py:14