mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
zapit/scanait: formatting code using astyle; see https://github.com/neutrino-images/ni-buildsystem/blob/master/support/scripts/astyle.sh
Origin commit data
------------------
Branch: ni/coolstream
Commit: 39f3a0e2a0
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-06 (Sat, 06 Nov 2021)
Origin message was:
------------------
- zapit/scanait: formatting code using astyle; see https://github.com/neutrino-images/ni-buildsystem/blob/master/support/scripts/astyle.sh
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -37,11 +37,11 @@
|
|||||||
major = (version)&0xff; \
|
major = (version)&0xff; \
|
||||||
minor = (version>>8)&0xff; \
|
minor = (version>>8)&0xff; \
|
||||||
micro = (version>>16)&0xff; \
|
micro = (version>>16)&0xff; \
|
||||||
}
|
}
|
||||||
|
|
||||||
class CAit : public OpenThreads::Thread
|
class CAit : public OpenThreads::Thread
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int dmxnum;
|
int dmxnum;
|
||||||
unsigned short pid;
|
unsigned short pid;
|
||||||
bool running;
|
bool running;
|
||||||
@@ -50,14 +50,14 @@ private:
|
|||||||
void run();
|
void run();
|
||||||
bool Read();
|
bool Read();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CAit();
|
CAit();
|
||||||
~CAit();
|
~CAit();
|
||||||
void setDemux(int dnum = 0);
|
void setDemux(int dnum = 0);
|
||||||
bool Start();
|
bool Start();
|
||||||
bool Stop();
|
bool Stop();
|
||||||
bool Parse();
|
bool Parse();
|
||||||
bool Parse(CZapitChannel * const channel);
|
bool Parse(CZapitChannel *const channel);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -72,7 +72,7 @@ bool CAit::Stop()
|
|||||||
void CAit::run()
|
void CAit::run()
|
||||||
{
|
{
|
||||||
set_threadname("zap:ait");
|
set_threadname("zap:ait");
|
||||||
if(Parse())
|
if (Parse())
|
||||||
printf("[scan] AIT finished.\n");
|
printf("[scan] AIT finished.\n");
|
||||||
else
|
else
|
||||||
printf("[scan] AIT failed !\n");
|
printf("[scan] AIT failed !\n");
|
||||||
@@ -86,7 +86,7 @@ bool CAit::Read()
|
|||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
cDemux * dmx = new cDemux(dmxnum);
|
cDemux *dmx = new cDemux(dmxnum);
|
||||||
dmx->Open(DMX_PSI_CHANNEL);
|
dmx->Open(DMX_PSI_CHANNEL);
|
||||||
|
|
||||||
unsigned char buffer[AIT_SECTION_SIZE];
|
unsigned char buffer[AIT_SECTION_SIZE];
|
||||||
@@ -109,7 +109,7 @@ bool CAit::Read()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("CAit::Read: pid %x found\n", pid);
|
printf("CAit::Read: pid %x found\n", pid);
|
||||||
ApplicationInformationSection * ait = new ApplicationInformationSection(buffer);
|
ApplicationInformationSection *ait = new ApplicationInformationSection(buffer);
|
||||||
sections.push_back(ait);
|
sections.push_back(ait);
|
||||||
}
|
}
|
||||||
dmx->Stop();
|
dmx->Stop();
|
||||||
@@ -121,10 +121,10 @@ bool CAit::Parse()
|
|||||||
{
|
{
|
||||||
printf("[ait] trying to parse AIT\n");
|
printf("[ait] trying to parse AIT\n");
|
||||||
|
|
||||||
if(!Read())
|
if (!Read())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
FILE * pFile = fopen ("/tmp/ait.txt","w");
|
FILE *pFile = fopen("/tmp/ait.txt", "w");
|
||||||
if (pFile)
|
if (pFile)
|
||||||
fprintf(pFile, "Channel: %s\n", name.c_str());
|
fprintf(pFile, "Channel: %s\n", name.c_str());
|
||||||
short int profilecode = 0;
|
short int profilecode = 0;
|
||||||
@@ -135,7 +135,8 @@ bool CAit::Parse()
|
|||||||
for (sit = sections.begin(); sit != sections.end(); ++sit)
|
for (sit = sections.begin(); sit != sections.end(); ++sit)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (CServiceScan::getInstance()->Aborted()){
|
if (CServiceScan::getInstance()->Aborted())
|
||||||
|
{
|
||||||
if (pFile)
|
if (pFile)
|
||||||
fclose(pFile);
|
fclose(pFile);
|
||||||
|
|
||||||
@@ -149,7 +150,7 @@ bool CAit::Parse()
|
|||||||
std::string hbbtvUrl = "", applicationName = "";
|
std::string hbbtvUrl = "", applicationName = "";
|
||||||
std::string TPDescPath = "", SALDescPath = "";
|
std::string TPDescPath = "", SALDescPath = "";
|
||||||
int controlCode = (*i)->getApplicationControlCode();
|
int controlCode = (*i)->getApplicationControlCode();
|
||||||
ApplicationIdentifier * applicationIdentifier = (ApplicationIdentifier *)(*i)->getApplicationIdentifier();
|
ApplicationIdentifier *applicationIdentifier = (ApplicationIdentifier *)(*i)->getApplicationIdentifier();
|
||||||
profilecode = 0;
|
profilecode = 0;
|
||||||
orgid = applicationIdentifier->getOrganisationId();
|
orgid = applicationIdentifier->getOrganisationId();
|
||||||
appid = applicationIdentifier->getApplicationId();
|
appid = applicationIdentifier->getApplicationId();
|
||||||
@@ -163,10 +164,10 @@ bool CAit::Parse()
|
|||||||
{
|
{
|
||||||
case APPLICATION_DESCRIPTOR:
|
case APPLICATION_DESCRIPTOR:
|
||||||
{
|
{
|
||||||
ApplicationDescriptor* applicationDescriptor = (ApplicationDescriptor*)(*desc);
|
ApplicationDescriptor *applicationDescriptor = (ApplicationDescriptor *)(*desc);
|
||||||
const ApplicationProfileList* applicationProfiles = applicationDescriptor->getApplicationProfiles();
|
const ApplicationProfileList *applicationProfiles = applicationDescriptor->getApplicationProfiles();
|
||||||
ApplicationProfileConstIterator interactionit = applicationProfiles->begin();
|
ApplicationProfileConstIterator interactionit = applicationProfiles->begin();
|
||||||
for(; interactionit != applicationProfiles->end(); ++interactionit)
|
for (; interactionit != applicationProfiles->end(); ++interactionit)
|
||||||
{
|
{
|
||||||
profilecode = (*interactionit)->getApplicationProfile();
|
profilecode = (*interactionit)->getApplicationProfile();
|
||||||
profileVersion = PACK_VERSION(
|
profileVersion = PACK_VERSION(
|
||||||
@@ -179,9 +180,9 @@ bool CAit::Parse()
|
|||||||
}
|
}
|
||||||
case APPLICATION_NAME_DESCRIPTOR:
|
case APPLICATION_NAME_DESCRIPTOR:
|
||||||
{
|
{
|
||||||
ApplicationNameDescriptor *nameDescriptor = (ApplicationNameDescriptor*)(*desc);
|
ApplicationNameDescriptor *nameDescriptor = (ApplicationNameDescriptor *)(*desc);
|
||||||
ApplicationNameConstIterator interactionit = nameDescriptor->getApplicationNames()->begin();
|
ApplicationNameConstIterator interactionit = nameDescriptor->getApplicationNames()->begin();
|
||||||
for(; interactionit != nameDescriptor->getApplicationNames()->end(); ++interactionit)
|
for (; interactionit != nameDescriptor->getApplicationNames()->end(); ++interactionit)
|
||||||
{
|
{
|
||||||
applicationName = (*interactionit)->getApplicationName();
|
applicationName = (*interactionit)->getApplicationName();
|
||||||
//if(controlCode == 1) printf("[ait] applicationname: %s\n", applicationName.c_str());
|
//if(controlCode == 1) printf("[ait] applicationname: %s\n", applicationName.c_str());
|
||||||
@@ -191,7 +192,7 @@ bool CAit::Parse()
|
|||||||
}
|
}
|
||||||
case TRANSPORT_PROTOCOL_DESCRIPTOR:
|
case TRANSPORT_PROTOCOL_DESCRIPTOR:
|
||||||
{
|
{
|
||||||
TransportProtocolDescriptor *transport = (TransportProtocolDescriptor*)(*desc);
|
TransportProtocolDescriptor *transport = (TransportProtocolDescriptor *)(*desc);
|
||||||
switch (transport->getProtocolId())
|
switch (transport->getProtocolId())
|
||||||
{
|
{
|
||||||
case 1: /* object carousel */
|
case 1: /* object carousel */
|
||||||
@@ -201,7 +202,7 @@ bool CAit::Parse()
|
|||||||
case 3: /* interaction */
|
case 3: /* interaction */
|
||||||
{
|
{
|
||||||
InterActionTransportConstIterator interactionit = transport->getInteractionTransports()->begin();
|
InterActionTransportConstIterator interactionit = transport->getInteractionTransports()->begin();
|
||||||
for(; interactionit != transport->getInteractionTransports()->end(); ++interactionit)
|
for (; interactionit != transport->getInteractionTransports()->end(); ++interactionit)
|
||||||
{
|
{
|
||||||
TPDescPath = (*interactionit)->getUrlBase()->getUrl();
|
TPDescPath = (*interactionit)->getUrlBase()->getUrl();
|
||||||
break;
|
break;
|
||||||
@@ -215,7 +216,7 @@ bool CAit::Parse()
|
|||||||
break;
|
break;
|
||||||
case SIMPLE_APPLICATION_LOCATION_DESCRIPTOR:
|
case SIMPLE_APPLICATION_LOCATION_DESCRIPTOR:
|
||||||
{
|
{
|
||||||
SimpleApplicationLocationDescriptor *applicationlocation = (SimpleApplicationLocationDescriptor*)(*desc);
|
SimpleApplicationLocationDescriptor *applicationlocation = (SimpleApplicationLocationDescriptor *)(*desc);
|
||||||
SALDescPath = applicationlocation->getInitialPath();
|
SALDescPath = applicationlocation->getInitialPath();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -227,9 +228,9 @@ bool CAit::Parse()
|
|||||||
}
|
}
|
||||||
hbbtvUrl = TPDescPath + SALDescPath;
|
hbbtvUrl = TPDescPath + SALDescPath;
|
||||||
}
|
}
|
||||||
if(!hbbtvUrl.empty())
|
if (!hbbtvUrl.empty())
|
||||||
{
|
{
|
||||||
printf("[ait] detected AppID: %d, AppName: %s, Url: %s profilecode: %i orgid: %i sectionLength: %i profileVersion %i\n", appid, applicationName.c_str(), hbbtvUrl.c_str(),profilecode,orgid,sectionLength,profileVersion);
|
printf("[ait] detected AppID: %d, AppName: %s, Url: %s profilecode: %i orgid: %i sectionLength: %i profileVersion %i\n", appid, applicationName.c_str(), hbbtvUrl.c_str(), profilecode, orgid, sectionLength, profileVersion);
|
||||||
if (pFile)
|
if (pFile)
|
||||||
{
|
{
|
||||||
fprintf(pFile, "AppID: %d, AppName: %s, Url: %s\n", appid, applicationName.c_str(), hbbtvUrl.c_str());
|
fprintf(pFile, "AppID: %d, AppName: %s, Url: %s\n", appid, applicationName.c_str(), hbbtvUrl.c_str());
|
||||||
@@ -243,12 +244,12 @@ bool CAit::Parse()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAit::Parse(CZapitChannel * const channel)
|
bool CAit::Parse(CZapitChannel *const channel)
|
||||||
{
|
{
|
||||||
pid = channel->getAitPid();
|
pid = channel->getAitPid();
|
||||||
name = channel->getName();
|
name = channel->getName();
|
||||||
unlink("/tmp/ait.txt");
|
unlink("/tmp/ait.txt");
|
||||||
if(pid > 0)
|
if (pid > 0)
|
||||||
{
|
{
|
||||||
return Start();
|
return Start();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user