43 :
cThread(
"section handler", true)
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);
215 dsyslog(
"read incomplete section - len = %d, r = %d", len, r);
cList< cFilterHandle > filterHandles
void Add(cListObject *Object, cListObject *After=NULL)
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask)
Opens a file handle for the given filter data.
const cChannel * Channel(void)
virtual int ReadFilter(int Handle, void *Buffer, size_t Length)
Reads data from a handle for the given filter.
virtual ~cSectionHandler()
void Detach(cFilter *Filter)
void Add(const cFilterData *FilterData)
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
void SetChannel(const cChannel *Channel)
T * Next(const T *object) const
cSectionHandler(cDevice *Device)
virtual void Action(void)
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
virtual bool HasLock(int TimeoutMs=0) const
Returns true if the device has a lock on the requested transponder.
static void SleepMs(int TimeoutMs)
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the...
void bool Start(void)
Actually starts the thread.
cSectionHandler * sectionHandler
bool Running(void)
Returns false if a derived cThread object shall leave its Action() function.
bool Is(u_short Pid, u_char Tid, u_char Mask)
virtual void CloseFilter(int Handle)
Closes a file handle that has previously been opened by OpenFilter().
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
void Del(cListObject *Object, bool DeleteObject=true)
time_t lastIncompleteSection
cSectionHandlerPrivate * shp
void Attach(cFilter *Filter)
cFilterHandle(const cFilterData &FilterData)
void Cancel(int WaitSeconds=0)
Cancels the thread by first setting 'running' to false, so that the Action() loop can finish in an or...
The cDevice class is the base from which actual devices can be derived.
void Del(const cFilterData *FilterData)