; ignore:{S61.5W-S148W:}1801:0D04:0600
; ignore:{*}0622:1833
+;
+; Define priority chains for ECM processing
+;
+; The first listed CAID will have the highest priority, then stepping down. If a
+; CAID is not listed, the priority will be lower than the last one.
+;
+; NOTE: priorities based on provider ID are supported for CAID 0100 & 0500 only,
+; and are rejected for others.
+;
+; format:
+; ecmprio:{src[-src]:[freq[-freq]]}caid[/provid][:caid[/provid]][...]
+;
+; examples
+; ecmprio:{S19.2E}0100/6a:0622
+; ecmprio:{S28.5E:12973}1833:1702:1801
+
;
; Add entries to the CAT (conditional access table) in case a EMM stream is
; not announced there.
#define OV_EMMTABLE 4
#define OV_TUNNEL 5
#define OV_IGNORE 6
+#define OV_ECMPRIO 7
// -- cOverrideCat -------------------------------------------------------------
return false;
}
+// -- cOverrideEcmPrio ---------------------------------------------------------
+
+#define OV_MAXPRIOS 16
+
+class cOverrideEcmPrio : public cOverride {
+private:
+ int num, caid[OV_MAXPRIOS], prov[OV_MAXPRIOS];
+ //
+ bool UsesProvId(int caid);
+public:
+ cOverrideEcmPrio(void) { type=OV_ECMPRIO; }
+ virtual bool Parse(char *str);
+ int GetPrio(int Caid, int Prov);
+ };
+
+bool cOverrideEcmPrio::Parse(char *str)
+{
+ if((str=Parse2(str))) {
+ num=0;
+ int n=-1;
+ do {
+ prov[num]=-1;
+ int l=n+1;
+ if(sscanf(&str[l],"%x%n/%x%n",&caid[num],&n,&prov[num],&n)<1) {
+ PRINTF(L_CORE_LOAD,"override: ECMPRIO format error");
+ return false;
+ }
+ if(prov[num]>=0 && !UsesProvId(caid[num])) {
+ PRINTF(L_CORE_LOAD,"override: ECMPRIO provider ID not supported for caid %04x",caid[num]);
+ return false;
+ }
+ n+=l; num++;
+ } while(num<OV_MAXPRIOS && str[n]==':');
+ LBSTART(L_CORE_OVER);
+ LBPUT("ecmprio: %s - chain",*Print());
+ for(int i=0; i<num; i++) LBPUT(prov[i]>=0 ? " %04x/%x":" %04x",caid[i],prov[i]);
+ LBEND();
+ return true;
+ }
+ return false;
+}
+
+bool cOverrideEcmPrio::UsesProvId(int caid)
+{
+ switch(caid>>8) {
+ case 0x01:
+ case 0x05: return true;
+ }
+ return false;
+}
+
+int cOverrideEcmPrio::GetPrio(int Caid, int Prov)
+{
+ int pri=0;
+ for(int i=0; i<num; i++) {
+ if(Caid==caid[i] && (prov[i]<0 || Prov==prov[i])) break;
+ pri--;
+ }
+ PRINTF(L_CORE_OVER,"ecmprio: %04x/%x pri %d",Caid,Prov,pri);
+ return pri;
+}
+
// -- cOverrides ---------------------------------------------------------------
cOverrides overrides;
else if(!strncasecmp(line,"emmtable",8)) ov=new cOverrideEmmTable;
else if(!strncasecmp(line,"tunnel",6)) ov=new cOverrideTunnel;
else if(!strncasecmp(line,"ignore",6)) ov=new cOverrideIgnore;
+ else if(!strncasecmp(line,"ecmprio",7)) ov=new cOverrideEcmPrio;
if(ov && !ov->Parse(p)) { delete ov; ov=0; }
}
return ov;
ListUnlock();
return res;
}
+
+int cOverrides::GetEcmPrio(int source, int transponder, int caid, int prov)
+{
+ int pri=0;
+ ListLock(false);
+ cOverrideEcmPrio *ovp=dynamic_cast<cOverrideEcmPrio *>(Find(OV_ECMPRIO,-1,source,transponder));
+ if(ovp) pri=ovp->GetPrio(caid,prov);
+ ListUnlock();
+ return pri;
+}
void UpdateEcm(cEcmInfo *ecm, bool log);
bool AddEmmPids(int caid, int source, int transponder, cPids *pids, int pid);
bool Ignore(int source, int transponder, int caid);
+ int GetEcmPrio(int source, int transponder, int caid, int prov);
};
extern cOverrides overrides;