mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 18:31:12 +02:00
zapit/src/scannit.cpp: parse network name and logical numbers
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5ff235027f
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-03-17 (Sat, 17 Mar 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -29,9 +29,12 @@
|
|||||||
#include <dvbsi++/satellite_delivery_system_descriptor.h>
|
#include <dvbsi++/satellite_delivery_system_descriptor.h>
|
||||||
#include <dvbsi++/cable_delivery_system_descriptor.h>
|
#include <dvbsi++/cable_delivery_system_descriptor.h>
|
||||||
#include <dvbsi++/service_list_descriptor.h>
|
#include <dvbsi++/service_list_descriptor.h>
|
||||||
|
#include <dvbsi++/logical_channel_descriptor.h>
|
||||||
|
|
||||||
#define NIT_SECTION_SIZE 1024
|
#define NIT_SECTION_SIZE 1024
|
||||||
|
|
||||||
|
typedef std::map <t_channel_id, int> channel_number_map_t;
|
||||||
|
|
||||||
class CNit : public OpenThreads::Thread
|
class CNit : public OpenThreads::Thread
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -41,6 +44,7 @@ class CNit : public OpenThreads::Thread
|
|||||||
t_satellite_position satellitePosition;
|
t_satellite_position satellitePosition;
|
||||||
freq_id_t freq_id;
|
freq_id_t freq_id;
|
||||||
unsigned short nid;
|
unsigned short nid;
|
||||||
|
channel_number_map_t logical_map;
|
||||||
|
|
||||||
NetworkInformationSectionList sections;
|
NetworkInformationSectionList sections;
|
||||||
|
|
||||||
@@ -49,6 +53,7 @@ class CNit : public OpenThreads::Thread
|
|||||||
bool ParseSatelliteDescriptor(SatelliteDeliverySystemDescriptor * sd, TransportStreamInfo * ts);
|
bool ParseSatelliteDescriptor(SatelliteDeliverySystemDescriptor * sd, TransportStreamInfo * ts);
|
||||||
bool ParseCableDescriptor(CableDeliverySystemDescriptor * sd, TransportStreamInfo * ts);
|
bool ParseCableDescriptor(CableDeliverySystemDescriptor * sd, TransportStreamInfo * ts);
|
||||||
bool ParseServiceList(ServiceListDescriptor * sd, TransportStreamInfo * ts);
|
bool ParseServiceList(ServiceListDescriptor * sd, TransportStreamInfo * ts);
|
||||||
|
bool ParseLogicalChannels(LogicalChannelDescriptor * ld, TransportStreamInfo * ts);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dnum = 0);
|
CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dnum = 0);
|
||||||
@@ -56,6 +61,7 @@ class CNit : public OpenThreads::Thread
|
|||||||
bool Start();
|
bool Start();
|
||||||
bool Stop();
|
bool Stop();
|
||||||
bool Parse();
|
bool Parse();
|
||||||
|
channel_number_map_t & getLogicalMap() { return logical_map; };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -24,10 +24,13 @@
|
|||||||
#include <zapit/scannit.h>
|
#include <zapit/scannit.h>
|
||||||
#include <zapit/scan.h>
|
#include <zapit/scan.h>
|
||||||
#include <dvbsi++/descriptor_tag.h>
|
#include <dvbsi++/descriptor_tag.h>
|
||||||
|
#include <dvbsi++/network_name_descriptor.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <eitd/edvbstring.h>
|
||||||
|
|
||||||
#define DEBUG_NIT
|
#define DEBUG_NIT
|
||||||
//#define DEBUG_NIT_UNUSED
|
//#define DEBUG_NIT_UNUSED
|
||||||
|
#define DEBUG_LCN
|
||||||
|
|
||||||
CNit::CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dnum)
|
CNit::CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dnum)
|
||||||
{
|
{
|
||||||
@@ -183,6 +186,17 @@ bool CNit::Parse()
|
|||||||
ParseServiceList((ServiceListDescriptor *) d, tsinfo);
|
ParseServiceList((ServiceListDescriptor *) d, tsinfo);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LOGICAL_CHANNEL_DESCRIPTOR:
|
||||||
|
ParseLogicalChannels((LogicalChannelDescriptor *) d, tsinfo);
|
||||||
|
break;
|
||||||
|
case NETWORK_NAME_DESCRIPTOR:
|
||||||
|
{
|
||||||
|
NetworkNameDescriptor * nd = (NetworkNameDescriptor *) d;
|
||||||
|
int tsidonid = (tsinfo->getTransportStreamId() << 16) | tsinfo->getOriginalNetworkId();
|
||||||
|
std::string networkName = stringDVBUTF8(nd->getNetworkName(), 0, tsidonid);
|
||||||
|
printf("NIT: network name [%s]\n", networkName.c_str());
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_NIT_UNUSED
|
#ifdef DEBUG_NIT_UNUSED
|
||||||
@@ -283,3 +297,25 @@ bool CNit::ParseServiceList(ServiceListDescriptor * sd, TransportStreamInfo * ts
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CNit::ParseLogicalChannels(LogicalChannelDescriptor * ld, TransportStreamInfo * tsinfo)
|
||||||
|
{
|
||||||
|
t_transport_stream_id transport_stream_id = tsinfo->getTransportStreamId();
|
||||||
|
t_original_network_id original_network_id = tsinfo->getOriginalNetworkId();
|
||||||
|
|
||||||
|
const LogicalChannelList &clist = *ld->getChannelList();
|
||||||
|
LogicalChannelListConstIterator it;
|
||||||
|
for (it = clist.begin(); it != clist.end(); ++it) {
|
||||||
|
t_service_id service_id = (*it)->getServiceId();
|
||||||
|
int lcn = (*it)->getLogicalChannelNumber();
|
||||||
|
/* FIXME dont use freq_id / satellitePosition ? */
|
||||||
|
t_channel_id channel_id = CZapitChannel::makeChannelId(satellitePosition,
|
||||||
|
freq_id, transport_stream_id, original_network_id, service_id);
|
||||||
|
// (*it)->getVisibleServiceFlag();
|
||||||
|
logical_map[channel_id] = lcn;
|
||||||
|
#ifdef DEBUG_LCN
|
||||||
|
printf("NIT: lcn tsid %04x onid %04x %llx -> %d\n", transport_stream_id, original_network_id, channel_id, lcn);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user