Go to the documentation of this file.
109 if (--fh->
used <= 0) {
154 fi->SetStatus(
false);
170 #define FLUSH_TIME 100 // ms
183 pollfd pfd[NumFilters];
186 pfd[i].fd = fh->handle;
187 pfd[i].events = POLLIN;
193 if (poll(pfd, NumFilters, (!
on ||
waitForLock) ? 100 : 1000) > 0) {
194 for (
int i = 0; i < NumFilters; i++) {
195 if (pfd[i].revents & POLLIN) {
201 if (pfd[i].fd == fh->
handle)
206 unsigned char buf[4096];
211 int len = (((buf[1] & 0x0F) << 8) | (buf[2] & 0xFF)) + 3;
217 if (fi->Matches(pid, tid))
218 fi->Process(pid, tid, buf, len);
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
void Add(const cFilterData *FilterData)
void SetChannel(const cChannel *Channel)
const cChannel * Channel(void)
void Add(cListObject *Object, cListObject *After=NULL)
cSectionHandler(cDevice *Device)
void Cancel(int WaitSeconds=0)
Cancels the thread by first setting 'running' to false, so that the Action() loop can finish in an or...
virtual void CloseFilter(int Handle)
Closes a file handle that has previously been opened by OpenFilter().
cList< cFilterHandle > filterHandles
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
void Set(int Ms=0)
Sets the timer.
cSectionHandlerPrivate * shp
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
cFilterHandle(const cFilterData &FilterData)
void Detach(cFilter *Filter)
void Del(cListObject *Object, bool DeleteObject=true)
bool Running(void)
Returns false if a derived cThread object shall leave its Action() function.
void Del(const cFilterData *FilterData)
const T * First(void) const
Returns the first element in this list, or NULL if the list is empty.
void Attach(cFilter *Filter)
virtual ~cSectionHandler()
bool Is(u_short Pid, u_char Tid, u_char Mask)
void SetDescription(const char *Description,...) __attribute__((format(printf
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
const T * Next(const T *Object) const
< Returns the element immediately before Object in this list, or NULL if Object is the first element ...
void bool Start(void)
Sets the description of this thread, which will be used when logging starting or stopping of the thre...
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
virtual int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
cSectionHandler * sectionHandler
uint64_t Elapsed(void) const