16 #define PMT_SCAN_TIMEOUT 1000 // ms
46 data[4] = ((CaPid >> 8) & 0x1F) | 0xE0;
47 data[5] = CaPid & 0xFF;
49 memcpy(&
data[6], Data, Length);
76 bool Is(
int Source,
int Transponder,
int ServiceId);
119 for (
int i = 0; i <
numCaIds; i++) {
120 if (
caIds[i] == CaId)
123 caIds[numCaIds++] = CaId;
140 #ifdef DEBUG_CA_DESCRIPTORS
144 for (
int i = 0; i < nca->
Length(); i++)
145 q += sprintf(q,
" %02X", nca->
Data()[i]);
157 if (!CaSystemIds || !*CaSystemIds)
159 if (BufSize > 0 && Data) {
162 if (EsPid < 0 || d->EsPid() == EsPid) {
163 const int *caids = CaSystemIds;
165 if (d->CaSystem() == *caids) {
166 if (length + d->Length() <= BufSize) {
167 memcpy(Data + length, d->Data(), d->Length());
168 length += d->Length();
191 int GetCaDescriptors(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
uchar *Data,
int EsPid);
198 if (ca->Is(CaDescriptors)) {
199 if (*ca == *CaDescriptors) {
200 delete CaDescriptors;
209 return CaDescriptors->
Empty() ? 0 : 1;
216 if (ca->Is(Source, Transponder, ServiceId))
217 return ca->GetCaDescriptors(CaSystemIds, BufSize, Data, EsPid);
224 int GetCaDescriptors(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
uchar *Data,
int EsPid)
226 return CaDescriptorHandler.
GetCaDescriptors(Source, Transponder, ServiceId, CaSystemIds, BufSize, Data, EsPid);
233 #define DBGLOG(a...) { cString s = cString::sprintf(a); fprintf(stderr, "%s\n", *s); dsyslog("%s", *s); }
247 DBGLOG(
"PAT filter set status %d", On);
260 DBGLOG(
"PAT filter trigger SID %d", Sid);
268 if (
pmtId[i] == Id) {
360 uint16_t CompositionPageIds[
MAXSPIDS + 1] = { 0 };
361 uint16_t AncillaryPageIds[
MAXSPIDS + 1] = { 0 };
370 bool ProcessCaDescriptors =
false;
371 int esPid = stream.
getPid();
379 ProcessCaDescriptors =
true;
387 Apids[NumApids] = esPid;
395 char *s = ALangs[NumApids];
415 ProcessCaDescriptors =
true;
432 ProcessCaDescriptors =
true;
436 Spids[NumSpids] = esPid;
439 char *s = SLangs[NumSpids];
471 Dpids[NumDpids] = dpid;
472 Dtypes[NumDpids] = dtype;
484 ProcessCaDescriptors =
true;
504 Dpids[NumDpids] = esPid;
509 ProcessCaDescriptors =
true;
550 Dpids[NumDpids] = esPid;
555 ProcessCaDescriptors =
true;
561 if (ProcessCaDescriptors) {
569 Channel->
SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
#define STANDARD_ANSISCTE
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
void Add(cListObject *Object, cListObject *After=NULL)
cCaDescriptors(int Source, int Transponder, int ServiceId)
int getCompositionPageId() const
StructureLoop< Association > associationLoop
StructureLoop< Stream > streamLoop
void Add(u_short Pid, u_char Tid, u_char Mask=0xFF, bool Sticky=false)
Adds the given filter data to this filter.
const cChannel * Channel(void)
Returns the channel of the data delivered to this filter.
DescriptorLoop commonDescriptors
DescriptorTag getDescriptorTag() const
StructureLoop< Subtitling > subtitlingLoop
int GetCaDescriptors(const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
void AddCaDescriptor(SI::CaDescriptor *d, int EsPid)
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
T * Next(const T *object) const
void Del(u_short Pid, u_char Tid, u_char Mask=0xFF)
Deletes the given filter data from this filter.
int getTableIdExtension() const
int Source(void)
Returns the source of the data delivered to this filter.
bool Is(int Source, int Transponder, int ServiceId)
int getFormatIdentifier() const
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.
void SwitchToNextPmtPid(void)
void SetCaDescriptors(int Level)
bool Lock(bool Write, int TimeoutMs=0)
int getSubtitlingType() const
StructureLoop< Language > languageLoop
int MakePmtId(int PmtPid, int Sid)
cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID)
int AddCaDescriptors(cCaDescriptors *CaDescriptors)
void SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds)
int getStreamType() const
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
void Del(cListObject *Object, bool DeleteObject=true)
cList< cCaDescriptor > caDescriptors
int getVersionNumber() const
bool operator==(const cCaDescriptors &arg) const
DescriptorLoop streamDescriptors
int Transponder(void)
Returns the transponder of the data delivered to this filter.
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
const uchar * Data(void) const
cCaDescriptor(int CaSystem, int CaPid, int EsPid, int Length, const uchar *Data)
int pmtVersion[MAXPMTENTRIES]
int getAncillaryPageId() const
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion=false)
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)
bool operator==(const cCaDescriptor &arg) const
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
const unsigned char * getData() const
void SetCaIds(const int *CaIds)
Descriptor * getNext(Iterator &it)
cCaDescriptorHandler CaDescriptorHandler