Go to the documentation of this file.
108 if (--fh->
used <= 0) {
153 fi->SetStatus(
false);
174 pollfd pfd[NumFilters];
177 pfd[i].fd = fh->handle;
178 pfd[i].events = POLLIN;
184 if (poll(pfd, NumFilters, 1000) > 0) {
188 for (
int i = 0; i < NumFilters; i++) {
189 if (pfd[i].revents & POLLIN) {
195 if (pfd[i].fd == fh->
handle)
200 unsigned char buf[4096];
205 int len = (((buf[1] & 0x0F) << 8) | (buf[2] & 0xFF)) + 3;
211 if (fi->Matches(pid, tid))
212 fi->Process(pid, tid, buf, len);
216 dsyslog(
"read incomplete section - len = %d, r = %d", len, r);
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)
time_t lastIncompleteSection
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...
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)
static void SleepMs(int TimeoutMs)
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the...
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