Go to the documentation of this file.
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) {
395 bool ChannelsModified =
false;
418 uint16_t CompositionPageIds[
MAXSPIDS + 1] = { 0 };
419 uint16_t AncillaryPageIds[
MAXSPIDS + 1] = { 0 };
428 bool ProcessCaDescriptors =
false;
429 int esPid = stream.
getPid();
438 ProcessCaDescriptors =
true;
446 Apids[NumApids] = esPid;
454 char *s = ALangs[NumApids];
474 ProcessCaDescriptors =
true;
491 ProcessCaDescriptors =
true;
495 Spids[NumSpids] = esPid;
498 char *s = SLangs[NumSpids];
530 Dpids[NumDpids] = dpid;
531 Dtypes[NumDpids] = dtype;
543 ProcessCaDescriptors =
true;
564 Dpids[NumDpids] = esPid;
569 ProcessCaDescriptors =
true;
611 Dpids[NumDpids] = esPid;
616 ProcessCaDescriptors =
true;
622 if (ProcessCaDescriptors) {
630 ChannelsModified |=
Channel->
SetPids(Vpid, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid);
636 StateKey.
Remove(ChannelsModified);
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
Gets all CA pids for a given channel.
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
const int GetPmtPid(void)
@ RegistrationDescriptorTag
int Transponder(void)
Returns the transponder of the data delivered to this filter.
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
bool SetCaIds(const int *CaIds)
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
int getCompositionPageId() const
cCaDescriptors(int Source, int Transponder, int ServiceId, int PmtPid)
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)
const uchar * Data(void) const
int getStreamType() const
int getAncillaryPageId() const
int getFormatIdentifier() const
void Add(cListObject *Object, cListObject *After=NULL)
void Del(u_short Pid, u_char Tid, u_char Mask=0xFF)
Deletes the given filter data from this filter.
int AddCaDescriptors(cCaDescriptors *CaDescriptors)
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
StructureLoop< Stream > streamLoop
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion=false)
@ EnhancedAC3DescriptorTag
int getTableIdExtension() const
void Del(cListObject *Object, bool DeleteObject=true)
cList< cCaDescriptor > caDescriptors
int getSubtitlingType() const
StructureLoop< Subtitling > subtitlingLoop
const unsigned char * getData() const
void GetCaDescriptors(const int *CaSystemIds, cDynamicBuffer &Buffer, int EsPid)
DescriptorTag getDescriptorTag() const
bool Is(int Source, int Transponder, int ServiceId)
@ ISO639LanguageDescriptorTag
void GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, cDynamicBuffer &Buffer, int EsPid)
Gets all CA descriptors for a given channel.
DescriptorLoop streamDescriptors
void Remove(bool IncState=true)
Removes this key from the lock it was previously used with.
const cChannel * Channel(void)
Returns the channel of the data delivered to this filter.
void GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, cDynamicBuffer &Buffer, int EsPid)
void SwitchToNextPmtPid(void)
int GetPmtPid(int Source, int Transponder, int ServiceId)
void AddCaDescriptor(SI::CaDescriptor *d, int EsPid)
const T * First(void) const
Returns the first element in this list, or NULL if the list is empty.
int pmtVersion[MAXPMTENTRIES]
void Add(u_short Pid, u_char Tid, u_char Mask=0xFF, bool Sticky=false)
Adds the given filter data to this filter.
int MakePmtId(int PmtPid, int Sid)
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
@ SubtitlingDescriptorTag
#define STANDARD_ANSISCTE
StructureLoop< Association > associationLoop
int GetPmtPid(int Source, int Transponder, int ServiceId)
Gets the Pid of the PMT in which the CA descriptors for this channel are defined.
cCaDescriptorHandler CaDescriptorHandler
StructureLoop< Language > languageLoop
bool TimedOut(void) const
Descriptor * getNext(Iterator &it)
bool SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds)
bool SetCaDescriptors(int Level)
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
const T * Next(const T *Object) const
< Returns the element immediately before Object in this list, or NULL if Object is the first element ...
bool operator==(const cCaDescriptors &arg) const
int Source(void)
Returns the source of the data delivered to this filter.
bool operator==(const cCaDescriptor &arg) const
DescriptorLoop commonDescriptors
void Append(const uchar *Data, int Length)
int getVersionNumber() const
cCaDescriptor(int CaSystem, int CaPid, int EsPid, int Length, const uchar *Data)
const cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID) const
int GetCaPids(const int *CaSystemIds, int BufSize, int *Pids)