diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
index 85dde8f326..a4954c2b25 100644
|
a
|
b
|
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1275 | 1275 | RegistrationDescriptor reg(descs[i]); |
| 1276 | 1276 | if (reg.FormatIdentifierString() == "CUEI" || |
| 1277 | 1277 | reg.FormatIdentifierString() == "SCTE") |
| 1278 | | info.is_opencable = true; |
| | 1278 | { |
| | 1279 | // Presence of CUEI descriptor in Ziggo DVB signal does not make it opencable |
| | 1280 | // info.is_opencable = true; |
| | 1281 | } |
| 1279 | 1282 | } |
| 1280 | 1283 | |
| 1281 | 1284 | info.is_encrypted |= pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()); |
| … |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1324 | 1327 | |
| 1325 | 1328 | // NIT |
| 1326 | 1329 | QMap<qlonglong, uint> ukChanNums; |
| | 1330 | QMap<qlonglong, uint> scnChanNums; |
| 1327 | 1331 | QMap<uint,ChannelInsertInfo>::iterator dbchan_it; |
| 1328 | 1332 | for (dbchan_it = pnum_to_dbchan.begin(); |
| 1329 | 1333 | dbchan_it != pnum_to_dbchan.end(); ++dbchan_it) |
| … |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1352 | 1356 | const desc_list_t &list = |
| 1353 | 1357 | MPEGDescriptor::Parse(nit->TransportDescriptors(i), |
| 1354 | 1358 | nit->TransportDescriptorsLength(i)); |
| | 1359 | // Logical channel numbers |
| | 1360 | { |
| | 1361 | const unsigned char *desc = |
| | 1362 | MPEGDescriptor::Find( |
| | 1363 | list, PrivateDescriptorID::dvb_logical_channel_descriptor); |
| 1355 | 1364 | |
| 1356 | | const unsigned char *desc = |
| 1357 | | MPEGDescriptor::Find( |
| 1358 | | list, PrivateDescriptorID::dvb_logical_channel_descriptor); |
| | 1365 | if (desc) |
| | 1366 | { |
| | 1367 | DVBLogicalChannelDescriptor uklist(desc); |
| | 1368 | |
| | 1369 | for (uint j = 0; j < uklist.ChannelCount(); ++j) |
| | 1370 | { |
| | 1371 | ukChanNums[((qlonglong)info.orig_netid<<32) | |
| | 1372 | uklist.ServiceID(j)] = |
| | 1373 | uklist.ChannelNumber(j); |
| | 1374 | } |
| | 1375 | } |
| | 1376 | } |
| 1359 | 1377 | |
| 1360 | | if (desc) |
| | 1378 | // HD Simulcast logical channel numbers |
| 1361 | 1379 | { |
| 1362 | | DVBLogicalChannelDescriptor uklist(desc); |
| 1363 | | for (uint j = 0; j < uklist.ChannelCount(); ++j) |
| | 1380 | const unsigned char *desc = |
| | 1381 | MPEGDescriptor::Find( |
| | 1382 | list, PrivateDescriptorID::dvb_simulcast_channel_descriptor); |
| | 1383 | |
| | 1384 | if (desc) |
| 1364 | 1385 | { |
| 1365 | | ukChanNums[((qlonglong)info.orig_netid<<32) | |
| 1366 | | uklist.ServiceID(j)] = |
| 1367 | | uklist.ChannelNumber(j); |
| | 1386 | DVBSimulcastChannelDescriptor scnlist(desc); |
| | 1387 | |
| | 1388 | for (uint j = 0; j < scnlist.ChannelCount(); ++j) |
| | 1389 | { |
| | 1390 | scnChanNums[((qlonglong)info.orig_netid<<32) | |
| | 1391 | scnlist.ServiceID(j)] = |
| | 1392 | scnlist.ChannelNumber(j); |
| | 1393 | } |
| 1368 | 1394 | } |
| 1369 | 1395 | } |
| 1370 | 1396 | } |
| … |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1382 | 1408 | |
| 1383 | 1409 | if (iptv_channel.isEmpty()) // DVB Logical channel numbers (LCN) |
| 1384 | 1410 | { |
| 1385 | | QMap<qlonglong, uint>::const_iterator it = ukChanNums.find |
| | 1411 | // Look for a logical channel number in the HD simulcast channel numbers. |
| | 1412 | // This gives the correct channel number when HD and SD versions of the same |
| | 1413 | // channel are simultaneously broadcast and the receiver is capable |
| | 1414 | // of receiving the HD signal. |
| | 1415 | QMap<qlonglong, uint>::const_iterator it = scnChanNums.find |
| | 1416 | (((qlonglong)info.orig_netid<<32) | info.service_id); |
| | 1417 | |
| | 1418 | if (it != scnChanNums.end()) |
| | 1419 | { |
| | 1420 | info.chan_num = QString::number(*it); |
| | 1421 | continue; |
| | 1422 | } |
| | 1423 | |
| | 1424 | // If there is no simulcast for this channel then descriptor 0x83 |
| | 1425 | // gives the logical channel number. This can be either an SD |
| | 1426 | // or an HD channel. |
| | 1427 | it = ukChanNums.find |
| 1386 | 1428 | (((qlonglong)info.orig_netid<<32) | info.service_id); |
| 1387 | 1429 | |
| 1388 | 1430 | if (it != ukChanNums.end()) |
| … |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1394 | 1436 | if (info.service_id) |
| 1395 | 1437 | info.chan_num += "-" + QString::number(info.service_id); |
| 1396 | 1438 | } |
| 1397 | | |
| 1398 | | LOG(VB_CHANSCAN, LOG_INFO, LOC + |
| 1399 | | QString("GetChannelList: set chan_num '%1'").arg(info.chan_num)); |
| 1400 | 1439 | } |
| 1401 | 1440 | |
| 1402 | 1441 | // Get QAM/SCTE/MPEG channel numbers |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp
index 5954a25b1d..c9660aea66 100644
|
a
|
b
|
QString DVBLogicalChannelDescriptor::toString() const
|
| 597 | 597 | return ret; |
| 598 | 598 | } |
| 599 | 599 | |
| | 600 | QString DVBSimulcastChannelDescriptor::toString() const |
| | 601 | { |
| | 602 | QString ret = "DVBSimulcastChannelDescriptor sid->chan_num: "; |
| | 603 | for (uint i = 0; i < ChannelCount(); i++) |
| | 604 | { |
| | 605 | ret += QString("%1->%2").arg(ServiceID(i)).arg(ChannelNumber(i)); |
| | 606 | ret += (i+1<ChannelCount()) ? ", " : ""; |
| | 607 | } |
| | 608 | return ret; |
| | 609 | } |
| | 610 | |
| 600 | 611 | QString CAIdentifierDescriptor::toString(void) const |
| 601 | 612 | { |
| 602 | 613 | QString ret = QString("CAIdentifierDescriptor "); |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
index 50cb2d07a5..6650930ca4 100644
|
a
|
b
|
class DVBLogicalChannelDescriptor : public MPEGDescriptor
|
| 2071 | 2071 | QString toString(void) const override; // MPEGDescriptor |
| 2072 | 2072 | }; |
| 2073 | 2073 | |
| | 2074 | /** |
| | 2075 | * \brief DVB HD Simulcast Logical Channel Descriptor |
| | 2076 | * |
| | 2077 | * NIT descriptor ID 0x88 (Private Extension) |
| | 2078 | * |
| | 2079 | * Provides the Logical Channel Number (LCN) for each channel when the channel |
| | 2080 | * is simultaneously broadcast in SD and HD. |
| | 2081 | */ |
| | 2082 | class DVBSimulcastChannelDescriptor : public MPEGDescriptor |
| | 2083 | { |
| | 2084 | public: |
| | 2085 | DVBSimulcastChannelDescriptor(const unsigned char *data, int len = 300) : |
| | 2086 | MPEGDescriptor(data, len, PrivateDescriptorID::dvb_simulcast_channel_descriptor) { } |
| | 2087 | // Name bits loc expected value |
| | 2088 | // descriptor_tag 8 0.0 0x83 |
| | 2089 | // descriptor_length 8 1.0 |
| | 2090 | |
| | 2091 | uint ChannelCount(void) const { return DescriptorLength() >> 2; } |
| | 2092 | |
| | 2093 | uint ServiceID(uint i) const |
| | 2094 | { return (_data[2 + (i<<2)] << 8) | _data[3 + (i<<2)]; } |
| | 2095 | |
| | 2096 | uint ChannelNumber(uint i) const |
| | 2097 | { return ((_data[4 + (i<<2)] << 8) | _data[5 + (i<<2)]) & 0x3ff; } |
| | 2098 | |
| | 2099 | QString toString(void) const override; // MPEGDescriptor |
| | 2100 | }; |
| | 2101 | |
| 2074 | 2102 | // ETSI TS 102 323 (TV Anytime) |
| 2075 | 2103 | class DVBContentIdentifierDescriptor : public MPEGDescriptor |
| 2076 | 2104 | { |
diff --git a/mythtv/libs/libmythtv/mpeg/mpegdescriptors.cpp b/mythtv/libs/libmythtv/mpeg/mpegdescriptors.cpp
index 88563bc86d..e249feec8d 100644
|
a
|
b
|
QString MPEGDescriptor::toString() const
|
| 436 | 436 | /// POSSIBLY UNSAFE ! -- begin |
| 437 | 437 | else if (PrivateDescriptorID::dvb_logical_channel_descriptor == DescriptorTag()) |
| 438 | 438 | SET_STRING(DVBLogicalChannelDescriptor); |
| | 439 | else if (PrivateDescriptorID::dvb_simulcast_channel_descriptor == DescriptorTag()) |
| | 440 | SET_STRING(DVBSimulcastChannelDescriptor); |
| 439 | 441 | /// POSSIBLY UNSAFE ! -- end |
| 440 | 442 | else if (IsValid()) |
| 441 | 443 | { |
diff --git a/mythtv/libs/libmythtv/mpeg/mpegdescriptors.h b/mythtv/libs/libmythtv/mpeg/mpegdescriptors.h
index 2ae824572d..d5b75455b4 100644
|
a
|
b
|
class PrivateDescriptorID
|
| 182 | 182 | |
| 183 | 183 | // Private -- UK |
| 184 | 184 | dvb_logical_channel_descriptor = 0x83, /* implemented */ |
| | 185 | dvb_simulcast_channel_descriptor = 0x88, /* implemented */ |
| 185 | 186 | |
| 186 | 187 | // Private -- Dish Network |
| 187 | 188 | dish_event_rights = 0x87, |