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