Ticket #5530: csat-eit-20080723.diff
| File csat-eit-20080723.diff, 34.4 KB (added by , 17 years ago) |
|---|
-
trunk-work/mythtv/libs/libmythtv/libmythtv.pro
192 192 HEADERS += mpeg/iso6937tables.h 193 193 HEADERS += mpeg/tsstats.h mpeg/streamlisteners.h 194 194 HEADERS += mpeg/h264utils.h 195 HEADERS += mpeg/csatcaraibesdescriptors.h 196 HEADERS += mpeg/csatcaraibestables.h 197 HEADERS += mpeg/csatcaraibeseit.h 195 198 196 199 SOURCES += mpeg/tspacket.cpp mpeg/pespacket.cpp 197 200 SOURCES += mpeg/mpegtables.cpp mpeg/atsctables.cpp … … 205 208 SOURCES += mpeg/freesat_huffman.cpp 206 209 SOURCES += mpeg/iso6937tables.cpp 207 210 SOURCES += mpeg/h264utils.cpp 211 SOURCES += mpeg/csatcaraibesdescriptors.cpp 212 SOURCES += mpeg/csatcaraibestables.cpp 213 SOURCES += mpeg/csatcaraibeseit.cpp 208 214 209 215 DEFINES += USING_H264TOOLS 210 216 -
trunk-work/mythtv/libs/libmythtv/eithelper.cpp
20 20 #include "atsctables.h" 21 21 #include "dvbtables.h" 22 22 #include "premieretables.h" 23 #include "csatcaraibeseit.h" 23 24 #include "dishdescriptors.h" 24 25 #include "premieredescriptors.h" 25 26 #include "util.h" … … 513 514 } 514 515 } 515 516 517 // This function gets special eit data from the French provider 518 // Canal Satellite Caraibes. It probably applies to this provider 519 // in France. This EIT is available for all channels for 7-10 days 520 void EITHelper::AddEIT(CSatCaraibesEIT *cit) 521 { 522 QString title = QString::null; 523 QString subtitle = QString::null; 524 QString description = QString::null; 525 QString category = QString::null; 526 MythCategoryType category_type = kCategoryNone; 527 unsigned char subtitle_type=0, audio_props=0, video_props=0; 528 uint fix = fixup[ 601LL << 32 | 1 << 16 | 0 ] | EITFixUp::kFixGenericDVB; 529 if (!cit->IsReady()) { 530 VERBOSE(VB_EIT,LOC+"CSAT EIT NOT READY YET"); 531 return; 532 } 533 for (uint i = 0;i < cit->NbSchedules();i++) { 534 const CSatCaraibesSchedule& schedule = cit->GetSchedule(i); 535 QString title = schedule.title; 536 const vector<CSatCaraibesShowing>& showings = schedule.showings; 537 QMap<uint, QString>::const_iterator sum; 538 bool sum_available = false; 516 539 540 if (schedule.key) 541 { 542 /* If the summary is not there we go on with the next schedule */ 543 if (!(cit->GetSummary(i, sum))) continue; 544 sum_available = true; 545 } 546 for (vector<CSatCaraibesShowing>::const_iterator it = showings.begin(); 547 it != showings.end();it++) { 548 QDateTime starttime = (*it).Start; 549 // EITFixUp::TimeFix(starttime); 550 QDateTime endtime = starttime.addSecs(schedule.duration*60); 551 uint chanid; 552 DBEvent *event; 553 const CSatCaraibesChannelInfo& info = cit->GetChannelInfoFromIndex((*it).channel_index); 554 chanid = GetChanID(info.tsid,info.serviceid,info.orignetworkid); 555 VERBOSE(VB_EIT, LOC + 556 QString("CSATCARAIBES EIT for NIT %1, TID %2, SID %3, " 557 "T: %4, Start: %5, Dur: %6 Thm: %7, summ: %8") 558 .arg(info.orignetworkid).arg(info.tsid).arg(info.serviceid) 559 .arg(title).arg(starttime.toString()).arg(schedule.duration) 560 .arg(schedule.theme).arg((sum_available ? *sum :"No summary"))); 561 562 if (!chanid) 563 { 564 VERBOSE(VB_EIT, LOC + 565 QString("CSATCARAIBES EIT for NIT %1, TID %2, SID %3, " 566 "title: %4. Channel not found!") 567 .arg(info.orignetworkid).arg(info.tsid).arg(info.serviceid) 568 .arg(title)); 569 continue; 570 } 571 572 event = new DBEvent(chanid, 573 title, QString::null, sum_available ? (*sum).value():"", 574 category, category_type, 575 starttime, endtime, fix, 576 subtitle_type, 577 audio_props, 578 video_props, 579 "", ""); 580 db_events.enqueue(event);*/ 581 } 582 } 583 } 584 517 585 void EITHelper::PruneEITCache(uint timestamp) 518 586 { 519 587 eitcache->PruneOldEntries(timestamp); … … 856 924 fix[ 1094LL << 32 | 1 << 16 | 17028 ] = // NT1 857 925 fix[ 1100LL << 32 | 1 << 16 | 8710 ] = // NRJ 12 858 926 EITFixUp::kEFixForceISO8859_15; 927 928 // IntelSat 903 DVB-S french channels (CanalSat Caraibes) 929 // The original network id is the same as the previous one 930 // at least transport ids are different 931 // For now all channels are marked as needing fixup 932 fix[ 601LL << 32 | 1 << 16 | 0 ] = 933 fix[ 602LL << 32 | 1 << 16 | 0 ] = 934 fix[ 603LL << 32 | 1 << 16 | 0 ] = 935 fix[ 604LL << 32 | 1 << 16 | 0 ] = 936 EITFixUp::kEFixForceISO8859_15; 859 937 } 860 938 861 939 static int calc_eit_utc_offset(void) -
trunk-work/mythtv/libs/libmythtv/eithelper.h
53 53 class ExtendedTextTable; 54 54 class DVBEventInformationTable; 55 55 class PremiereContentInformationTable; 56 class CSatCaraibesEIT; 56 57 57 58 class EITHelper 58 59 { … … 77 78 const ExtendedTextTable *ett); 78 79 void AddEIT(const DVBEventInformationTable *eit); 79 80 void AddEIT(const PremiereContentInformationTable *eit); 81 void AddEIT(CSatCaraibesEIT *eit); 80 82 #else // if !USING_BACKEND 81 83 void AddEIT(uint, uint, const EventInformationTable*) {} 82 84 void AddETT(uint, uint, const ExtendedTextTable*) {} 83 85 void AddEIT(const DVBEventInformationTable*) {} 84 86 void AddEIT(const PremiereContentInformationTable*) {} 87 void AddEIT(CSatCaraibesEIT *eit) {} 85 88 #endif // !USING_BACKEND 86 89 87 90 // EIT cache handling -
trunk-work/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
678 679 return false; 679 680 return PMTSectionSeen(psip.TableIDExtension(), psip.Section()); 680 681 } 681 682 /* FIXME: Shoud do something for BAT also, we need only one 683 and I dont think they change that much */ 682 684 return false; 683 685 } 684 686 … … 879 881 DONE_WITH_PES_PACKET(); 880 882 } 881 883 882 if (!psip->IsCurrent()) // we don't cache the next table, for now 884 if (!psip->IsCurrent()) 885 { 886 /* Canal Sat Caraibes: BAT tables have the next flag 887 Process it instead if 888 */ 889 if (TableID::BAT == psip->TableID()) 890 HandleTables(tspacket->PID(), *psip); 891 // we don't cache the next table, for now 883 892 DONE_WITH_PES_PACKET(); 893 } 884 894 885 895 if (tspacket->ScramplingControl()) 886 896 { // scrambled! ATSC, DVB require tables not to be scrambled … … 889 899 DONE_WITH_PES_PACKET(); 890 900 } 891 901 892 if (!psip->VerifyPSIP(!_have_CRC_bug ))902 if (!psip->VerifyPSIP(!_have_CRC_bug && psip->HasCRC())) 893 903 { 894 VERBOSE(VB_RECORD, "PSIP table is invalid"); 904 VERBOSE(VB_RECORD, QString("PSIP table %1 (pid %2) is invalid") 905 .arg(psip->TableID()).arg(tspacket->PID())); 895 906 DONE_WITH_PES_PACKET(); 896 907 } 897 908 -
trunk-work/mythtv/libs/libmythtv/mpeg/dvbtables.cpp
148 148 return false; 149 149 } 150 150 151 void BouquetAssociationTable::Parse(void) 152 { 153 const unsigned char * p = pesdata() + 8; 154 uint len; 155 int looplen; 156 desc_list_t desc; 157 158 len = ((p[0] & 0x0F) << 8) + p[1]; // Name descriptor length 159 p += 2; 160 VERBOSE(VB_SIPARSER,"RAW:"<< p[0] << " "<< p[1]<<" "<<p[2]<< " "<<p[3]<< "<>BqtName desc len "<< len << QString::fromLatin1((const char*)(p+2),p[1])); 161 desc = MPEGDescriptor::ParseOnlyInclude(p, len, DescriptorID::bouquet_name); 162 if (desc.empty()) 163 VERBOSE(VB_SIPARSER,"Curious: BAT without bouquet name!"); 164 else 165 bouquet_name = QString::fromLatin1((const char*)(desc[0]+2), 166 MPEGDescriptor(desc[0]).DescriptorLength()); 167 p += len; 168 looplen = ((p[0] & 0x0F) << 8) + p[1]; 169 p += 2; // Now point on first TS desc 170 while (looplen > 0) { 171 _ptrs.push_back(p); // Add first TS position 172 VERBOSE(VB_SIPARSER,"TS/NetID" << (p[0]*256+p[1]) << "/" 173 << (p[2]*256+p[3])<<" looplen "<< looplen); 174 p += 4; // Skip TS and network ID 175 len = ((p[0] & 0x0F) << 8) + p[1]; // Get length of descriptors 176 p += 2 + len; // Skip all descriptors 177 looplen -= 6 + len; 178 } 179 } 180 151 181 void DVBEventInformationTable::Parse(void) const 152 182 { 153 183 _ptrs.clear(); … … 177 207 // Dish Network Long Term Future Event Information for all transports 178 208 is_eit |= (TableID::DN_EITbego <= table_id && 179 209 TableID::DN_EITendo >= table_id); 210 // Canal Satellite long term EIT for all transports 211 is_eit |= (table_id == TableID::CSATCARAIBES_CHANNELS || 212 table_id == TableID::CSATCARAIBES_THEMES || 213 table_id == TableID::CSATCARAIBES_SCHED || 214 table_id == TableID::CSATCARAIBES_SUMMARIES); 180 215 181 216 return is_eit; 182 217 } -
trunk-work/mythtv/libs/libmythtv/mpeg/csatcaraibesdescriptors.h
1 // -*- Mode: c++ -*- 2 #ifndef _CSATCAR_DESCRIPTORS_H_ 3 #define _CSATCAR_DESCRIPTORS_H_ 4 5 #include <stdint.h> 6 #include <inttypes.h> 7 8 #include <qstring.h> 9 #include <qdatetime.h> 10 11 #include "dvbdescriptors.h" 12 13 class CSatCaraibesChannelsDescriptor : public MPEGDescriptor 14 { 15 public: 16 CSatCaraibesChannelsDescriptor(const unsigned char* data) : MPEGDescriptor(data) 17 { 18 assert(DescriptorID::csat_channels_ind == DescriptorTag()); 19 Parse(); 20 } 21 22 void Parse(void); 23 const QMap<uint,uint>& GetIndexes() const 24 { 25 return channels_indexes; 26 } 27 28 private: 29 /* Maps a Program ID to an index used by the EIT */ 30 QMap<uint,uint> channels_indexes; 31 }; 32 33 #endif // _CSATCAR_DESCRIPTORS_H_ -
trunk-work/mythtv/libs/libmythtv/mpeg/pespacket.cpp
17 17 18 18 using namespace std; 19 19 20 bool PESPacket::HasCRC(void) const 21 { 22 /* CRC bit is placed differently for the packet of private type */ 23 if ((StreamID()>=0x80) && (StreamID()<=0xFF)) 24 return (_pesdata[1] & 0x80) >> 7; 25 else return (_pesdata[4] & 0x2) >> 1; 26 } 27 20 28 // return true if complete or broken 21 29 bool PESPacket::AddTSPacket(const TSPacket* packet, bool &broken) 22 30 { -
trunk-work/mythtv/libs/libmythtv/mpeg/csatcaraibestables.cpp
1 #include "csatcaraibesdescriptors.h" 2 #include "csatcaraibestables.h" 3 4 /******************* Schedule ******************************/ 5 6 void CSatCaraibesScheduleTable::Parse() 7 { 8 uint nb_titles, i; 9 unsigned char * pos; 10 11 /* Skip section length */ 12 nb_titles = psipdata()[1]; 13 pos = psipdata() + 2; 14 for (i = 0;i < nb_titles;i++) { 15 _ptrs.push_back(pos); 16 /* Skip titles */ 17 pos += pos[0] + 1; 18 /* Skip 4 bytes per showing */ 19 pos += ((pos[0] & 0x70) >> 4) * 4 + 3; 20 } 21 } 22 23 /******************* Summaries *******************************/ 24 25 uint CSatCaraibesSummaryTable::TitleKey() const 26 { 27 uint sched_off = (pesdata()[3] &0x0F)*256+pesdata()[4]; 28 uint sched_sect = pesdata()[8]; 29 return (sched_off + (sched_sect << 12)); 30 } 31 32 /******************* Themes **************************/ 33 34 void CSatCaraibesThemesTable::Parse(void) 35 { 36 const unsigned char * p = pesdata() + 0x10C; 37 for (int i = 0x0C;i < 0x100;i += 0x10) 38 { 39 _ptrs.push_back((const char *)p); 40 VERBOSE(VB_EIT,QString("Theme raw: %1 %2 %3 %4").arg(p[0]).arg(p[1]).arg(p[2]).arg(p[3])); 41 /* Add length of the current title */ 42 p += pesdata()[i] & 0x7F; 43 } 44 } 45 46 uint CSatCaraibesThemesTable::GetThemeLength(uint i) const 47 { 48 return (pesdata()[0x0C + i*0x10] & 0x7F); 49 } -
trunk-work/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
6 6 #include "dvbstreamdata.h" 7 7 #include "dvbtables.h" 8 8 #include "premieretables.h" 9 #include "csatcaraibestables.h" 10 #include "csatcaraibeseit.h" 9 11 #include "eithelper.h" 10 12 11 13 #define PREMIERE_ONID 133 … … 17 19 : MPEGStreamData(desired_program, cacheTables), 18 20 _desired_netid(desired_netid), _desired_tsid(desired_tsid), 19 21 _dvb_eit_dishnet_long(false), 22 _dvb_eit_csatcaraibes(true), 20 23 _nit_version(-2), _nito_version(-2) 21 24 { 22 25 SetVersionNIT(-1,0); … … 243 246 244 247 return true; 245 248 } 249 case TableID::BAT: 250 { 251 BouquetAssociationTable bat(psip); 252 /* For now we use the BAT only for Canal Satellite 253 * Caraibes (French provider) 254 */ 255 if (bat.BouquetName()=="CanalSatellite Caraibes") { 256 VERBOSE(VB_SIPARSER,"Bat processed to get channels info, CanalSat Caraibes"); 257 _csat_eit.AddChannelsInfo(&bat); 258 } 259 else VERBOSE(VB_SIPARSER,"BAT but not from canalsat"); 260 return true; 261 } 246 262 case TableID::SDT: 247 263 { 248 264 uint tsid = psip.TableIDExtension(); … … 369 385 370 386 return true; 371 387 } 372 388 389 /* FIXME: Do not hardcode transport here */ 390 if ((_desired_tsid == 601) && (CSATCARAIBES_EIT_PID1 == pid)) { 391 switch (psip.TableID()) 392 { 393 case TableID::CSATCARAIBES_THEMES: 394 if (_csat_eit.HasThemes()) return true; 395 else 396 { 397 CSatCaraibesThemesTable themes(psip); 398 _csat_eit.AddThemes(themes); 399 } 400 break; 401 case TableID::CSATCARAIBES_SCHED: 402 if (_csat_eit.HasSeenAllSchedules()) return true; 403 else 404 { 405 CSatCaraibesScheduleTable sched(psip); 406 _csat_eit.AddSchedules(sched); 407 } 408 break; 409 case TableID::CSATCARAIBES_SUMMARIES: 410 { 411 CSatCaraibesSummaryTable summary(psip); 412 if (!(summary.IsValid())) return false; 413 _csat_eit.AddSummary(summary); 414 break; 415 } 416 default: 417 return false; 418 } 419 if (_eit_helper) 420 _eit_helper->AddEIT(&_csat_eit); 421 } 373 422 return false; 374 423 } 375 424 … … 392 441 QMutexLocker locker(&_listener_lock); 393 442 bool want_eit = (_eit_rate >= 0.5f) && HasAnyEIT(); 394 443 bool has_eit = in_use_pids.size(); 395 return want_eit != has_eit; 444 445 return ((_desired_tsid == 601) || (want_eit != has_eit)); 446 // return want_eit != has_eit; 396 447 } 397 448 398 449 bool DVBStreamData::GetEITPIDChanges(const uint_vec_t &cur_pids, … … 410 463 } 411 464 412 465 if (_dvb_eit_dishnet_long && 413 find(cur_pids.begin(), cur_pids.end(),414 (uint) DVB_DNLONG_EIT_PID) == cur_pids.end())466 (find(cur_pids.begin(), cur_pids.end(), 467 (uint) DVB_DNLONG_EIT_PID) == cur_pids.end())) 415 468 { 416 469 add_pids.push_back(DVB_DNLONG_EIT_PID); 417 470 } 418 471 472 /* FIXME: Avoid hardcoding the good transport here */ 473 if (_dvb_eit_csatcaraibes /*&& (_desired_tsid == 601)*/ && 474 (find(cur_pids.begin(), cur_pids.end(), 475 (uint) CSATCARAIBES_EIT_PID1) == cur_pids.end())) 476 { 477 add_pids.push_back(CSATCARAIBES_EIT_PID1); 478 // VERBOSE(VB_EIT,"Added CSAT PID!"); 479 } 480 419 481 if (_desired_netid == PREMIERE_ONID && 420 482 find(cur_pids.begin(), cur_pids.end(), 421 483 (uint) PREMIERE_EIT_DIREKT_PID) == cur_pids.end()) … … 451 513 del_pids.push_back(DVB_DNLONG_EIT_PID); 452 514 } 453 515 516 if (_dvb_eit_csatcaraibes && 517 (find(cur_pids.begin(), cur_pids.end(), 518 (uint) CSATCARAIBES_EIT_PID1) /*!=*/ == cur_pids.end())) 519 { 520 VERBOSE(VB_EIT,"Deleted CSAT PID!"); 521 add_pids.push_back(CSATCARAIBES_EIT_PID1); 522 } 454 523 if (_desired_netid == PREMIERE_ONID && 455 524 find(cur_pids.begin(), cur_pids.end(), 456 525 (uint) PREMIERE_EIT_DIREKT_PID) != cur_pids.end()) -
trunk-work/mythtv/libs/libmythtv/mpeg/mpegtables.h
191 191 PREMIERE_EIT_DIREKT_PID = 0x0b11, 192 192 PREMIERE_EIT_SPORT_PID = 0x0b12, 193 193 194 // Canal Sat longterm EIT is on pid 0x114 and 0x153 195 CSATCARAIBES_EIT_PID1 = 0x114, 196 // CSATCARAIBES_EIT_PID2 = 0x153, 197 194 198 ATSC_PSIP_PID = 0x1ffb, 195 199 }; 196 200 … … 241 245 DN_EITbego = 0x80, // always on pid 0x300 242 246 DN_EITendo = 0xfe, // always on pid 0x300 243 247 248 // Canal Sat Caraibes Longterm EIT data 249 CSATCARAIBES_CHANNELS = 0x90, // always on pid 0x114 250 CSATCARAIBES_SCHED = 0x92, // always on pid 0x114 251 CSATCARAIBES_SUMMARIES = 0x94, //always on pid 0x114 252 CSATCARAIBES_THEMES = 0x91, //always on pid 0x114 253 244 254 // ARIB 245 255 ARIBbeg = 0x80, 246 256 ARIBend = 0x8f, -
trunk-work/mythtv/libs/libmythtv/mpeg/streamlisteners.h
31 31 class DirectedChannelChangeSelectionCodeTable; 32 32 33 33 class NetworkInformationTable; 34 class BouquetAssociationTable; 34 35 class ServiceDescriptionTable; 35 36 class TimeDateTable; 36 37 class DVBEventInformationTable; … … 143 144 public: 144 145 virtual void HandleEIT(const DVBEventInformationTable*) = 0; 145 146 virtual void HandleEIT(const PremiereContentInformationTable*) = 0; 147 virtual void HandleBAT(const BouquetAssociationTable*) = 0; 146 148 }; 147 149 148 150 -
trunk-work/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
1812 1812 QString toString() const { return QString("DVBContentIdentifierDescriptor(stub)"); } 1813 1813 }; 1814 1814 1815 /* Used by Canal+ (French Sat provider) in the BAT 1816 For Canal+: data is 4 bytes, equal to 0x000000C0 1817 */ 1818 class DVBPrivateDataSpecifierDescriptor : public MPEGDescriptor 1819 { 1820 public: 1821 DVBPrivateDataSpecifierDescriptor(const unsigned char * data) : MPEGDescriptor(data) 1822 { 1823 assert(DescriptorID::private_data_specifier == DescriptorTag()); 1824 } 1825 }; 1815 1826 1816 1827 #endif -
trunk-work/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h
113 113 // Listening 114 114 virtual void AddListeningPID( 115 115 uint pid, PIDPriority priority = kPIDPriorityNormal) 116 { _pids_listening[pid] = priority; }116 { _pids_listening[pid] = priority; VERBOSE(VB_RECORD,QString("Added %1 pid").arg(pid));} 117 117 virtual void AddNotListeningPID(uint pid) 118 118 { _pids_notlistening[pid] = kPIDPriorityNormal; } 119 119 virtual void AddWritingPID( -
trunk-work/mythtv/libs/libmythtv/mpeg/csatcaraibesdescriptors.cpp
1 #include "mpegdescriptors.h" 2 #include "csatcaraibesdescriptors.h" 3 4 /****************** Schedule *******************************/ 5 6 void CSatCaraibesChannelsDescriptor::Parse(void) 7 { 8 const unsigned char * p = _data+2; 9 10 for (uint i = DescriptorLength();i >= 4;) 11 { 12 uint key = (p[0] << 8) + p[1]; 13 /* MSBit of LSByte seems to be 1 when it is a radio 14 * and MSByte seems to be 0 always 15 */ 16 17 uint index = (p[2] << 8) + p[3]; 18 channels_indexes.insert(key, index); 19 i -= 4; 20 p += 4; 21 VERBOSE(VB_SIPARSER,"Channel "<<key<<" index "<<index); 22 } 23 } -
trunk-work/mythtv/libs/libmythtv/mpeg/dvbtables.h
164 164 mutable vector<const unsigned char*> _ptrs; // used to parse 165 165 }; 166 166 167 /** \class BouquetAssociationTable 168 * \brief Tells what channels can be found on each transponder 169 * for one bouquet (a bunch of channels from one provider) 170 * Note: French Provider Canal+ uses this to associate channels 171 * with an index used in their proprietary EIT 172 */ 173 174 class BouquetAssociationTable : public PSIPTable 175 { 176 public: 177 BouquetAssociationTable(const PSIPTable& table) : PSIPTable(table) 178 { 179 assert(TableID::BAT == TableID()); 180 Parse(); 181 } 182 ~BouquetAssociationTable() { ; } 183 184 // table_id 8 0.0 0x4a 185 // section_syntax_indicator 1 1.0 1 186 // reserved_future_use 1 1.1 1 187 // reserved 2 1.2 3 188 // section_length 12 1.4 0 189 // Bouquet ID 16 3.0 0 190 // reserved 2 5.0 3 191 // version_number 5 5.2 0 192 // current_next_indicator 1 5.7 1 193 // section_number 8 6.0 0x00 194 // last_section_number 8 7.0 0x00 195 // reserved 4 8 0x0d 196 // Bouquet descriptors len 12 8.4 197 // for (i=0;i<N;i++) 198 // Descriptor(); 199 // reserved 4 10+N.0 200 // Transport stream loop len 12 201 // for (i=0;i<N;i++) { 202 // transport_stream_id 16 203 // original_network_id 16 204 // reserved 4 205 // transport descriptor len 12 206 // for (j=0;j<N;j++) 207 // Descriptor(); 208 // } 209 // crc 32 210 uint TSID(uint i) const 211 { return (_ptrs[i][0] << 8) + _ptrs[i][1]; } 212 213 /// original_network_id 16 8.0 214 uint OriginalNetworkID(uint i) const 215 { return (_ptrs[i][2] << 8) + _ptrs[i][3]; } 216 217 /* Returns a pointer to the first descriptor following 218 the TS and Network ID, and the loop length */ 219 const unsigned char * TransportDescriptors(uint i) const 220 { return _ptrs[i]+6; } 221 uint TransportDescriptorsLength(uint i) const 222 { return ((_ptrs[i][4] &0x0F)<< 8) + _ptrs[i][5]; } 223 void Parse(void); 224 uint NBTransports() const 225 { 226 return _ptrs.size(); 227 } 228 QString BouquetName() const 229 { return bouquet_name; } 230 231 private: 232 /* point on the transport descriptors */ 233 mutable vector<const unsigned char*> _ptrs; 234 mutable QString bouquet_name; 235 }; 236 167 237 class DiscontinuityInformationTable : public PSIPTable 168 238 { 169 239 DiscontinuityInformationTable(const PSIPTable& table) : PSIPTable(table) -
trunk-work/mythtv/libs/libmythtv/mpeg/mpegdescriptors.h
124 124 // ATSC 125 125 atsc_stuffing = 0x80, 126 126 audio_stream = 0x81, 127 /* Seems to be used also for user-defined 128 For CanalSat Caraibes this is used in 129 the BAT to provide channel indexes */ 130 csat_channels_ind = 0x81, 127 131 caption_service = 0x86, 128 132 content_advisory = 0x87, 129 133 -
trunk-work/mythtv/libs/libmythtv/mpeg/mpegtables.cpp
154 154 { 155 155 has_crc = true; 156 156 } 157 // Canal Satellite Caraibes EIT 158 if ((TableID() == TableID::CSATCARAIBES_THEMES) || 159 (TableID() == TableID::CSATCARAIBES_SUMMARIES)) 160 { 161 VERBOSE(VB_SIPARSER,QString("No crc for ID %1").arg(TableID())); 162 has_crc = false; 163 } 164 else if (TableID() == TableID::CSATCARAIBES_SCHED) 165 { 166 VERBOSE(VB_SIPARSER,QString("Crc for ID %1").arg(TableID())); 167 } 157 168 } 158 169 break; 159 170 } -
trunk-work/mythtv/libs/libmythtv/mpeg/pespacket.h
183 183 /// 1 bit Additional Copy Info field is present 184 184 bool HasACI() const { return (_pesdata[4] & 0x4) >> 2; } 185 185 /// 1 bit Cyclic Redundancy Check present 186 virtual bool HasCRC() const { return (_pesdata[4] & 0x2) >> 1; }186 virtual bool HasCRC() const; 187 187 /// 1 bit Extension flags are present 188 188 bool HasExtensionFlags() const { return _pesdata[4] & 0x1; } 189 189 -
trunk-work/mythtv/libs/libmythtv/mpeg/csatcaraibestables.h
1 // -*- Mode: c++ -*- 2 #ifndef _CSATCARAIBES_TABLES_H_ 3 #define _CSATCARAIBES_TABLES_H_ 4 5 #include <qstring.h> 6 #include <stdint.h> // uint32_t 7 #include "mpegtables.h" 8 #include "dvbtables.h" 9 10 class CSatCaraibesScheduleTable : public PSIPTable 11 { 12 public: 13 CSatCaraibesScheduleTable(const PSIPTable& table) : PSIPTable(table) 14 { 15 Parse(); 16 } 17 18 void Parse(); 19 bool IsValid() { 20 return TableID()==TableID::CSATCARAIBES_SCHED; 21 } 22 /* Returns a pointer on the Title: first byte is length, following 23 bytes are the string itself */ 24 const unsigned char * GetTitle(uint i) const 25 { 26 return _ptrs[i]; 27 } 28 bool ScheduleHasSummary(uint i) const 29 { 30 const unsigned char * p = AfterTitle(i); 31 return (*p & 0x80) >> 7; 32 } 33 uint GetNbShowings(uint i) const 34 { 35 const unsigned char * p = AfterTitle(i); 36 return (*p & 0x70) >> 4; 37 } 38 const unsigned char * GetShowings(uint i) const 39 { 40 return AfterTitle(i) + 3; 41 } 42 uint GetDuration(uint i) const 43 { 44 const unsigned char * p = AfterTitle(i); 45 return ( (p[0] & 0x0F)*256 + p[1] ) * 60; 46 } 47 uint GetTheme(uint i) const 48 { 49 const unsigned char * p = AfterTitle(i); 50 return (p[2] & 0xF0) >> 4; 51 } 52 uint GetKey(uint i) const 53 { 54 return Section() << 12 + (_ptrs[i]-pesdata()); 55 } 56 uint NbSchedules() const 57 { 58 return _ptrs.size(); 59 } 60 /* Numbered from 0 */ 61 const unsigned char * GetSchedule(uint i) const 62 { 63 return _ptrs[i]; 64 } 65 66 private: 67 const unsigned char * AfterTitle(uint i) const 68 { 69 return _ptrs[i] + _ptrs[i][0] + 1; 70 } 71 72 mutable vector<const unsigned char *> _ptrs; 73 }; 74 75 class CSatCaraibesSummaryTable : public PSIPTable 76 { 77 public: 78 CSatCaraibesSummaryTable(const PSIPTable & table) : PSIPTable(table) 79 { 80 } 81 82 bool IsValid() { 83 return TableID()==TableID::CSATCARAIBES_SUMMARIES; 84 } 85 uint TitleKey() const; 86 uint GetLength() const 87 { 88 return pesdata()[11]-6; 89 } 90 const char * SummaryString(void) const 91 { 92 return (const char*)(pesdata()+18); 93 } 94 bool DotsToAppend(void) const 95 { 96 return pesdata()[12 + GetLength() - 1] == 0x85; 97 } 98 }; 99 100 class CSatCaraibesThemesTable : public PSIPTable 101 { 102 public: 103 CSatCaraibesThemesTable(const PSIPTable & table) : PSIPTable(table) 104 { 105 Parse(); 106 } 107 108 void Parse(void); 109 uint NbThemes(void) const 110 { 111 return _ptrs.size(); 112 } 113 const char * GetTheme(uint i) const 114 { 115 return _ptrs[i]; 116 } 117 /* Can be zero, just discard this theme */ 118 uint GetThemeLength(uint i) const; 119 private: 120 mutable vector<const char *> _ptrs; 121 }; 122 123 #endif // _CSATCARAIBES_TABLES_H_ -
trunk-work/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h
4 4 #define DVBSTREAMDATA_H_ 5 5 6 6 #include "mpegstreamdata.h" 7 #include "csatcaraibeseit.h" 7 8 9 8 10 typedef NetworkInformationTable* nit_ptr_t; 9 11 typedef vector<const NetworkInformationTable*> nit_vec_t; 10 12 typedef QMap<uint, nit_ptr_t> nit_cache_t; // section->sdts … … 195 197 bool _dvb_eit_dishnet_long; 196 198 /// Tell us if the DVB service has EIT 197 199 dvb_has_eit_t _dvb_has_eit; 200 /// true means use the proprietary eit from 201 /// French provider Canal Satellite Caraibes 202 bool _dvb_eit_csatcaraibes; 198 203 199 204 // Signals 200 205 dvb_main_listener_vec_t _dvb_main_listeners; … … 211 216 // Premiere private ContentInformationTable 212 217 QMap<uint, int> _cit_version; 213 218 sections_map_t _cit_section_seen; 214 219 /// Canal Satellite (French provider) 220 CSatCaraibesEIT _csat_eit; 215 221 int _nito_version; 216 222 QMap<uint, int> _sdto_versions; 217 223 sections_t _nito_section_seen; -
trunk-work/mythtv/libs/libmythtv/dvbstreamhandler.cpp
483 483 QMap<PIDPriority, pid_list_t> priority_queue; 484 484 QMap<PIDPriority, uint> priority_open_cnt; 485 485 486 VERBOSE(VB_RECORD,"Cycling filters"); 486 487 PIDInfoMap::const_iterator cit = _pid_info.begin(); 487 488 for (; cit != _pid_info.end(); ++cit) 488 489 { … … 890 891 // NOTE: In theory this will break with ATSC when pid 0x11 891 892 // is used for random ATSC tables. In practice only 892 893 // video data has been seen on 0x11. 893 sctFilterParams.filter.filter[0] = 0x02; 894 sctFilterParams.filter.mask[0] = 0xbb; 894 // Changed to get BAT (CSAT CARAIBES): 0x4A 895 sctFilterParams.filter.filter[0] = 0x00/*0x02*/; 896 sctFilterParams.filter.mask[0] = 0x00/*0xb3*/; 895 897 break; 896 898 case 0x1ffb: // assume this is for various ATSC tables 897 899 // MGT 0xC7, Terrestrial VCT 0xC8, Cable VCT 0xC9, RRT 0xCA, -
trunk-work/mythtv/libs/libmythtv/dtvsignalmonitor.h
100 100 void HandleTDT(const TimeDateTable*); 101 101 void HandleNIT(const NetworkInformationTable*); 102 102 void HandleSDT(uint, const ServiceDescriptionTable*); 103 void HandleBAT(const BouquetAssociationTable*); 103 104 104 105 void IgnoreEncrypted(bool ignore) { ignore_encrypted = ignore; } 105 106 -
trunk-work/mythtv/libs/libmythtv/dtvsignalmonitor.cpp
469 469 AddFlags(kDTVSigMon_CryptMatch); 470 470 } 471 471 472 void DTVSignalMonitor::HandleBAT(const BouquetAssociationTable * bat) 473 { 474 VERBOSE(VB_SIPARSER,"BAT detected"); 475 476 } 477 472 478 ATSCStreamData *DTVSignalMonitor::GetATSCStreamData() 473 479 { 474 480 return dynamic_cast<ATSCStreamData*>(stream_data);
