16 #define PMT_SCAN_TIMEOUT 1000 // ms
49 data[4] = ((CaPid >> 8) & 0x1F) | 0xE0;
50 data[5] = CaPid & 0xFF;
52 memcpy(&
data[6], Data, Length);
78 cCaDescriptors(
int Source,
int Transponder,
int ServiceId,
int PmtPid);
80 bool Is(
int Source,
int Transponder,
int ServiceId);
85 int GetCaPids(
const int *CaSystemIds,
int BufSize,
int *Pids);
126 for (
int i = 0; i <
numCaIds; i++) {
127 if (
caIds[i] == CaId)
130 caIds[numCaIds++] = CaId;
147 #ifdef DEBUG_CA_DESCRIPTORS
151 for (
int i = 0; i < nca->
Length(); i++)
152 q += sprintf(q,
" %02X", nca->
Data()[i]);
164 if (!CaSystemIds || !*CaSystemIds)
166 if (BufSize > 0 && Data) {
169 if (EsPid < 0 || d->EsPid() == EsPid) {
170 const int *caids = CaSystemIds;
172 if (*caids == 0xFFFF || d->CaSystem() == *caids) {
173 if (length + d->Length() <= BufSize) {
174 memcpy(Data + length, d->Data(), d->Length());
175 length += d->Length();
190 if (!CaSystemIds || !*CaSystemIds)
192 if (BufSize > 0 && Pids) {
195 const int *caids = CaSystemIds;
197 if (*caids == 0xFFFF || d->CaSystem() == *caids) {
198 if (numPids + 1 < BufSize) {
199 Pids[numPids++] = d->CaPid();
222 int GetCaDescriptors(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
uchar *Data,
int EsPid);
223 int GetCaPids(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
int *Pids);
224 int GetPmtPid(
int Source,
int Transponder,
int ServiceId);
231 if (ca->Is(CaDescriptors)) {
232 if (*ca == *CaDescriptors) {
233 delete CaDescriptors;
242 return CaDescriptors->
Empty() ? 0 : 1;
249 if (ca->Is(Source, Transponder, ServiceId))
250 return ca->GetCaDescriptors(CaSystemIds, BufSize, Data, EsPid);
259 if (ca->Is(Source, Transponder, ServiceId))
260 return ca->GetCaPids(CaSystemIds, BufSize, Pids);
269 if (ca->Is(Source, Transponder, ServiceId))
270 return ca->GetPmtPid();
277 int GetCaDescriptors(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
uchar *Data,
int EsPid)
279 return CaDescriptorHandler.
GetCaDescriptors(Source, Transponder, ServiceId, CaSystemIds, BufSize, Data, EsPid);
282 int GetCaPids(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
int *Pids)
284 return CaDescriptorHandler.
GetCaPids(Source, Transponder, ServiceId, CaSystemIds, BufSize, Pids);
287 int GetPmtPid(
int Source,
int Transponder,
int ServiceId)
289 return CaDescriptorHandler.
GetPmtPid(Source, Transponder, ServiceId);
296 #define DBGLOG(a...) { cString s = cString::sprintf(a); fprintf(stderr, "%s\n", *s); dsyslog("%s", *s); }
310 DBGLOG(
"PAT filter set status %d", On);
323 DBGLOG(
"PAT filter trigger SID %d", Sid);
331 if (
pmtId[i] == Id) {
423 uint16_t CompositionPageIds[
MAXSPIDS + 1] = { 0 };
424 uint16_t AncillaryPageIds[
MAXSPIDS + 1] = { 0 };
433 bool ProcessCaDescriptors =
false;
434 int esPid = stream.
getPid();
442 ProcessCaDescriptors =
true;
450 Apids[NumApids] = esPid;
458 char *s = ALangs[NumApids];
478 ProcessCaDescriptors =
true;
495 ProcessCaDescriptors =
true;
499 Spids[NumSpids] = esPid;
502 char *s = SLangs[NumSpids];
534 Dpids[NumDpids] = dpid;
535 Dtypes[NumDpids] = dtype;
547 ProcessCaDescriptors =
true;
567 Dpids[NumDpids] = esPid;
572 ProcessCaDescriptors =
true;
613 Dpids[NumDpids] = esPid;
618 ProcessCaDescriptors =
true;
624 if (ProcessCaDescriptors) {
632 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)
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.
int GetPmtPid(int Source, int Transponder, int ServiceId)
cCaDescriptors(int Source, int Transponder, int ServiceId, int PmtPid)
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
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 TimedOut(void) const
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)
int GetPmtPid(int Source, int Transponder, int ServiceId)
Gets the Pid of the PMT in which the CA descriptors for this channel are defined. ...
bool Lock(bool Write, int TimeoutMs=0)
int getSubtitlingType() const
StructureLoop< Language > languageLoop
int GetCaPids(const int *CaSystemIds, int BufSize, int *Pids)
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)
const int GetPmtPid(void)
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.
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
Gets all CA pids for a given channel.
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