vdr  2.0.6
pat.c
Go to the documentation of this file.
1 /*
2  * pat.c: PAT section filter
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: pat.c 2.19.1.2 2014/02/19 09:31:29 kls Exp $
8  */
9 
10 #include "pat.h"
11 #include <malloc.h>
12 #include "channels.h"
13 #include "libsi/section.h"
14 #include "libsi/descriptor.h"
15 
16 #define PMT_SCAN_TIMEOUT 1000 // ms
17 
18 // --- cCaDescriptor ---------------------------------------------------------
19 
20 class cCaDescriptor : public cListObject {
21 private:
22  int caSystem;
23  int esPid;
24  int length;
26 public:
27  cCaDescriptor(int CaSystem, int CaPid, int EsPid, int Length, const uchar *Data);
28  virtual ~cCaDescriptor();
29  bool operator== (const cCaDescriptor &arg) const;
30  int CaSystem(void) { return caSystem; }
31  int EsPid(void) { return esPid; }
32  int Length(void) const { return length; }
33  const uchar *Data(void) const { return data; }
34  };
35 
36 cCaDescriptor::cCaDescriptor(int CaSystem, int CaPid, int EsPid, int Length, const uchar *Data)
37 {
39  esPid = EsPid;
40  length = Length + 6;
41  data = MALLOC(uchar, length);
43  data[1] = length - 2;
44  data[2] = (caSystem >> 8) & 0xFF;
45  data[3] = caSystem & 0xFF;
46  data[4] = ((CaPid >> 8) & 0x1F) | 0xE0;
47  data[5] = CaPid & 0xFF;
48  if (Length)
49  memcpy(&data[6], Data, Length);
50 }
51 
53 {
54  free(data);
55 }
56 
58 {
59  return esPid == arg.esPid && length == arg.length && memcmp(data, arg.data, length) == 0;
60 }
61 
62 // --- cCaDescriptors --------------------------------------------------------
63 
64 class cCaDescriptors : public cListObject {
65 private:
66  int source;
68  int serviceId;
69  int numCaIds;
70  int caIds[MAXCAIDS + 1];
72  void AddCaId(int CaId);
73 public:
74  cCaDescriptors(int Source, int Transponder, int ServiceId);
75  bool operator== (const cCaDescriptors &arg) const;
76  bool Is(int Source, int Transponder, int ServiceId);
77  bool Is(cCaDescriptors * CaDescriptors);
78  bool Empty(void) { return caDescriptors.Count() == 0; }
79  void AddCaDescriptor(SI::CaDescriptor *d, int EsPid);
80  int GetCaDescriptors(const int *CaSystemIds, int BufSize, uchar *Data, int EsPid);
81  const int *CaIds(void) { return caIds; }
82  };
83 
84 cCaDescriptors::cCaDescriptors(int Source, int Transponder, int ServiceId)
85 {
86  source = Source;
87  transponder = Transponder;
88  serviceId = ServiceId;
89  numCaIds = 0;
90  caIds[0] = 0;
91 }
92 
94 {
96  cCaDescriptor *ca2 = arg.caDescriptors.First();
97  while (ca1 && ca2) {
98  if (!(*ca1 == *ca2))
99  return false;
100  ca1 = caDescriptors.Next(ca1);
101  ca2 = arg.caDescriptors.Next(ca2);
102  }
103  return !ca1 && !ca2;
104 }
105 
106 bool cCaDescriptors::Is(int Source, int Transponder, int ServiceId)
107 {
108  return source == Source && transponder == Transponder && serviceId == ServiceId;
109 }
110 
111 bool cCaDescriptors::Is(cCaDescriptors *CaDescriptors)
112 {
113  return Is(CaDescriptors->source, CaDescriptors->transponder, CaDescriptors->serviceId);
114 }
115 
117 {
118  if (numCaIds < MAXCAIDS) {
119  for (int i = 0; i < numCaIds; i++) {
120  if (caIds[i] == CaId)
121  return;
122  }
123  caIds[numCaIds++] = CaId;
124  caIds[numCaIds] = 0;
125  }
126 }
127 
129 {
130  cCaDescriptor *nca = new cCaDescriptor(d->getCaType(), d->getCaPid(), EsPid, d->privateData.getLength(), d->privateData.getData());
131  for (cCaDescriptor *ca = caDescriptors.First(); ca; ca = caDescriptors.Next(ca)) {
132  if (*ca == *nca) {
133  delete nca;
134  return;
135  }
136  }
137  AddCaId(nca->CaSystem());
138  caDescriptors.Add(nca);
139 //#define DEBUG_CA_DESCRIPTORS 1
140 #ifdef DEBUG_CA_DESCRIPTORS
141  char buffer[1024];
142  char *q = buffer;
143  q += sprintf(q, "CAM: %04X %5d %5d %04X %04X -", source, transponder, serviceId, d->getCaType(), EsPid);
144  for (int i = 0; i < nca->Length(); i++)
145  q += sprintf(q, " %02X", nca->Data()[i]);
146  dsyslog("%s", buffer);
147 #endif
148 }
149 
150 // EsPid is to select the "type" of CaDescriptor to be returned
151 // >0 - CaDescriptor for the particular esPid
152 // =0 - common CaDescriptor
153 // <0 - all CaDescriptors regardless of type (old default)
154 
155 int cCaDescriptors::GetCaDescriptors(const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
156 {
157  if (!CaSystemIds || !*CaSystemIds)
158  return 0;
159  if (BufSize > 0 && Data) {
160  int length = 0;
161  for (cCaDescriptor *d = caDescriptors.First(); d; d = caDescriptors.Next(d)) {
162  if (EsPid < 0 || d->EsPid() == EsPid) {
163  const int *caids = CaSystemIds;
164  do {
165  if (d->CaSystem() == *caids) {
166  if (length + d->Length() <= BufSize) {
167  memcpy(Data + length, d->Data(), d->Length());
168  length += d->Length();
169  }
170  else
171  return -1;
172  }
173  } while (*++caids);
174  }
175  }
176  return length;
177  }
178  return -1;
179 }
180 
181 // --- cCaDescriptorHandler --------------------------------------------------
182 
183 class cCaDescriptorHandler : public cList<cCaDescriptors> {
184 private:
186 public:
187  int AddCaDescriptors(cCaDescriptors *CaDescriptors);
188  // Returns 0 if this is an already known descriptor,
189  // 1 if it is an all new descriptor with actual contents,
190  // and 2 if an existing descriptor was changed.
191  int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid);
192  };
193 
195 {
196  cMutexLock MutexLock(&mutex);
197  for (cCaDescriptors *ca = First(); ca; ca = Next(ca)) {
198  if (ca->Is(CaDescriptors)) {
199  if (*ca == *CaDescriptors) {
200  delete CaDescriptors;
201  return 0;
202  }
203  Del(ca);
204  Add(CaDescriptors);
205  return 2;
206  }
207  }
208  Add(CaDescriptors);
209  return CaDescriptors->Empty() ? 0 : 1;
210 }
211 
212 int cCaDescriptorHandler::GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
213 {
214  cMutexLock MutexLock(&mutex);
215  for (cCaDescriptors *ca = First(); ca; ca = Next(ca)) {
216  if (ca->Is(Source, Transponder, ServiceId))
217  return ca->GetCaDescriptors(CaSystemIds, BufSize, Data, EsPid);
218  }
219  return 0;
220 }
221 
223 
224 int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
225 {
226  return CaDescriptorHandler.GetCaDescriptors(Source, Transponder, ServiceId, CaSystemIds, BufSize, Data, EsPid);
227 }
228 
229 // --- cPatFilter ------------------------------------------------------------
230 
231 //#define DEBUG_PAT_PMT
232 #ifdef DEBUG_PAT_PMT
233 #define DBGLOG(a...) { cString s = cString::sprintf(a); fprintf(stderr, "%s\n", *s); dsyslog("%s", *s); }
234 #else
235 #define DBGLOG(a...)
236 #endif
237 
239 {
240  Trigger(0);
241  Set(0x00, 0x00); // PAT
242 }
243 
245 {
246  cMutexLock MutexLock(&mutex);
247  DBGLOG("PAT filter set status %d", On);
248  cFilter::SetStatus(On);
249  Trigger();
250 }
251 
252 void cPatFilter::Trigger(int Sid)
253 {
254  cMutexLock MutexLock(&mutex);
255  patVersion = -1;
256  pmtIndex = -1;
257  numPmtEntries = 0;
258  if (Sid >= 0) {
259  sid = Sid;
260  DBGLOG("PAT filter trigger SID %d", Sid);
261  }
262 }
263 
264 bool cPatFilter::PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion)
265 {
266  int Id = MakePmtId(PmtPid, Sid);
267  for (int i = 0; i < numPmtEntries; i++) {
268  if (pmtId[i] == Id) {
269  if (pmtVersion[i] != Version) {
270  if (SetNewVersion)
271  pmtVersion[i] = Version;
272  else
273  DBGLOG("PMT %d %2d %5d %2d -> %2d", Transponder(), i, PmtPid, pmtVersion[i], Version);
274  return true;
275  }
276  break;
277  }
278  }
279  return false;
280 }
281 
283 {
284  if (pmtIndex >= 0) {
286  pmtIndex = (pmtIndex + 1) % numPmtEntries;
288  }
289 }
290 
291 void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
292 {
293  cMutexLock MutexLock(&mutex);
294  if (Pid == 0x00) {
295  if (Tid == SI::TableIdPAT) {
296  SI::PAT pat(Data, false);
297  if (!pat.CheckCRCAndParse())
298  return;
299  if (pat.getVersionNumber() != patVersion) {
300  DBGLOG("PAT %d %d -> %d", Transponder(), patVersion, pat.getVersionNumber());
301  if (pmtIndex >= 0) {
303  pmtIndex = -1;
304  }
305  numPmtEntries = 0;
306  SI::PAT::Association assoc;
307  for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
308  if (!assoc.isNITPid() && numPmtEntries < MAXPMTENTRIES) {
309  DBGLOG(" PMT pid %2d %5d SID %5d", numPmtEntries, assoc.getPid(), assoc.getServiceId());
310  pmtId[numPmtEntries] = MakePmtId(assoc.getPid(), assoc.getServiceId());
312  if (sid == assoc.getServiceId()) {
314  DBGLOG("sid = %d pmtIndex = %d", sid, pmtIndex);
315  }
316  numPmtEntries++;
317  }
318  }
319  if (numPmtEntries > 0 && pmtIndex < 0)
320  pmtIndex = 0;
324  }
325  }
326  }
327  else if (Tid == SI::TableIdPMT && Source() && Transponder()) {
329  SI::PMT pmt(Data, false);
330  if (!pmt.CheckCRCAndParse())
331  return;
332  if (!PmtVersionChanged(Pid, pmt.getTableIdExtension(), pmt.getVersionNumber())) {
334  return;
335  }
336  if (!Channels.Lock(true, 10))
337  return;
338  PmtVersionChanged(Pid, pmt.getTableIdExtension(), pmt.getVersionNumber(), true);
341  if (Channel) {
342  SI::CaDescriptor *d;
343  cCaDescriptors *CaDescriptors = new cCaDescriptors(Channel->Source(), Channel->Transponder(), Channel->Sid());
344  // Scan the common loop:
346  CaDescriptors->AddCaDescriptor(d, 0);
347  delete d;
348  }
349  // Scan the stream-specific loop:
350  SI::PMT::Stream stream;
351  int Vpid = 0;
352  int Ppid = 0;
353  int Vtype = 0;
354  int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated
355  int Atypes[MAXAPIDS + 1] = { 0 };
356  int Dpids[MAXDPIDS + 1] = { 0 };
357  int Dtypes[MAXDPIDS + 1] = { 0 };
358  int Spids[MAXSPIDS + 1] = { 0 };
359  uchar SubtitlingTypes[MAXSPIDS + 1] = { 0 };
360  uint16_t CompositionPageIds[MAXSPIDS + 1] = { 0 };
361  uint16_t AncillaryPageIds[MAXSPIDS + 1] = { 0 };
362  char ALangs[MAXAPIDS][MAXLANGCODE2] = { "" };
363  char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" };
364  char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" };
365  int Tpid = 0;
366  int NumApids = 0;
367  int NumDpids = 0;
368  int NumSpids = 0;
369  for (SI::Loop::Iterator it; pmt.streamLoop.getNext(stream, it); ) {
370  bool ProcessCaDescriptors = false;
371  int esPid = stream.getPid();
372  switch (stream.getStreamType()) {
373  case 1: // STREAMTYPE_11172_VIDEO
374  case 2: // STREAMTYPE_13818_VIDEO
375  case 0x1B: // H.264
376  Vpid = esPid;
377  Ppid = pmt.getPCRPid();
378  Vtype = stream.getStreamType();
379  ProcessCaDescriptors = true;
380  break;
381  case 3: // STREAMTYPE_11172_AUDIO
382  case 4: // STREAMTYPE_13818_AUDIO
383  case 0x0F: // ISO/IEC 13818-7 Audio with ADTS transport syntax
384  case 0x11: // ISO/IEC 14496-3 Audio with LATM transport syntax
385  {
386  if (NumApids < MAXAPIDS) {
387  Apids[NumApids] = esPid;
388  Atypes[NumApids] = stream.getStreamType();
389  SI::Descriptor *d;
390  for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
391  switch (d->getDescriptorTag()) {
395  char *s = ALangs[NumApids];
396  int n = 0;
397  for (SI::Loop::Iterator it; ld->languageLoop.getNext(l, it); ) {
398  if (*ld->languageCode != '-') { // some use "---" to indicate "none"
399  if (n > 0)
400  *s++ = '+';
402  s += strlen(s);
403  if (n++ > 1)
404  break;
405  }
406  }
407  }
408  break;
409  default: ;
410  }
411  delete d;
412  }
413  NumApids++;
414  }
415  ProcessCaDescriptors = true;
416  }
417  break;
418  case 5: // STREAMTYPE_13818_PRIVATE
419  case 6: // STREAMTYPE_13818_PES_PRIVATE
420  //XXX case 8: // STREAMTYPE_13818_DSMCC
421  {
422  int dpid = 0;
423  int dtype = 0;
424  char lang[MAXLANGCODE1] = { 0 };
425  SI::Descriptor *d;
426  for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
427  switch (d->getDescriptorTag()) {
430  dpid = esPid;
431  dtype = d->getDescriptorTag();
432  ProcessCaDescriptors = true;
433  break;
435  if (NumSpids < MAXSPIDS) {
436  Spids[NumSpids] = esPid;
439  char *s = SLangs[NumSpids];
440  int n = 0;
441  for (SI::Loop::Iterator it; sd->subtitlingLoop.getNext(sub, it); ) {
442  if (sub.languageCode[0]) {
443  SubtitlingTypes[NumSpids] = sub.getSubtitlingType();
444  CompositionPageIds[NumSpids] = sub.getCompositionPageId();
445  AncillaryPageIds[NumSpids] = sub.getAncillaryPageId();
446  if (n > 0)
447  *s++ = '+';
449  s += strlen(s);
450  if (n++ > 1)
451  break;
452  }
453  }
454  NumSpids++;
455  }
456  break;
458  Tpid = esPid;
459  break;
463  }
464  break;
465  default: ;
466  }
467  delete d;
468  }
469  if (dpid) {
470  if (NumDpids < MAXDPIDS) {
471  Dpids[NumDpids] = dpid;
472  Dtypes[NumDpids] = dtype;
473  strn0cpy(DLangs[NumDpids], lang, MAXLANGCODE1);
474  NumDpids++;
475  }
476  }
477  }
478  break;
479  case 0x80: // STREAMTYPE_USER_PRIVATE
480  if (Setup.StandardCompliance == STANDARD_ANSISCTE) { // DigiCipher II VIDEO (ANSI/SCTE 57)
481  Vpid = esPid;
482  Ppid = pmt.getPCRPid();
483  Vtype = 0x02; // compression based upon MPEG-2
484  ProcessCaDescriptors = true;
485  break;
486  }
487  // fall through
488  case 0x81: // STREAMTYPE_USER_PRIVATE
489  if (Setup.StandardCompliance == STANDARD_ANSISCTE) { // ATSC A/53 AUDIO (ANSI/SCTE 57)
490  char lang[MAXLANGCODE1] = { 0 };
491  SI::Descriptor *d;
492  for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
493  switch (d->getDescriptorTag()) {
497  }
498  break;
499  default: ;
500  }
501  delete d;
502  }
503  if (NumDpids < MAXDPIDS) {
504  Dpids[NumDpids] = esPid;
505  Dtypes[NumDpids] = SI::AC3DescriptorTag;
506  strn0cpy(DLangs[NumDpids], lang, MAXLANGCODE1);
507  NumDpids++;
508  }
509  ProcessCaDescriptors = true;
510  break;
511  }
512  // fall through
513  case 0x82: // STREAMTYPE_USER_PRIVATE
514  if (Setup.StandardCompliance == STANDARD_ANSISCTE) { // STANDARD SUBTITLE (ANSI/SCTE 27)
515  //TODO
516  break;
517  }
518  // fall through
519  case 0x83 ... 0xFF: // STREAMTYPE_USER_PRIVATE
520  {
521  char lang[MAXLANGCODE1] = { 0 };
522  bool IsAc3 = false;
523  SI::Descriptor *d;
524  for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
525  switch (d->getDescriptorTag()) {
528  // http://www.smpte-ra.org/mpegreg/mpegreg.html
529  switch (rd->getFormatIdentifier()) {
530  case 0x41432D33: // 'AC-3'
531  IsAc3 = true;
532  break;
533  default:
534  //printf("Format identifier: 0x%08X (pid: %d)\n", rd->getFormatIdentifier(), esPid);
535  break;
536  }
537  }
538  break;
542  }
543  break;
544  default: ;
545  }
546  delete d;
547  }
548  if (IsAc3) {
549  if (NumDpids < MAXDPIDS) {
550  Dpids[NumDpids] = esPid;
551  Dtypes[NumDpids] = SI::AC3DescriptorTag;
552  strn0cpy(DLangs[NumDpids], lang, MAXLANGCODE1);
553  NumDpids++;
554  }
555  ProcessCaDescriptors = true;
556  }
557  }
558  break;
559  default: ;//printf("PID: %5d %5d %2d %3d %3d\n", pmt.getServiceId(), stream.getPid(), stream.getStreamType(), pmt.getVersionNumber(), Channel->Number());
560  }
561  if (ProcessCaDescriptors) {
563  CaDescriptors->AddCaDescriptor(d, esPid);
564  delete d;
565  }
566  }
567  }
568  if (Setup.UpdateChannels >= 2) {
569  Channel->SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
570  Channel->SetCaIds(CaDescriptors->CaIds());
571  Channel->SetSubtitlingDescriptors(SubtitlingTypes, CompositionPageIds, AncillaryPageIds);
572  }
573  Channel->SetCaDescriptors(CaDescriptorHandler.AddCaDescriptors(CaDescriptors));
574  }
575  Channels.Unlock();
576  }
577  if (timer.TimedOut()) {
578  if (pmtIndex >= 0)
579  DBGLOG("PMT timeout %d", pmtIndex);
582  }
583 }
#define DBGLOG(a...)
Definition: pat.c:235
unsigned char uchar
Definition: tools.h:30
#define STANDARD_ANSISCTE
Definition: config.h:71
int GetPmtPid(int Index)
Definition: pat.h:29
cChannels Channels
Definition: channels.c:792
#define dsyslog(a...)
Definition: tools.h:36
int StandardCompliance
Definition: config.h:277
void Set(int Ms=0)
Definition: tools.c:689
int esPid
Definition: pat.c:23
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
Definition: pat.c:291
void Add(cListObject *Object, cListObject *After=NULL)
Definition: tools.c:1945
void AddCaId(int CaId)
Definition: pat.c:116
cTimeMs timer
Definition: pat.h:22
cCaDescriptors(int Source, int Transponder, int ServiceId)
Definition: pat.c:84
StructureLoop< Association > associationLoop
Definition: section.h:39
uchar * data
Definition: pat.c:25
StructureLoop< Stream > streamLoop
Definition: section.h:71
void Add(u_short Pid, u_char Tid, u_char Mask=0xFF, bool Sticky=false)
Adds the given filter data to this filter.
Definition: filter.c:142
int getCaPid() const
Definition: descriptor.c:350
const cChannel * Channel(void)
Returns the channel of the data delivered to this filter.
Definition: filter.c:99
char * strn0cpy(char *dest, const char *src, size_t n)
Definition: tools.c:131
bool TimedOut(void)
Definition: tools.c:694
DescriptorLoop commonDescriptors
Definition: section.h:70
CharArray privateData
Definition: descriptor.h:147
cPatFilter(void)
Definition: pat.c:238
int pmtIndex
Definition: pat.h:24
DescriptorTag getDescriptorTag() const
Definition: si.c:100
int getServiceId() const
Definition: section.c:57
StructureLoop< Subtitling > subtitlingLoop
Definition: descriptor.h:331
int Count(void) const
Definition: tools.h:475
int GetCaDescriptors(const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
Definition: pat.c:155
void AddCaDescriptor(SI::CaDescriptor *d, int EsPid)
Definition: pat.c:128
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
Definition: channels.c:156
int pmtId[MAXPMTENTRIES]
Definition: pat.h:25
int getPid() const
Definition: section.c:65
int CaSystem(void)
Definition: pat.c:30
#define MALLOC(type, size)
Definition: tools.h:46
int getPid() const
Definition: section.c:34
#define PMT_SCAN_TIMEOUT
Definition: pat.c:16
void Unlock(void)
Definition: thread.c:170
int Length(void) const
Definition: pat.c:32
void Trigger(int Sid=-1)
Definition: pat.c:252
T * Next(const T *object) const
Definition: tools.h:485
int getCaType() const
Definition: descriptor.c:346
int Source(void) const
Definition: channels.h:149
#define MAXPMTENTRIES
Definition: pat.h:17
void Del(u_short Pid, u_char Tid, u_char Mask=0xFF)
Deletes the given filter data from this filter.
Definition: filter.c:150
int numCaIds
Definition: pat.c:69
int numPmtEntries
Definition: pat.h:27
int getTableIdExtension() const
Definition: si.c:72
int Source(void)
Returns the source of the data delivered to this filter.
Definition: filter.c:89
bool Is(int Source, int Transponder, int ServiceId)
Definition: pat.c:106
int getFormatIdentifier() const
Definition: descriptor.c:1137
int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
Gets all CA descriptors for a given channel.
Definition: pat.c:224
void SwitchToNextPmtPid(void)
Definition: pat.c:282
cMutex mutex
Definition: pat.h:21
void SetCaDescriptors(int Level)
Definition: channels.c:432
cSetup Setup
Definition: config.c:372
bool Lock(bool Write, int TimeoutMs=0)
Definition: thread.c:155
StructureLoop< Language > languageLoop
Definition: descriptor.h:489
int source
Definition: pat.c:66
int MakePmtId(int PmtPid, int Sid)
Definition: pat.h:30
Definition: thread.h:63
cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID)
Definition: channels.c:906
int AddCaDescriptors(cCaDescriptors *CaDescriptors)
Definition: pat.c:194
#define MAXLANGCODE1
Definition: channels.h:39
void SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds)
Definition: channels.c:395
int getStreamType() const
Definition: section.c:69
#define MAXLANGCODE2
Definition: channels.h:40
bool CheckCRCAndParse()
Definition: si.c:65
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
Definition: pat.c:244
bool isNITPid() const
Definition: section.h:31
int getServiceId() const
Definition: section.c:30
int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
Definition: pat.c:212
virtual ~cCaDescriptor()
Definition: pat.c:52
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
Definition: filter.c:104
int patVersion
Definition: pat.h:23
#define MAXDPIDS
Definition: channels.h:35
T * First(void) const
Definition: tools.h:482
void Del(cListObject *Object, bool DeleteObject=true)
Definition: tools.c:1977
int sid
Definition: pat.h:28
cList< cCaDescriptor > caDescriptors
Definition: pat.c:71
int getVersionNumber() const
Definition: si.c:84
int caSystem
Definition: pat.c:22
bool Empty(void)
Definition: pat.c:78
unsigned char u_char
Definition: headers.h:24
int getPCRPid() const
Definition: section.c:61
int UpdateChannels
Definition: config.h:306
int caIds[MAXCAIDS+1]
Definition: pat.c:70
bool operator==(const cCaDescriptors &arg) const
Definition: pat.c:93
int serviceId
Definition: pat.c:68
DescriptorLoop streamDescriptors
Definition: section.h:63
int EsPid(void)
Definition: pat.c:31
int transponder
Definition: pat.c:67
#define MAXSPIDS
Definition: channels.h:36
int getLength() const
Definition: util.h:58
const int * CaIds(void)
Definition: pat.c:81
int Transponder(void)
Returns the transponder of the data delivered to this filter.
Definition: filter.c:94
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
Definition: filter.c:137
const uchar * Data(void) const
Definition: pat.c:33
cCaDescriptor(int CaSystem, int CaPid, int EsPid, int Length, const uchar *Data)
Definition: pat.c:36
int pmtVersion[MAXPMTENTRIES]
Definition: pat.h:26
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion=false)
Definition: pat.c:264
#define MAXCAIDS
Definition: channels.h:37
void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, int *Atypes, char ALangs[][MAXLANGCODE2], int *Dpids, int *Dtypes, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid)
Definition: channels.c:330
int Sid(void) const
Definition: channels.h:173
bool operator==(const cCaDescriptor &arg) const
Definition: pat.c:57
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
Definition: i18n.c:238
const unsigned char * getData() const
Definition: util.h:51
void SetCaIds(const int *CaIds)
Definition: channels.c:411
Descriptor * getNext(Iterator &it)
Definition: si.c:112
cCaDescriptorHandler CaDescriptorHandler
Definition: pat.c:222
cMutex mutex
Definition: pat.c:185
int length
Definition: pat.c:24
#define MAXAPIDS
Definition: channels.h:34