Add default priority setting in grab modules.
This commit is contained in:
parent
a91770cebb
commit
ebefa2fd6e
6 changed files with 23 additions and 17 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 ),
|
||||
|
|
Loading…
Add table
Reference in a new issue