17 #define PMT_SCAN_TIMEOUT 1000 // ms
50 data[4] = ((CaPid >> 8) & 0x1F) | 0xE0;
51 data[5] = CaPid & 0xFF;
53 memcpy(&
data[6], Data, Length);
79 cCaDescriptors(
int Source,
int Transponder,
int ServiceId,
int PmtPid);
81 bool Is(
int Source,
int Transponder,
int ServiceId);
86 int GetCaPids(
const int *CaSystemIds,
int BufSize,
int *Pids);
127 for (
int i = 0; i <
numCaIds; i++) {
128 if (
caIds[i] == CaId)
131 caIds[numCaIds++] = CaId;
148 #ifdef DEBUG_CA_DESCRIPTORS
152 for (
int i = 0; i < nca->
Length(); i++)
153 q += sprintf(q,
" %02X", nca->
Data()[i]);
165 if (!CaSystemIds || !*CaSystemIds)
167 if (BufSize > 0 && Data) {
170 if (EsPid < 0 || d->EsPid() == EsPid) {
171 const int *caids = CaSystemIds;
173 if (*caids == 0xFFFF || d->CaSystem() == *caids) {
174 if (length + d->Length() <= BufSize) {
175 memcpy(Data + length, d->Data(), d->Length());
176 length += d->Length();
191 if (!CaSystemIds || !*CaSystemIds)
193 if (BufSize > 0 && Pids) {
196 const int *caids = CaSystemIds;
198 if (*caids == 0xFFFF || d->CaSystem() == *caids) {
199 if (numPids + 1 < BufSize) {
200 Pids[numPids++] = d->CaPid();
223 int GetCaDescriptors(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
uchar *Data,
int EsPid);
224 int GetCaPids(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
int *Pids);
225 int GetPmtPid(
int Source,
int Transponder,
int ServiceId);
232 if (ca->Is(CaDescriptors)) {
233 if (*ca == *CaDescriptors) {
234 delete CaDescriptors;
243 return CaDescriptors->
Empty() ? 0 : 1;
250 if (ca->Is(Source, Transponder, ServiceId))
251 return ca->GetCaDescriptors(CaSystemIds, BufSize, Data, EsPid);
260 if (ca->Is(Source, Transponder, ServiceId))
261 return ca->GetCaPids(CaSystemIds, BufSize, Pids);
270 if (ca->Is(Source, Transponder, ServiceId))
271 return ca->GetPmtPid();
278 int GetCaDescriptors(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
uchar *Data,
int EsPid)
280 return CaDescriptorHandler.
GetCaDescriptors(Source, Transponder, ServiceId, CaSystemIds, BufSize, Data, EsPid);
283 int GetCaPids(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
int *Pids)
285 return CaDescriptorHandler.
GetCaPids(Source, Transponder, ServiceId, CaSystemIds, BufSize, Pids);
288 int GetPmtPid(
int Source,
int Transponder,
int ServiceId)
290 return CaDescriptorHandler.
GetPmtPid(Source, Transponder, ServiceId);
297 #define DBGLOG(a...) { cString s = cString::sprintf(a); fprintf(stderr, "%s\n", *s); dsyslog("%s", *s); }
311 DBGLOG(
"PAT filter set status %d", On);
324 DBGLOG(
"PAT filter trigger SID %d", Sid);
332 if (
pmtId[i] == Id) {
424 uint16_t CompositionPageIds[
MAXSPIDS + 1] = { 0 };
425 uint16_t AncillaryPageIds[
MAXSPIDS + 1] = { 0 };
436 bool ProcessCaDescriptors =
false;
437 int esPid = stream.
getPid();
445 ProcessCaDescriptors =
true;
453 Apids[NumApids] = esPid;
461 char *s = ALangs[NumApids];
481 ProcessCaDescriptors =
true;
498 ProcessCaDescriptors =
true;
502 Spids[NumSpids] = esPid;
505 char *s = SLangs[NumSpids];
550 Dpids[NumDpids] = dpid;
551 Dtypes[NumDpids] = dtype;
563 ProcessCaDescriptors =
true;
583 Dpids[NumDpids] = esPid;
588 ProcessCaDescriptors =
true;
629 Dpids[NumDpids] = esPid;
634 ProcessCaDescriptors =
true;
640 if (ProcessCaDescriptors) {
648 Channel->
SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
651 if (manualPageNumber)
#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< Teletext > teletextLoop
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)
int getTeletextPageNumber() const
cCaDescriptors(int Source, int Transponder, int ServiceId, int PmtPid)
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
virtual int ManualPageNumber(const cChannel *channel)
T * Next(const T *object) const
void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages)
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. ...
static cVDRTtxtsubsHookListener * Hook(void)
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 getTeletextType() const
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
int getTeletextMagazineNumber() 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