use CEitManager to get EIT data

Origin commit data
------------------
Branch: ni/coolstream
Commit: 74a761ef50
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-08-30 (Thu, 30 Aug 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-08-30 11:40:02 +04:00
parent 579e7a92f4
commit 5580b9cc18
15 changed files with 76 additions and 152 deletions

View File

@@ -29,6 +29,7 @@
#include <neutrinoMessages.h>
#include <zapit/client/zapittools.h>
#include <zapit/zapit.h>
#include <eitd/sectionsd.h>
#include <configfile.h>
#include <system/configure_network.h>
#include <cs_api.h>
@@ -45,13 +46,6 @@
#include "neutrinoapi.h"
#include "controlapi.h"
bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata);
bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata);
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors);
bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags);
extern CPlugins *g_PluginList;//for relodplugins
extern CBouquetManager *g_bouquetManager;
#define EVENTDEV "/dev/input/input0"
@@ -899,7 +893,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann
if (event) {
if (event->duration > 0)
percentage = 100 * (time(NULL) - event->startTime) / event->duration;
sectionsd_getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo);
CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id & 0xFFFFFFFFFFFFULL, currentNextInfo);
timestr = timeString(event->startTime);
firstEPG += hh->outPair("startTime", timestr, true);
@@ -1198,7 +1192,7 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) {
std::string result = "";
std::string channelData = "";
sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList);
CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList);
channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true);
channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true);
channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), false);
@@ -1232,7 +1226,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_
if (!(hh->ParamList["details"].empty())) {
CShortEPGData epg;
if (sectionsd_getEPGidShort(eventIterator->eventID, &epg)) {
if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) {
prog += hh->outPair("info1", hh->outValue(epg.info1), true);
prog += hh->outPair("info2", hh->outValue(epg.info2), true);
}
@@ -1389,7 +1383,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) {
uint64_t epgid;
sscanf(hh->ParamList["eventid"].c_str(), "%llu", &epgid);
CShortEPGData epg;
if (sectionsd_getEPGidShort(epgid, &epg)) {
if (CEitManager::getInstance()->getEPGidShort(epgid, &epg)) {
hh->WriteLn(epg.title);
hh->WriteLn(epg.info1);
hh->WriteLn(epg.info2);
@@ -1402,7 +1396,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) {
sscanf(hh->ParamList["fskid"].c_str(), "%llu", &epgid);
sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime);
CEPGData longepg;
if (sectionsd_getEPGid(epgid, starttime, &longepg)) {
if (CEitManager::getInstance()->getEPGid(epgid, starttime, &longepg)) {
hh->printf("%u\n", longepg.fsk);
return;
}
@@ -1413,11 +1407,11 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) {
else if (!(hh->ParamList["id"].empty())) {
t_channel_id channel_id;
sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id);
sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList);
CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList);
CChannelEventList::iterator eventIterator;
for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator) {
CShortEPGData epg;
if (sectionsd_getEPGidShort(eventIterator->eventID, &epg)) {
if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) {
hh->printf("%llu %ld %d\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration);
hh->printf("%s\n", epg.title.c_str());
hh->printf("%s\n", epg.info1.c_str());
@@ -1508,8 +1502,8 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID();
CSectionsdClient::LinkageDescriptorList desc;
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo);
if (sectionsd_getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc))
CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo);
if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc))
{
for(unsigned int i=0; i< desc.size(); i++)
{
@@ -1583,7 +1577,7 @@ void CControlAPI::LCDAction(CyhookHandler *hh)
void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id)
{
int pos = 0;
sectionsd_getEventsServiceKey(channel_id, NeutrinoAPI->eList);
CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList);
CChannelEventList::iterator eventIterator;
for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, pos++)
@@ -1648,8 +1642,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh)
t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID();
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo);
if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags))
CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo);
if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags))
{
for (unsigned int i=0; i< tags.size(); i++)
{
@@ -1896,7 +1890,7 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh)
std::string title = timer->epgTitle;
if(timer->epgID!=0) {
CEPGData epgdata;
if (sectionsd_getEPGid(timer->epgID, timer->epg_starttime, &epgdata))
if (CEitManager::getInstance()->getEPGid(timer->epgID, timer->epg_starttime, &epgdata))
title = epgdata.title;
}

View File

@@ -39,6 +39,7 @@
#include <zapit/zapit.h>
#include <zapit/bouquets.h>
#include <zapit/getservices.h>
#include <eitd/sectionsd.h>
extern CBouquetManager *g_bouquetManager;
extern CFrontend * frontend;
@@ -54,8 +55,6 @@ extern CZapitClient::SatelliteList satList;
// nhttpd
#include "neutrinoapi.h"
void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = true, t_channel_id *chidlist = NULL, int clen = 0);
//=============================================================================
// No Class Helpers
//=============================================================================
@@ -259,7 +258,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10])
bool CNeutrinoAPI::GetChannelEvents(void)
{
sectionsd_getChannelEvents(eList);
CEitManager::getInstance()->getChannelEvents(eList);
CChannelEventList::iterator eventIterator;
ChannelListEvents.clear();

View File

@@ -29,16 +29,12 @@
#include <zapit/channel.h>
#include <zapit/zapit.h>
#include <zapit/getservices.h>
#include <eitd/sectionsd.h>
#include <cs_api.h>
#include <system/configure_network.h>
extern CBouquetManager *g_bouquetManager;
bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list);
void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags);
bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata);
bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata);
//=============================================================================
// Constructor & Destructor & Initialization
//=============================================================================
@@ -291,7 +287,7 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, st
sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id);
std::string _sid = std::string(id);
sel = (_sid == achannel_id) ? "selected=\"selected\"" : "";
sectionsd_getActualEPGServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, &epg);
CEitManager::getInstance()->getActualEPGServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, &epg);
sprintf(buf,"<option value="PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS" %s>%.20s - %.30s</option>\n", channel->channel_id, sel.c_str(), channel->getName().c_str(),epg.title.c_str());
yresult += buf;
}
@@ -396,7 +392,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE)
{
CSectionsdClient::NVODTimesList nvod_list;
if (sectionsd_getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list))
if (CEitManager::getInstance()->getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list))
{
CZapitClient::subServiceList subServiceList;
@@ -413,7 +409,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
t_channel_id channel_id = CREATE_CHANNEL_ID(cmd.service_id, cmd.original_network_id, cmd.transport_stream_id);
timestr = timeString(ni->zeit.startzeit); // FIXME: time is wrong (at least on little endian)!
sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!!
CEitManager::getInstance()->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!!
yresult += string_printf("<tr>\n<td align=\"left\" style=\"width: 31px\" class=\"%cepg\">&nbsp;</td>", classname);
yresult += string_printf("<td class=\"%cepg\">%s&nbsp;", classname, timestr.c_str());
yresult += string_printf("%s<a href=\"javascript:do_zap('"
@@ -439,7 +435,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
else if ((event = NeutrinoAPI->ChannelListEvents[channel->channel_id]))
{
bool has_current_next = true;
sectionsd_getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo);
CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo);
timestr = timeString(event->startTime);
yresult += string_printf("<tr><td class=\"%cepg\">",classname);
@@ -547,8 +543,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *,
t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID();
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo);
if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags))
CEitManager::getInstance()->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo);
if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags))
{
for (unsigned int i=0; i< tags.size(); i++)
{
@@ -811,7 +807,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string
if(timer->epgID!=0)
{
CEPGData epgdata;
if (sectionsd_getEPGid(timer->epgID, timer->epg_starttime, &epgdata))
if (CEitManager::getInstance()->getEPGid(timer->epgID, timer->epg_starttime, &epgdata))
sAddData+="<br/>" + epgdata.title;
else
sAddData+=std::string("<br/>")+timer->epgTitle;