mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
Merge branch 'dvbsi++' of 109.75.98.228:cst-private-neutrino into dvbsi++
This commit is contained in:
@@ -113,7 +113,6 @@ const std::string ntp_system_cmd_prefix = "/sbin/ntpdate ";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string ntp_system_cmd;
|
std::string ntp_system_cmd;
|
||||||
CConfigFile ntp_config(',');
|
|
||||||
std::string ntpserver;
|
std::string ntpserver;
|
||||||
int ntprefresh;
|
int ntprefresh;
|
||||||
int ntpenable;
|
int ntpenable;
|
||||||
@@ -2033,13 +2032,33 @@ CEitManager * CEitManager::getInstance()
|
|||||||
|
|
||||||
bool CEitManager::Start()
|
bool CEitManager::Start()
|
||||||
{
|
{
|
||||||
xprintf("[sectionsd] start\n");
|
xprintf("[sectionsd] start\n");
|
||||||
if(running)
|
if(running)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
ntpserver = config.network_ntpserver;
|
||||||
|
ntprefresh = config.network_ntprefresh;
|
||||||
|
ntpenable = config.network_ntpenable;
|
||||||
|
ntp_system_cmd = ntp_system_cmd_prefix + ntpserver;
|
||||||
|
|
||||||
|
secondsToCache = config.epg_cache *24*60L*60L; //days
|
||||||
|
secondsExtendedTextCache = config.epg_extendedcache*60L*60L; //hours
|
||||||
|
oldEventsAre = config.epg_old_events*60L*60L; //hours
|
||||||
|
max_events = config.epg_max_events;
|
||||||
|
|
||||||
|
printf("[sectionsd] Caching: %d days, %d hours Extended Text, max %d events, Events are old %d hours after end time\n",
|
||||||
|
config.epg_cache, config.epg_extendedcache, config.epg_max_events, config.epg_old_events);
|
||||||
|
printf("[sectionsd] NTP: %s, server %s\n", ntpenable ? "enabled" : "disabled", ntpserver.c_str());
|
||||||
|
|
||||||
|
if (!sectionsd_server.prepare(SECTIONSD_UDS_NAME)) {
|
||||||
|
fprintf(stderr, "[sectionsd] failed to prepare basic server\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
eventServer = new CEventServer;
|
||||||
|
|
||||||
running = true;
|
running = true;
|
||||||
return (OpenThreads::Thread::start() == 0);
|
return (OpenThreads::Thread::start() == 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CEitManager::Stop()
|
bool CEitManager::Stop()
|
||||||
@@ -2075,42 +2094,11 @@ printf("SIevent size: %d\n", sizeof(SIevent));
|
|||||||
|
|
||||||
tzset(); // TZ auswerten
|
tzset(); // TZ auswerten
|
||||||
|
|
||||||
CBasicServer sectionsd_server;
|
|
||||||
|
|
||||||
//NTP-Config laden
|
|
||||||
if (!ntp_config.loadConfig(CONF_FILE))
|
|
||||||
{
|
|
||||||
/* set defaults if no configuration file exists */
|
|
||||||
printf("[sectionsd] %s not found\n", CONF_FILE);
|
|
||||||
}
|
|
||||||
|
|
||||||
ntpserver = ntp_config.getString("network_ntpserver", "de.pool.ntp.org");
|
|
||||||
ntprefresh = atoi(ntp_config.getString("network_ntprefresh","30").c_str() );
|
|
||||||
ntpenable = ntp_config.getBool("network_ntpenable", false);
|
|
||||||
ntp_system_cmd = ntp_system_cmd_prefix + ntpserver;
|
|
||||||
|
|
||||||
//EPG Einstellungen laden
|
|
||||||
secondsToCache = (atoi(ntp_config.getString("epg_cache_time","14").c_str() ) *24*60L*60L); //Tage
|
|
||||||
secondsExtendedTextCache = (atoi(ntp_config.getString("epg_extendedcache_time","360").c_str() ) *60L*60L); //Stunden
|
|
||||||
oldEventsAre = (atoi(ntp_config.getString("epg_old_events","1").c_str() ) *60L*60L); //Stunden
|
|
||||||
max_events= atoi(ntp_config.getString("epg_max_events","50000").c_str() );
|
|
||||||
|
|
||||||
printf("[sectionsd] Caching max %d events\n", max_events);
|
|
||||||
printf("[sectionsd] Caching %ld days\n", secondsToCache / (24*60*60L));
|
|
||||||
printf("[sectionsd] Caching %ld hours Extended Text\n", secondsExtendedTextCache / (60*60L));
|
|
||||||
printf("[sectionsd] Events are old %ldmin after their end time\n", oldEventsAre / 60);
|
|
||||||
|
|
||||||
readEPGFilter();
|
readEPGFilter();
|
||||||
readDVBTimeFilter();
|
readDVBTimeFilter();
|
||||||
readEncodingFile();
|
readEncodingFile();
|
||||||
|
|
||||||
if (!sectionsd_server.prepare(SECTIONSD_UDS_NAME)) {
|
/* threads start left here for now, if any problems found, will be moved to Start() */
|
||||||
fprintf(stderr, "[sectionsd] failed to prepare basic server\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
eventServer = new CEventServer;
|
|
||||||
|
|
||||||
threadTIME.Start();
|
threadTIME.Start();
|
||||||
threadEIT.Start();
|
threadEIT.Start();
|
||||||
threadCN.Start();
|
threadCN.Start();
|
||||||
@@ -2349,6 +2337,7 @@ void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSections
|
|||||||
|
|
||||||
if (nextEvt.service_id != 0)
|
if (nextEvt.service_id != 0)
|
||||||
{
|
{
|
||||||
|
/* FIXME what this code should do ? why search channel id as event key ?? */
|
||||||
MySIeventsOrderUniqueKey::iterator eFirst = mySIeventsOrderUniqueKey.find(uniqueServiceKey);
|
MySIeventsOrderUniqueKey::iterator eFirst = mySIeventsOrderUniqueKey.find(uniqueServiceKey);
|
||||||
|
|
||||||
if (eFirst != mySIeventsOrderUniqueKey.end())
|
if (eFirst != mySIeventsOrderUniqueKey.end())
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include <OpenThreads/Thread>
|
#include <OpenThreads/Thread>
|
||||||
#include <OpenThreads/Condition>
|
#include <OpenThreads/Condition>
|
||||||
|
#include <sectionsdclient/sectionsdclient.h>
|
||||||
|
#include <connection/basicserver.h>
|
||||||
#include "dmx.h"
|
#include "dmx.h"
|
||||||
|
|
||||||
//#include "SIutils.hpp"
|
//#include "SIutils.hpp"
|
||||||
@@ -42,6 +44,8 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
bool running;
|
bool running;
|
||||||
|
CSectionsdClient::epg_config config;
|
||||||
|
CBasicServer sectionsd_server;
|
||||||
|
|
||||||
static OpenThreads::Mutex m;
|
static OpenThreads::Mutex m;
|
||||||
static CEitManager * manager;
|
static CEitManager * manager;
|
||||||
@@ -56,6 +60,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex
|
|||||||
|
|
||||||
bool Start();
|
bool Start();
|
||||||
bool Stop();
|
bool Stop();
|
||||||
|
void SetConfig(CSectionsdClient::epg_config &cfg) { config = cfg; };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1550,9 +1550,8 @@ bool sectionsd_isReady(void);
|
|||||||
#define LCD_UPDATE_TIME_RADIO_MODE (6 * 1000 * 1000)
|
#define LCD_UPDATE_TIME_RADIO_MODE (6 * 1000 * 1000)
|
||||||
#define LCD_UPDATE_TIME_TV_MODE (60 * 1000 * 1000)
|
#define LCD_UPDATE_TIME_TV_MODE (60 * 1000 * 1000)
|
||||||
|
|
||||||
void CNeutrinoApp::SendSectionsdConfig(void)
|
void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config)
|
||||||
{
|
{
|
||||||
CSectionsdClient::epg_config config;
|
|
||||||
config.scanMode = scanSettings.scanSectionsd;
|
config.scanMode = scanSettings.scanSectionsd;
|
||||||
config.epg_cache = atoi(g_settings.epg_cache.c_str());
|
config.epg_cache = atoi(g_settings.epg_cache.c_str());
|
||||||
config.epg_old_events = atoi(g_settings.epg_old_events.c_str());
|
config.epg_old_events = atoi(g_settings.epg_old_events.c_str());
|
||||||
@@ -1562,6 +1561,12 @@ void CNeutrinoApp::SendSectionsdConfig(void)
|
|||||||
config.network_ntpserver = g_settings.network_ntpserver;
|
config.network_ntpserver = g_settings.network_ntpserver;
|
||||||
config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str());
|
config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str());
|
||||||
config.network_ntpenable = g_settings.network_ntpenable;
|
config.network_ntpenable = g_settings.network_ntpenable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CNeutrinoApp::SendSectionsdConfig(void)
|
||||||
|
{
|
||||||
|
CSectionsdClient::epg_config config;
|
||||||
|
MakeSectionsdConfig(config);
|
||||||
g_Sectionsd->setConfig(config);
|
g_Sectionsd->setConfig(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1570,7 +1575,7 @@ void CNeutrinoApp::InitZapper()
|
|||||||
struct stat my_stat;
|
struct stat my_stat;
|
||||||
|
|
||||||
g_InfoViewer->start();
|
g_InfoViewer->start();
|
||||||
SendSectionsdConfig();
|
//SendSectionsdConfig();
|
||||||
if (g_settings.epg_save){
|
if (g_settings.epg_save){
|
||||||
if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0)
|
if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0)
|
||||||
g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str());
|
g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str());
|
||||||
@@ -1721,6 +1726,9 @@ int CNeutrinoApp::run(int argc, char **argv)
|
|||||||
|
|
||||||
#ifndef DISABLE_SECTIONSD
|
#ifndef DISABLE_SECTIONSD
|
||||||
//pthread_create (§ions_thread, NULL, sectionsd_main_thread, (void *) NULL);
|
//pthread_create (§ions_thread, NULL, sectionsd_main_thread, (void *) NULL);
|
||||||
|
CSectionsdClient::epg_config config;
|
||||||
|
MakeSectionsdConfig(config);
|
||||||
|
CEitManager::getInstance()->SetConfig(config);
|
||||||
CEitManager::getInstance()->Start();
|
CEitManager::getInstance()->Start();
|
||||||
#endif
|
#endif
|
||||||
g_Zapit = new CZapitClient;
|
g_Zapit = new CZapitClient;
|
||||||
@@ -1786,8 +1794,8 @@ int CNeutrinoApp::run(int argc, char **argv)
|
|||||||
//init Menues
|
//init Menues
|
||||||
InitMenu();
|
InitMenu();
|
||||||
|
|
||||||
|
#if 0 //ndef DISABLE_SECTIONSD
|
||||||
/* wait for sectionsd to be able to process our registration */
|
/* wait for sectionsd to be able to process our registration */
|
||||||
#ifndef DISABLE_SECTIONSD
|
|
||||||
time_t t = time_monotonic_ms();
|
time_t t = time_monotonic_ms();
|
||||||
while (! sectionsd_isReady())
|
while (! sectionsd_isReady())
|
||||||
sleep(0);
|
sleep(0);
|
||||||
|
@@ -217,6 +217,7 @@ public:
|
|||||||
return current_muted;
|
return current_muted;
|
||||||
}
|
}
|
||||||
int recordingstatus;
|
int recordingstatus;
|
||||||
|
void MakeSectionsdConfig(CSectionsdClient::epg_config& config);
|
||||||
void SendSectionsdConfig(void);
|
void SendSectionsdConfig(void);
|
||||||
int GetChannelMode(void) {
|
int GetChannelMode(void) {
|
||||||
return lastChannelMode;
|
return lastChannelMode;
|
||||||
|
Reference in New Issue
Block a user