]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
eit grabber: add PIDs for New Zealand, fixes #4198
authorJaroslav Kysela <perex@perex.cz>
Mon, 13 Mar 2017 08:52:06 +0000 (09:52 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 13 Mar 2017 08:58:33 +0000 (09:58 +0100)
src/epggrab.h
src/epggrab/module.c
src/epggrab/module/eit.c
src/epggrab/private.h

index 9d29a466aba4ef29b94d4f1de61de10f0c2056b8..e6fff9a0a226b97f4ca3ba664a8d5b7eb5c58c80 100644 (file)
@@ -257,6 +257,7 @@ struct epggrab_module_ota
   int  (*start) ( epggrab_ota_map_t *map, struct mpegts_mux *mm );
   int  (*tune)  ( epggrab_ota_map_t *map, epggrab_ota_mux_t *om,
                   struct mpegts_mux *mm );
+  void  *opaque;
 };
 
 /*
index a30d34a77e2c911f3d079c18adff1276ccd5d9fd..4ffb3a65bb5d6b0c2f7008672d2f39d80a8e4571 100644 (file)
@@ -607,6 +607,7 @@ epggrab_module_ota_t *epggrab_module_ota_create
   skel->start    = ops->start;
   skel->done     = ops->done;
   skel->tune     = ops->tune;
+  skel->opaque   = ops->opaque;
 
   return skel;
 }
index 815eb3f1e14def8da5a32fceaaaa2919f9f881ac..5c081f4b8c1fc4859432465e74cda0b2fb4ee16a 100644 (file)
@@ -757,27 +757,22 @@ static int _eit_start
   if (!m->enabled && !map->om_forced) return -1;
 
   /* Freeview (switch to EIT, ignore if explicitly enabled) */
-  // Note: do this as PID is the same
+  /* Note: do this as PID is the same */
   if (!strcmp(m->id, "uk_freeview")) {
     m = (epggrab_module_ota_t*)epggrab_module_find_by_id("eit");
     if (m->enabled) return -1;
   }
 
+  pid = (intptr_t)m->opaque;
+
   /* Freesat (3002/3003) */
   if (!strcmp("uk_freesat", m->id)) {
     mpegts_table_add(dm, 0, 0, dvb_bat_callback, NULL, "bat", LS_TBL_BASE, MT_CRC, 3002, MPS_WEIGHT_EIT);
     pid = 3003;
-
-  /* Viasat Baltic (0x39) */
-  } else if (!strcmp("viasat_baltic", m->id)) {
-    pid = 0x39;
-
-  /* Bulsatcom 39E (0x12b) */
-  } else if (!strcmp("Bulsatcom_39E", m->id)) {
-    pid = 0x12b;
+  }
 
   /* Standard (0x12) */
-  } else {
+  if (pid == 0) {
     pid  = DVB_EIT_PID;
     opts = MT_RECORD;
   }
@@ -822,18 +817,49 @@ static int _eit_tune
   return r;
 }
 
+#define EIT_OPS(name, pid) \
+  static epggrab_ota_module_ops_t name = { \
+    .start  = _eit_start, \
+    .tune   = _eit_tune, \
+    .opaque = (void *)pid, \
+  }
+
+#define EIT_CREATE(id, name, prio, ops) \
+  epggrab_module_ota_create(NULL, id, LS_TBL_EIT, NULL, name, prio, ops)
+
 void eit_init ( void )
 {
-  static epggrab_ota_module_ops_t ops = {
-    .start = _eit_start,
-    .tune  = _eit_tune,
-  };
-
-  epggrab_module_ota_create(NULL, "eit", LS_TBL_EIT, NULL, "EIT: DVB Grabber", 1, &ops);
-  epggrab_module_ota_create(NULL, "uk_freesat", LS_TBL_EIT, NULL, "UK: Freesat", 5, &ops);
-  epggrab_module_ota_create(NULL, "uk_freeview", LS_TBL_EIT, NULL, "UK: Freeview", 5, &ops);
-  epggrab_module_ota_create(NULL, "viasat_baltic", LS_TBL_EIT, NULL, "VIASAT: Baltic", 5, &ops);
-  epggrab_module_ota_create(NULL, "Bulsatcom_39E", LS_TBL_EIT, NULL, "Bulsatcom: Bula 39E", 5, &ops);
+  EIT_OPS(ops, 0);
+  EIT_OPS(ops_baltic, 0x39);
+  EIT_OPS(ops_bulsat, 0x12b);
+  EIT_OPS(ops_nz_auckland, 0x19);
+  EIT_OPS(ops_nz_central, 0x1a);
+  EIT_OPS(ops_nz_wellington, 0x1b);
+  EIT_OPS(ops_nz_south_island, 0x1c);
+  EIT_OPS(ops_nz_tvworks, 0x1d);
+  EIT_OPS(ops_nz_tvworks_central, 0x1e);
+  EIT_OPS(ops_nz_tvworks_wellington, 0x1f);
+  EIT_OPS(ops_nz_tvworks_south_island, 0x20);
+  EIT_OPS(ops_nz_kordia1, 0x21);
+  EIT_OPS(ops_nz_kordia2, 0x22);
+  EIT_OPS(ops_nz_hawke, 0x26);
+
+  EIT_CREATE("eit", "EIT: DVB Grabber", 1, &ops);
+  EIT_CREATE("uk_freesat", "UK: Freesat", 5, &ops);
+  EIT_CREATE("uk_freeview", "UK: Freeview", 5, &ops);
+  EIT_CREATE("viasat_baltic", "VIASAT: Baltic", 5, &ops_baltic);
+  EIT_CREATE("Bulsatcom_39E", "Bulsatcom: Bula 39E", 5, &ops_bulsat);
+  EIT_CREATE("nz_auckland", "New Zealand: Auckland", 5, &ops_nz_auckland);
+  EIT_CREATE("nz_central", "New Zealand: Central", 6, &ops_nz_central);
+  EIT_CREATE("nz_wellington", "New Zealand: Wellington", 6, &ops_nz_wellington);
+  EIT_CREATE("nz_south_island", "New Zealand: South Island", 6, &ops_nz_south_island);
+  EIT_CREATE("nz_tvworks", "New Zealand: TVWorks", 5, &ops_nz_tvworks);
+  EIT_CREATE("nz_tvworks_central", "New Zealand: TVWorks Central", 6, &ops_nz_tvworks_central);
+  EIT_CREATE("nz_tvworks_wellington", "New Zealand: TVWorks Wellington", 6, &ops_nz_tvworks_wellington);
+  EIT_CREATE("nz_tvworks_south_island", "New Zealand: TVWorks South Island", 6, &ops_nz_tvworks_south_island);
+  EIT_CREATE("nz_kordia1", "New Zealand: Kordia1", 5, &ops_nz_kordia1);
+  EIT_CREATE("nz_kordia2", "New Zealand: Kordia2", 5, &ops_nz_kordia2);
+  EIT_CREATE("nz_hawke", "New Zealand: Hawke's Bay TV", 5, &ops_nz_hawke);
 }
 
 void eit_done ( void )
index b56f7bb91b2b1937afc66da6efd884e5d883409e..2e9effcb3181327480bc7ded9d8f88a7ea443809 100644 (file)
@@ -104,6 +104,7 @@ typedef struct epggrab_ota_module_ops {
     void (*done)     (void *m);
     int  (*tune)     (epggrab_ota_map_t *map, epggrab_ota_mux_t *om,
                       struct mpegts_mux *mm);
+    void  *opaque;
 } epggrab_ota_module_ops_t;
 
 epggrab_module_ota_t *epggrab_module_ota_create