epggrab: ota - improve and fix the logic and defines for the EPG control, add documentation

This commit is contained in:
Jaroslav Kysela 2014-09-10 15:05:05 +02:00
parent a76ee1921b
commit 3716d28ff1
4 changed files with 70 additions and 38 deletions

View file

@ -17,7 +17,40 @@
<dd>Whether or not the mux is enabled and thus available.
<dt>EPG
<dd>Whether or not to retrieve EPG information from the mux.
<dd>EPG scan setup
<dl>
<dt>Disable
<dd>Disable the EPG scan
<dt>Enable (auto)
<dd>Enable the EPG scan (when some services from this mux are assigned to channels)
<dt>Force (auto)
<dd>Force the EPG scan (everytime when the EPG scan is triggered)
<dt>Only EIT
<dd>Do only EIT EPG scan (when some services from this mux are assigned to channels)
<dt>Only UK Freesat
<dd>Do only UK Freesat EPG scan (when some services from this mux are assigned to channels)
<dt>Only UK Freeview
<dd>Do only UK Freeview EPG scan (when some services from this mux are assigned to channels)
<dt>Only Viasat Baltic
<dd>Do only Viasat Baltic EPG scan (when some services from this mux are assigned to channels)
<dt>Only OpenTV Sky UK
<dd>Do only OpenTV Sky UK EPG scan (the TSID must match in the skyuk configuration file)
<dt>Only OpenTV Sky Italia
<dd>Do only OpenTV Sky Italia EPG scan (the TSID must match in the skyit configuration file)
<dt>Only OpenTV Sky Ausat
<dd>Do only OpenTV Sky Ausat EPG scan (the TSID must match in the ausat configuration file)
</dl>
<dt>Network
<dd>The name of the network to which the mux belongs. Networks are defined in Configuration -> DVB Inputs -> Networks - DVB-S or ATSC, for example.

View file

@ -416,13 +416,13 @@ epggrab_ota_kick_cb ( void *p )
[MM_EPG_DISABLE] = NULL,
[MM_EPG_ENABLE] = NULL,
[MM_EPG_FORCE] = NULL,
[MM_EPG_FORCE_EIT] = "eit",
[MM_EPG_FORCE_UK_FREESAT] = "uk_freesat",
[MM_EPG_FORCE_UK_FREEVIEW] = "uk_freeview",
[MM_EPG_FORCE_VIASAT_BALTIC] = "viasat_baltic",
[MM_EPG_FORCE_OPENTV_SKY_UK] = "opentv-skyuk",
[MM_EPG_FORCE_OPENTV_SKY_ITALIA] = "opentv-skyit",
[MM_EPG_FORCE_OPENTV_SKY_AUSAT] = "opentv-ausat",
[MM_EPG_ONLY_EIT] = "eit",
[MM_EPG_ONLY_UK_FREESAT] = "uk_freesat",
[MM_EPG_ONLY_UK_FREEVIEW] = "uk_freeview",
[MM_EPG_ONLY_VIASAT_BALTIC] = "viasat_baltic",
[MM_EPG_ONLY_OPENTV_SKY_UK] = "opentv-skyuk",
[MM_EPG_ONLY_OPENTV_SKY_ITALIA] = "opentv-skyit",
[MM_EPG_ONLY_OPENTV_SKY_AUSAT] = "opentv-ausat",
};
lock_assert(&global_lock);
@ -476,26 +476,25 @@ next_one:
goto done;
}
if (epg_flag != MM_EPG_FORCE) {
/* Check we have modules attached and enabled */
LIST_FOREACH(map, &om->om_modules, om_link) {
if (map->om_module->tune(map, om, mm))
break;
}
if (!map) {
char name[256];
mpegts_mux_nice_name(mm, name, sizeof(name));
tvhdebug("epggrab", "no OTA modules active for %s, check again next time", name);
goto done;
/* Check we have modules attached and enabled */
i = r = 0;
LIST_FOREACH(map, &om->om_modules, om_link) {
if (map->om_module->tune(map, om, mm)) {
i++;
if (modname && !strcmp(modname, map->om_module->id))
r = 1;
}
}
if ((i == 0 || (r == 0 && modname)) && epg_flag != MM_EPG_FORCE) {
char name[256];
mpegts_mux_nice_name(mm, name, sizeof(name));
tvhdebug("epggrab", "no OTA modules active for %s, check again next time", name);
goto done;
}
/* Some init stuff */
free(om->om_force_modname);
if (modname)
om->om_force_modname = strdup(modname);
else
om->om_force_modname = NULL;
om->om_force_modname = modname ? strdup(modname) : NULL;
/* Subscribe to the mux */
if ((r = mpegts_mux_subscribe(mm, "epggrab", SUBSCRIPTION_PRIO_EPG))) {

View file

@ -312,15 +312,15 @@ enum mpegts_mux_epg_flag
MM_EPG_DISABLE,
MM_EPG_ENABLE,
MM_EPG_FORCE,
MM_EPG_FORCE_EIT,
MM_EPG_FORCE_UK_FREESAT,
MM_EPG_FORCE_UK_FREEVIEW,
MM_EPG_FORCE_VIASAT_BALTIC,
MM_EPG_FORCE_OPENTV_SKY_UK,
MM_EPG_FORCE_OPENTV_SKY_ITALIA,
MM_EPG_FORCE_OPENTV_SKY_AUSAT,
MM_EPG_ONLY_EIT,
MM_EPG_ONLY_UK_FREESAT,
MM_EPG_ONLY_UK_FREEVIEW,
MM_EPG_ONLY_VIASAT_BALTIC,
MM_EPG_ONLY_OPENTV_SKY_UK,
MM_EPG_ONLY_OPENTV_SKY_ITALIA,
MM_EPG_ONLY_OPENTV_SKY_AUSAT,
};
#define MM_EPG_LAST MM_EPG_FORCE_OPENTV_SKY_AUSAT
#define MM_EPG_LAST MM_EPG_ONLY_OPENTV_SKY_AUSAT
/* Multiplex */
struct mpegts_mux

View file

@ -303,13 +303,13 @@ mpegts_mux_epg_list ( void *o )
{ "Disable", MM_EPG_DISABLE },
{ "Enable (auto)", MM_EPG_ENABLE },
{ "Force (auto)", MM_EPG_FORCE },
{ "Force EIT", MM_EPG_FORCE_EIT },
{ "Force UK Freesat", MM_EPG_FORCE_UK_FREESAT },
{ "Force UK Freeview", MM_EPG_FORCE_UK_FREEVIEW },
{ "Force Viasat Baltic", MM_EPG_FORCE_VIASAT_BALTIC },
{ "Force OpenTV Sky UK", MM_EPG_FORCE_OPENTV_SKY_UK },
{ "Force OpenTV Sky Italia", MM_EPG_FORCE_OPENTV_SKY_ITALIA },
{ "Force OpenTV Sky Ausat", MM_EPG_FORCE_OPENTV_SKY_AUSAT },
{ "Only EIT", MM_EPG_ONLY_EIT },
{ "Only UK Freesat", MM_EPG_ONLY_UK_FREESAT },
{ "Only UK Freeview", MM_EPG_ONLY_UK_FREEVIEW },
{ "Only Viasat Baltic", MM_EPG_ONLY_VIASAT_BALTIC },
{ "Only OpenTV Sky UK", MM_EPG_ONLY_OPENTV_SKY_UK },
{ "Only OpenTV Sky Italia", MM_EPG_ONLY_OPENTV_SKY_ITALIA },
{ "Only OpenTV Sky Ausat", MM_EPG_ONLY_OPENTV_SKY_AUSAT },
};
return strtab2htsmsg(tab);
}