16 #define PMT_SCAN_TIMEOUT 1000 // ms 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)
147 #ifdef DEBUG_CA_DESCRIPTORS 151 for (
int i = 0; i < nca->
Length(); i++)
152 q += sprintf(q,
" %02X", nca->
Data()[i]);
165 if (!CaSystemIds || !*CaSystemIds)
168 if (EsPid < 0 || d->EsPid() == EsPid) {
169 const int *caids = CaSystemIds;
171 if (*caids == 0xFFFF || d->CaSystem() == *caids)
172 Buffer.
Append(d->Data(), d->Length());
180 if (!CaSystemIds || !*CaSystemIds)
182 if (BufSize > 0 && Pids) {
185 const int *caids = CaSystemIds;
187 if (*caids == 0xFFFF || d->CaSystem() == *caids) {
188 if (numPids + 1 < BufSize) {
189 Pids[numPids++] = d->CaPid();
213 int GetCaPids(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
int *Pids);
214 int GetPmtPid(
int Source,
int Transponder,
int ServiceId);
221 if (ca->Is(CaDescriptors)) {
222 if (*ca == *CaDescriptors) {
223 delete CaDescriptors;
232 return CaDescriptors->
Empty() ? 0 : 1;
239 if (ca->Is(Source, Transponder, ServiceId)) {
240 ca->GetCaDescriptors(CaSystemIds, Buffer, EsPid);
250 if (ca->Is(Source, Transponder, ServiceId))
251 return ca->GetCaPids(CaSystemIds, BufSize, Pids);
260 if (ca->Is(Source, Transponder, ServiceId))
261 return ca->GetPmtPid();
273 int GetCaPids(
int Source,
int Transponder,
int ServiceId,
const int *CaSystemIds,
int BufSize,
int *Pids)
278 int GetPmtPid(
int Source,
int Transponder,
int ServiceId)
287 #define DBGLOG(a...) { cString s = cString::sprintf(a); fprintf(stderr, "%s\n", *s); dsyslog("%s", *s); } 301 DBGLOG(
"PAT filter set status %d", On);
314 DBGLOG(
"PAT filter trigger SID %d", Sid);
322 if (
pmtId[i] == Id) {
394 bool ChannelsModified =
false;
417 uint16_t CompositionPageIds[
MAXSPIDS + 1] = { 0 };
418 uint16_t AncillaryPageIds[
MAXSPIDS + 1] = { 0 };
427 bool ProcessCaDescriptors =
false;
428 int esPid = stream.
getPid();
437 ProcessCaDescriptors =
true;
445 Apids[NumApids] = esPid;
453 char *s = ALangs[NumApids];
473 ProcessCaDescriptors =
true;
490 ProcessCaDescriptors =
true;
494 Spids[NumSpids] = esPid;
497 char *s = SLangs[NumSpids];
529 Dpids[NumDpids] = dpid;
530 Dtypes[NumDpids] = dtype;
542 ProcessCaDescriptors =
true;
562 Dpids[NumDpids] = esPid;
567 ProcessCaDescriptors =
true;
608 Dpids[NumDpids] = esPid;
613 ProcessCaDescriptors =
true;
619 if (ProcessCaDescriptors) {
627 ChannelsModified |=
Channel->
SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
633 StateKey.
Remove(ChannelsModified);
#define STANDARD_ANSISCTE
void GetCaDescriptors(const int *CaSystemIds, cDynamicBuffer &Buffer, int EsPid)
bool 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)
int getVersionNumber() const
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)
StructureLoop< Association > associationLoop
void Remove(bool IncState=true)
Removes this key from the lock it was previously used with.
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
int getStreamType() const
StructureLoop< Subtitling > subtitlingLoop
void AddCaDescriptor(SI::CaDescriptor *d, int EsPid)
int getAncillaryPageId() const
int GetPmtPid(int Source, int Transponder, int ServiceId)
int getSubtitlingType() 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)
void GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, cDynamicBuffer &Buffer, int EsPid)
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
void GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, cDynamicBuffer &Buffer, int EsPid)
Gets all CA descriptors for a given channel.
void Del(u_short Pid, u_char Tid, u_char Mask=0xFF)
Deletes the given filter data from this filter.
int Source(void)
Returns the source of the data delivered to this filter.
bool Is(int Source, int Transponder, int ServiceId)
void SwitchToNextPmtPid(void)
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 operator==(const cCaDescriptors &arg) const
StructureLoop< Language > languageLoop
int GetCaPids(const int *CaSystemIds, int BufSize, int *Pids)
int MakePmtId(int PmtPid, int Sid)
int AddCaDescriptors(cCaDescriptors *CaDescriptors)
const int GetPmtPid(void)
bool SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds)
const T * First(void) const
Returns the first element in this list, or NULL if the list is empty.
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
int getTableIdExtension() const
void Del(cListObject *Object, bool DeleteObject=true)
const unsigned char * getData() const
cList< cCaDescriptor > caDescriptors
DescriptorLoop streamDescriptors
void Append(const uchar *Data, int Length)
DescriptorTag getDescriptorTag() const
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 cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID) const
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
Gets all CA pids for a given channel.
cCaDescriptor(int CaSystem, int CaPid, int EsPid, int Length, const uchar *Data)
const uchar * Data(void) const
int pmtVersion[MAXPMTENTRIES]
int getFormatIdentifier() const
bool SetCaIds(const int *CaIds)
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion=false)
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
Descriptor * getNext(Iterator &it)
cCaDescriptorHandler CaDescriptorHandler
int getCompositionPageId() const
bool operator==(const cCaDescriptor &arg) const
bool SetCaDescriptors(int Level)
bool TimedOut(void) const
const T * Next(const T *Object) const
< Returns the element immediately before Object in this list, or NULL if Object is the first element ...