]> www.vanbest.org Git - sasc-ng.git/commitdiff
sasc: parse nit cable descriptor
authorleslie <unknown>
Wed, 17 Feb 2010 20:34:51 +0000 (21:34 +0100)
committerleslie <unknown>
Wed, 17 Feb 2010 20:34:51 +0000 (21:34 +0100)
contrib/sasc-ng/dvblb_plugins/plugin_cam.c
contrib/sasc-ng/dvbloopback/src/plugin_getsid.c
contrib/sasc-ng/dvbloopback/src/plugin_getsid.h
contrib/sasc-ng/sc/misc.cpp

index ad2d75764a5a15325f4a9a6576e0d1f04c57d77b..db590fd878b70dd2032f917ecce5babcccbfdaf6 100644 (file)
@@ -308,10 +308,14 @@ void process_cam(struct msg *msg, unsigned int priority)
   ch = new cChannel();
 
   ch->SetId(0, 1, sidmsg->sid, 0);
-  //set source type to Satellite.  Use orbit and E/W data
-  int source = 0x8000 | (BCD2INT(sidmsg->nit.orbit) & 0x7ff) | ((int)sidmsg->nit.is_east << 11);
-  static char Polarizations[] = { 'h', 'v', 'l', 'r' };
-  ch->SetSatTransponderData(source, BCD2INT(sidmsg->nit.frequency)/100, Polarizations[sidmsg->nit.polarization], BCD2INT(sidmsg->nit.symbolrate), 0);
+  if(sidmsg->nit.type==0x43) { //set source type to Satellite.  Use orbit and E/W data
+    int source = 0x8000 | (BCD2INT(sidmsg->nit.orbit) & 0x7ff) | ((int)sidmsg->nit.is_east << 11);
+    static char Polarizations[] = { 'h', 'v', 'l', 'r' };
+    ch->SetSatTransponderData(source, BCD2INT(sidmsg->nit.frequency)/100, Polarizations[sidmsg->nit.polarization], BCD2INT(sidmsg->nit.symbolrate)/10, 0);
+    }
+  else if(sidmsg->nit.type==0x44) { //set source type to Cable
+    ch->SetCableTransponderData(0x4000, BCD2INT(sidmsg->nit.frequency)/10, 0, BCD2INT(sidmsg->nit.symbolrate)/10, 0);
+    }
   dcnt = (MAXDPIDS >= sidmsg->epid_count) ?
             sidmsg->epid_count : MAXDPIDS;
   memcpy(dpid, sidmsg->epid, sizeof(int)*dcnt);
index 93e7176303267cd7f8dc8a8f0a3f8e670e890739..1228959fa56b8c006423cda178befde0f7a68176 100644 (file)
@@ -289,6 +289,7 @@ static int read_nit(unsigned char *buf, struct nit_data *nit, unsigned int size)
       tag = buf[pos+6];
       tag_len = buf[pos+7];
       if(tag == 0x43 && tag_len >= 11) { //satellite descriptor
+        nit->type = tag;
         nit->frequency = (buf[pos+8] << 24) | (buf[pos+9]<<16) | (buf[pos+10]<<8) | buf[pos+11];
         nit->orbit = (buf[pos+12] << 8) | buf[pos+13];
         nit->is_east = buf[pos+14] >> 7;
@@ -298,6 +299,14 @@ static int read_nit(unsigned char *buf, struct nit_data *nit, unsigned int size)
         nit->fec = buf[pos+18];
         printf("Orbit: %08x%c\n", nit->orbit, nit->is_east ? 'E' : 'W');
         return 1;
+      } else if(tag == 0x44 && tag_len >= 11) { //cable descriptor
+        nit->type = tag;
+        nit->frequency = (buf[pos+8] << 24) | (buf[pos+9]<<16) | (buf[pos+10]<<8) | buf[pos+11];
+        nit->modulation = buf[pos+14];
+        nit->symbolrate = (buf[pos+15]<<16) | (buf[pos+16]<<8) | buf[pos+17];
+        nit->fec = buf[pos+18];
+        printf("Cable: %08x\n", nit->frequency);
+        return 1;
       }
       pos += tag_len+2;
       td_len -= tag_len+2;
index 1b1d6d8322e436f6c6c42f609e2a9022083897f8..34fde4672ecf6714583f0fc5f6be2662e4f77e6a 100644 (file)
@@ -14,6 +14,7 @@ struct nit_data {
   unsigned char modulation;
   unsigned int symbolrate;
   unsigned char fec;
+  unsigned char type;
 };
 
 struct sid_msg {
index d82412f4054ec03e3847e15fa91ad9ea6bcb3bda..e3137d669342bb9d7ea5e9ba0a5e45b8b2d9d34e 100644 (file)
@@ -39,6 +39,15 @@ bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarizatio
      coderateH = CoderateH;
      return true;
 }
+bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH)
+{
+     source = Source;
+     frequency = Frequency;
+     modulation = Modulation;
+     srate = Srate;
+     coderateH = CoderateH;
+     return true;
+}
 void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int Tpid)
 {
   vpid = Vpid;