]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add default priority setting in grab modules.
authorAdam Sutton <dev@adamsutton.me.uk>
Tue, 10 Jul 2012 19:34:04 +0000 (20:34 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 30 Jul 2012 14:58:40 +0000 (15:58 +0100)
src/epggrab/module.c
src/epggrab/module/eit.c
src/epggrab/module/opentv.c
src/epggrab/module/pyepg.c
src/epggrab/module/xmltv.c
src/epggrab/private.h

index 7217426f284819afba72527de9b9b16320f0c6b1..a2b3bdcfcbb170e133df181d19418eb6fff260af 100644 (file)
@@ -73,7 +73,7 @@ htsmsg_t *epggrab_module_list ( void )
  * *************************************************************************/
 
 epggrab_module_t *epggrab_module_create
-  ( epggrab_module_t *skel, const char *id, const char *name,
+  ( epggrab_module_t *skel, const char *id, const char *name, int priority,
     epggrab_channel_tree_t *channels )
 {
   assert(skel);
@@ -81,6 +81,7 @@ epggrab_module_t *epggrab_module_create
   /* Setup */
   skel->id       = strdup(id);
   skel->name     = strdup(name);
+  skel->priority = priority;
   skel->channels = channels;
   if (channels) {
     skel->ch_save = epggrab_module_ch_save;
@@ -227,7 +228,8 @@ void epggrab_module_channels_load ( epggrab_module_t *mod )
 
 epggrab_module_int_t *epggrab_module_int_create
   ( epggrab_module_int_t *skel,
-    const char *id, const char *name, const char *path,
+    const char *id, const char *name, int priority,
+    const char *path,
     char* (*grab) (void*m),
     int (*parse) (void *m, htsmsg_t *data, epggrab_stats_t *sta),
     htsmsg_t* (*trans) (void *mod, char *data),
@@ -237,7 +239,7 @@ epggrab_module_int_t *epggrab_module_int_create
   if (!skel) skel = calloc(1, sizeof(epggrab_module_int_t));
   
   /* Pass through */
-  epggrab_module_create((epggrab_module_t*)skel, id, name, channels);
+  epggrab_module_create((epggrab_module_t*)skel, id, name, priority, channels);
 
   /* Int data */
   skel->type     = EPGGRAB_INT;
@@ -397,7 +399,7 @@ int epggrab_module_enable_socket ( void *m, uint8_t e )
  */
 epggrab_module_ext_t *epggrab_module_ext_create
   ( epggrab_module_ext_t *skel,
-    const char *id, const char *name, const char *sockid,
+    const char *id, const char *name, int priority, const char *sockid,
     int (*parse) (void *m, htsmsg_t *data, epggrab_stats_t *sta),
     htsmsg_t* (*trans) (void *mod, char *data),
     epggrab_channel_tree_t *channels )
@@ -411,7 +413,7 @@ epggrab_module_ext_t *epggrab_module_ext_create
   snprintf(path, 512, "%s/epggrab/%s.sock",
            hts_settings_get_root(), sockid);
   epggrab_module_int_create((epggrab_module_int_t*)skel,
-                            id, name, path,
+                            id, name, priority, path,
                             NULL, parse, trans,
                             channels);
 
@@ -428,7 +430,7 @@ epggrab_module_ext_t *epggrab_module_ext_create
 
 epggrab_module_ota_t *epggrab_module_ota_create
   ( epggrab_module_ota_t *skel,
-    const char *id, const char *name,
+    const char *id, const char *name, int priority,
     void (*start) (epggrab_module_ota_t*m,
                    struct th_dvb_mux_instance *tdmi),
     int (*enable) (void *m, uint8_t e ),
@@ -437,7 +439,7 @@ epggrab_module_ota_t *epggrab_module_ota_create
   if (!skel) skel = calloc(1, sizeof(epggrab_module_ota_t));
   
   /* Pass through */
-  epggrab_module_create((epggrab_module_t*)skel, id, name, channels);
+  epggrab_module_create((epggrab_module_t*)skel, id, name, priority, channels);
 
   /* Setup */
   skel->type   = EPGGRAB_OTA;
index a89a382ffc3d600a2798be793db4a83cdc4da66e..c2082de2abb929d7aa327bb4bbe0f5974cff7891 100644 (file)
@@ -430,7 +430,7 @@ static void _eit_start
 
 void eit_init ( void )
 {
-  epggrab_module_ota_create(NULL, "eit", "EIT: DVB Grabber",
+  epggrab_module_ota_create(NULL, "eit", "EIT: DVB Grabber", 1,
                             _eit_start, NULL, NULL);
 }
 
index 8e8c8f93b88d4b7a06768ae2ff0ea0ebc0685eba..18c77f7c7e5118b174e8fd896a95c1d6daf1e171 100644 (file)
@@ -874,7 +874,7 @@ static int _opentv_prov_load_one ( const char *id, htsmsg_t *m )
   sprintf(nbuf, "OpenTV: %s", name);
   mod = (opentv_module_t*)
     epggrab_module_ota_create(calloc(1, sizeof(opentv_module_t)),
-                              ibuf, nbuf,
+                              ibuf, nbuf, 2,
                               _opentv_start, _opentv_enable,
                               NULL);
   
index 621eb743571c15f7995cd42ac3299fc7b058a80e..3f0679a49719e044bace8bc7e0a459b81fca2c67 100644 (file)
@@ -416,12 +416,13 @@ static int _pyepg_parse
 void pyepg_init ( void )
 {
   /* Internal module */
-  epggrab_module_int_create(NULL, "/usr/bin/pyepg", "PyEPG", "/usr/bin/pyepg",
+  epggrab_module_int_create(NULL, "/usr/bin/pyepg", "PyEPG", 4,
+                            "/usr/bin/pyepg",
                             NULL, _pyepg_parse, NULL, NULL);
 
   /* External module */
   _pyepg_module = (epggrab_module_t*)
-    epggrab_module_ext_create(NULL, "pyepg", "PyEPG", "pyepg",
+    epggrab_module_ext_create(NULL, "pyepg", "PyEPG", 4, "pyepg",
                               _pyepg_parse, NULL,
                               &_pyepg_channels);
 }
index f2cba0642aa511bd04b8afe379e2b2525da5b280..c211d48af0d74f2e454eb7fb7ba74da087c63146 100644 (file)
@@ -525,7 +525,7 @@ static void _xmltv_load_grabbers ( void )
     if ( outbuf[i] == '\n' || outbuf[i] == '\0' ) {
       outbuf[i] = '\0';
       sprintf(name, "XMLTV: %s", &outbuf[n]);
-      epggrab_module_int_create(NULL, &outbuf[p], name, &outbuf[p],
+      epggrab_module_int_create(NULL, &outbuf[p], name, 3, &outbuf[p],
                                 NULL, _xmltv_parse, NULL, NULL);
       p = n = i + 1;
     } else if ( outbuf[i] == '|' ) {
@@ -541,7 +541,7 @@ void xmltv_init ( void )
 {
   /* External module */
   _xmltv_module = (epggrab_module_t*)
-    epggrab_module_ext_create(NULL, "xmltv", "XMLTV", "xmltv",
+    epggrab_module_ext_create(NULL, "xmltv", "XMLTV", 3, "xmltv",
                               _xmltv_parse, NULL,
                               &_xmltv_channels);
 
index 875422c28b5c4e4d4ab463030beb935eca8fb2bc..e1abe0dac8560d42b8e350b0b714593abe9c3136 100644 (file)
@@ -25,7 +25,8 @@
 
 epggrab_module_t *epggrab_module_create
   ( epggrab_module_t *skel,
-    const char *id, const char *name, epggrab_channel_tree_t *channels );
+    const char *id, const char *name, int priority,
+    epggrab_channel_tree_t *channels );
 
 char     *epggrab_module_grab_spawn ( void *m );
 htsmsg_t *epggrab_module_trans_xml  ( void *m, char *data );
@@ -57,7 +58,8 @@ epggrab_channel_t *epggrab_channel_find
 
 epggrab_module_int_t *epggrab_module_int_create
   ( epggrab_module_int_t *skel,
-    const char *id, const char *name, const char *path,
+    const char *id, const char *name, int priority,
+    const char *path,
     char* (*grab) (void*m),
     int (*parse) (void *m, htsmsg_t *data, epggrab_stats_t *sta),
     htsmsg_t* (*trans) (void *mod, char *data),
@@ -69,7 +71,8 @@ epggrab_module_int_t *epggrab_module_int_create
 
 epggrab_module_ext_t *epggrab_module_ext_create
   ( epggrab_module_ext_t *skel,
-    const char *id, const char *name, const char *sockid,
+    const char *id, const char *name, int priority,
+    const char *sockid,
     int (*parse) (void *m, htsmsg_t *data, epggrab_stats_t *sta),
     htsmsg_t* (*trans) (void *mod, char *data),
     epggrab_channel_tree_t *channels );
@@ -80,7 +83,7 @@ epggrab_module_ext_t *epggrab_module_ext_create
 
 epggrab_module_ota_t *epggrab_module_ota_create
   ( epggrab_module_ota_t *skel,
-    const char *id, const char *name,
+    const char *id, const char *name, int priority,
     void (*start) (epggrab_module_ota_t*m,
                    struct th_dvb_mux_instance *tdmi),
     int (*enable) (void *m, uint8_t e ),