MythTV  0.28pre
eithelper.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 // Std C++ headers
4 #include <algorithm>
5 using namespace std;
6 
7 // MythTV includes
8 #include "eithelper.h"
9 #include "eitfixup.h"
10 #include "eitcache.h"
11 #include "mythdb.h"
12 #include "atsctables.h"
13 #include "dvbtables.h"
14 #include "premieretables.h"
15 #include "dishdescriptors.h"
16 #include "premieredescriptors.h"
17 #include "channelutil.h" // for ChannelUtil
18 #include "mythdate.h"
19 #include "programdata.h"
20 #include "programinfo.h" // for subtitle types and audio and video properties
21 #include "scheduledrecording.h" // for ScheduledRecording
22 #include "compat.h" // for gmtime_r on windows.
23 
24 const uint EITHelper::kChunkSize = 20;
26 
27 static uint get_chan_id_from_db_atsc(uint sourceid,
28  uint atscmajor, uint atscminor);
29 static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid,
30  uint networkid, uint transportid);
31 static uint get_chan_id_from_db_dtv(uint sourceid,
32  uint programnumber, uint tunedchanid);
33 static void init_fixup(FixupMap &fix);
34 
35 #define LOC QString("EITHelper: ")
36 
38  eitfixup(new EITFixUp()),
39  gps_offset(-1 * GPS_LEAP_SECONDS),
40  sourceid(0), channelid(0),
41  maxStarttime(QDateTime()), seenEITother(false)
42 {
44 }
45 
47 {
48  QMutexLocker locker(&eitList_lock);
49  while (db_events.size())
50  delete db_events.dequeue();
51 
52  delete eitfixup;
53 }
54 
56 {
57  QMutexLocker locker(&eitList_lock);
58  return db_events.size();
59 }
60 
67 {
68  QMutexLocker locker(&eitList_lock);
69  uint insertCount = 0;
70 
71  if (db_events.empty())
72  return 0;
73 
75  for (uint i = 0; (i < kChunkSize) && (db_events.size() > 0); i++)
76  {
77  DBEventEIT *event = db_events.dequeue();
78  eitList_lock.unlock();
79 
80  eitfixup->Fix(*event);
81 
82  insertCount += event->UpdateDB(query, 1000);
83  maxStarttime = max (maxStarttime, event->starttime);
84 
85  delete event;
86  eitList_lock.lock();
87  }
88 
89  if (!insertCount)
90  return 0;
91 
92  if (incomplete_events.size() || unmatched_etts.size())
93  {
94  LOG(VB_EIT, LOG_INFO,
95  LOC + QString("Added %1 events -- complete(%2) "
96  "incomplete(%3) unmatched(%4)")
97  .arg(insertCount).arg(db_events.size())
98  .arg(incomplete_events.size()).arg(unmatched_etts.size()));
99  }
100  else
101  {
102  LOG(VB_EIT, LOG_INFO,
103  LOC + QString("Added %1 events").arg(insertCount));
104  }
105 
106  return insertCount;
107 }
108 
109 void EITHelper::SetFixup(uint atsc_major, uint atsc_minor, FixupValue eitfixup)
110 {
111  QMutexLocker locker(&eitList_lock);
112  FixupKey atsc_key = (atsc_major << 16) | atsc_minor;
113  fixup[atsc_key] = eitfixup;
114 }
115 
116 void EITHelper::SetLanguagePreferences(const QStringList &langPref)
117 {
118  QMutexLocker locker(&eitList_lock);
119 
120  uint priority = 1;
121  QStringList::const_iterator it;
122  for (it = langPref.begin(); it != langPref.end(); ++it)
123  {
124  if (!(*it).isEmpty())
125  {
126  uint language_key = iso639_str3_to_key(*it);
127  uint canonoical_key = iso639_key_to_canonical_key(language_key);
128  languagePreferences[canonoical_key] = priority++;
129  }
130  }
131 }
132 
134 {
135  QMutexLocker locker(&eitList_lock);
136  sourceid = _sourceid;
137 }
138 
140 {
141  QMutexLocker locker(&eitList_lock);
142  channelid = _channelid;
143 }
144 
145 void EITHelper::AddEIT(uint atsc_major, uint atsc_minor,
146  const EventInformationTable *eit)
147 {
148  uint atsc_key = (atsc_major << 16) | atsc_minor;
149  EventIDToATSCEvent &events = incomplete_events[atsc_key];
150  EventIDToETT &etts = unmatched_etts[atsc_key];
151 
152  for (uint i = 0; i < eit->EventCount(); i++)
153  {
154  ATSCEvent ev(eit->StartTimeRaw(i), eit->LengthInSeconds(i),
155  eit->ETMLocation(i),
157  eit->Descriptors(i), eit->DescriptorsLength(i));
158 
159  // Look to see if there has been a recent ett message with the same event id.
160  EventIDToETT::iterator it = etts.find(eit->EventID(i));
161  QString ett_text = QString::null;
162  bool found_matching_ett = false;
163  if (it != etts.end())
164  {
165  // Don't use an ett description if it was scanned long in the past.
166  if (!it->IsStale()) {
167  ett_text = it->ett_text;
168  found_matching_ett = true;
169  }
170  etts.erase(it);
171  }
172 
173  // Create an event immediately if a matching ett description was found,
174  // or if item is false, indicating that no ett description should be
175  // expected.
176  if (found_matching_ett || !ev.etm)
177  {
178  CompleteEvent(atsc_major, atsc_minor, ev, ett_text);
179  }
180  else
181  {
182  unsigned char *tmp = new unsigned char[ev.desc_length];
183  memcpy(tmp, eit->Descriptors(i), ev.desc_length);
184  ev.desc = tmp;
185  events.insert(eit->EventID(i), ev);
186  }
187  }
188 }
189 
190 void EITHelper::AddETT(uint atsc_major, uint atsc_minor,
191  const ExtendedTextTable *ett)
192 {
193  uint atsc_key = (atsc_major << 16) | atsc_minor;
194  // Try to match up the ett with an eit event.
195  ATSCSRCToEvents::iterator eits_it = incomplete_events.find(atsc_key);
196  if (eits_it != incomplete_events.end())
197  {
198  EventIDToATSCEvent::iterator it = (*eits_it).find(ett->EventID());
199  if (it != (*eits_it).end())
200  {
201  bool completed_event = false;
202  // Only consider eit events from the recent past.
203  if (!it->IsStale()) {
204  completed_event = true;
206  atsc_major, atsc_minor, *it,
208  }
209 
210  if ((*it).desc)
211  delete [] (*it).desc;
212 
213  (*eits_it).erase(it);
214 
215  if (completed_event) return;
216  }
217  }
218 
219  // Report if an unmatched ett was previously noted and overwrite it.
220  // See also https://code.mythtv.org/trac/ticket/11739
221  EventIDToETT &elist = unmatched_etts[atsc_key];
222  EventIDToETT::iterator existing_unmatched_ett_it =
223  elist.find(ett->EventID());
224  const QString next_ett_text = ett->ExtendedTextMessage()
226  if (existing_unmatched_ett_it != elist.end() &&
227  existing_unmatched_ett_it->ett_text != next_ett_text)
228  {
229  LOG(VB_EIT, LOG_DEBUG, LOC +
230  QString("Overwriting previously unmatched ett. stale: %1 major: %2 "
231  "minor: %3 old ett: %4 new ett: %5")
232  .arg(existing_unmatched_ett_it->IsStale())
233  .arg(atsc_major)
234  .arg(atsc_minor)
235  .arg(existing_unmatched_ett_it->ett_text)
236  .arg(next_ett_text));
237  }
238  elist.insert(ett->EventID(), ATSCEtt(next_ett_text));
239 }
240 
242  QMap<uint,uint> languagePreferences,
243  QString &title, QString &subtitle,
244  QString &description, QMap<QString,QString> &items)
245 {
246  const unsigned char *bestShortEvent =
248  list, DescriptorID::short_event, languagePreferences);
249 
250  // from EN 300 468, Appendix A.2 - Selection of character table
251  unsigned char enc_1[3] = { 0x10, 0x00, 0x01 };
252  unsigned char enc_2[3] = { 0x10, 0x00, 0x02 };
253  unsigned char enc_7[3] = { 0x10, 0x00, 0x07 }; // Latin/Greek Alphabet
254  unsigned char enc_9[3] = { 0x10, 0x00, 0x09 }; // could use { 0x05 } instead
255  unsigned char enc_15[3] = { 0x10, 0x00, 0x0f }; // could use { 0x0B } instead
256  int enc_len = 0;
257  const unsigned char *enc = NULL;
258 
259  // Is this BellExpressVU EIT (Canada) ?
260  // Use an encoding override of ISO 8859-1 (Latin1)
262  {
263  enc = enc_1;
264  enc_len = sizeof(enc_1);
265  }
266 
267  // Is this broken DVB provider in Central Europe?
268  // Use an encoding override of ISO 8859-2 (Latin2)
270  {
271  enc = enc_2;
272  enc_len = sizeof(enc_2);
273  }
274 
275  // Is this broken DVB provider in Western Europe?
276  // Use an encoding override of ISO 8859-9 (Latin5)
278  {
279  enc = enc_9;
280  enc_len = sizeof(enc_9);
281  }
282 
283  // Is this broken DVB provider in Western Europe?
284  // Use an encoding override of ISO 8859-15 (Latin9)
286  {
287  enc = enc_15;
288  enc_len = sizeof(enc_15);
289  }
290 
291  // Is this broken DVB provider in Greece?
292  // Use an encoding override of ISO 8859-7 (Latin/Greek)
294  {
295  enc = enc_7;
296  enc_len = sizeof(enc_7);
297  }
298 
299  if (bestShortEvent)
300  {
301  ShortEventDescriptor sed(bestShortEvent);
302  if (enc)
303  {
304  title = sed.EventName(enc, enc_len);
305  subtitle = sed.Text(enc, enc_len);
306  }
307  else
308  {
309  title = sed.EventName();
310  subtitle = sed.Text();
311  }
312  }
313 
314  vector<const unsigned char*> bestExtendedEvents =
316  list, DescriptorID::extended_event, languagePreferences);
317 
318  description = "";
319  for (uint j = 0; j < bestExtendedEvents.size(); j++)
320  {
321  if (!bestExtendedEvents[j])
322  {
323  description = "";
324  break;
325  }
326 
327  ExtendedEventDescriptor eed(bestExtendedEvents[j]);
328  if (enc)
329  description += eed.Text(enc, enc_len);
330  else
331  description += eed.Text();
332 
333  // add items from the decscriptor to the items
334  items.unite (eed.Items());
335  }
336 }
337 
339  unsigned char &subtitle_type,
340  unsigned char &audio_properties,
341  unsigned char &video_properties)
342 {
343  desc_list_t components =
345  for (uint j = 0; j < components.size(); j++)
346  {
347  ComponentDescriptor component(components[j]);
348  video_properties |= component.VideoProperties();
349  audio_properties |= component.AudioProperties();
350  subtitle_type |= component.SubtitleType();
351  }
352 }
353 
355 {
356  uint chanid = 0;
357  if ((eit->TableID() == TableID::PF_EIT) ||
358  ((eit->TableID() >= TableID::SC_EITbeg) && (eit->TableID() <= TableID::SC_EITend)))
359  {
360  // EITa(ctive)
361  chanid = GetChanID(eit->ServiceID());
362  }
363  else
364  {
365  // EITo(ther)
366  chanid = GetChanID(eit->ServiceID(), eit->OriginalNetworkID(), eit->TSID());
367  // do not reschedule if its only present+following
368  if (eit->TableID() != TableID::PF_EITo)
369  {
370  seenEITother = true;
371  }
372  }
373  if (!chanid)
374  return;
375 
376  uint descCompression = (eit->TableID() > 0x80) ? 2 : 1;
377  FixupValue fix = fixup.value((FixupKey)eit->OriginalNetworkID() << 16);
378  fix |= fixup.value((((FixupKey)eit->TSID()) << 32) |
379  ((FixupKey)eit->OriginalNetworkID() << 16));
380  fix |= fixup.value(((FixupKey)eit->OriginalNetworkID() << 16) |
381  (FixupKey)eit->ServiceID());
382  fix |= fixup.value((((FixupKey)eit->TSID()) << 32) |
383  ((FixupKey)eit->OriginalNetworkID() << 16) |
384  (FixupKey)eit->ServiceID());
386 
387  uint tableid = eit->TableID();
388  uint version = eit->Version();
389  for (uint i = 0; i < eit->EventCount(); i++)
390  {
391  // Skip event if we have already processed it before...
392  if (!eitcache->IsNewEIT(chanid, tableid, version, eit->EventID(i),
393  eit->EndTimeUnixUTC(i)))
394  {
395  continue;
396  }
397 
398  QString title = QString("");
399  QString subtitle = QString("");
400  QString description = QString("");
401  QString category = QString("");
403  unsigned char subtitle_type=0, audio_props=0, video_props=0;
404  uint season = 0, episode = 0, totalepisodes = 0;
405  QMap<QString,QString> items;
406 
407  // Parse descriptors
409  eit->Descriptors(i), eit->DescriptorsLength(i));
410 
411  const unsigned char *dish_event_name = NULL;
412  if (EITFixUp::kFixDish & fix)
413  {
414  dish_event_name = MPEGDescriptor::Find(
416  }
417 
418  if (dish_event_name)
419  {
420  DishEventNameDescriptor dend(dish_event_name);
421  if (dend.HasName())
422  title = dend.Name(descCompression);
423 
424  const unsigned char *dish_event_description =
427  if (dish_event_description)
428  {
429  DishEventDescriptionDescriptor dedd(dish_event_description);
430  if (dedd.HasDescription())
431  description = dedd.Description(descCompression);
432  }
433  }
434  else
435  {
437  title, subtitle, description, items);
438  }
439 
440  parse_dvb_component_descriptors(list, subtitle_type, audio_props,
441  video_props);
442 
443  QString programId = QString("");
444  QString seriesId = QString("");
445  QString rating = QString("");
446  QString rating_system = QString("");
447  QString advisory = QString("");
448  float stars = 0.0;
449  QDate originalairdate;
450 
451  if (EITFixUp::kFixDish & fix)
452  {
453  const unsigned char *mpaa_data = MPEGDescriptor::Find(
455  if (mpaa_data)
456  {
457  DishEventMPAADescriptor mpaa(mpaa_data);
458  stars = mpaa.stars();
459 
460  if (stars) // Only movies for now
461  {
462  rating = mpaa.rating();
463  rating_system = "MPAA";
464  advisory = mpaa.advisory();
465  }
466  }
467 
468  if (!stars) // Not MPAA rated, check VCHIP
469  {
470  const unsigned char *vchip_data = MPEGDescriptor::Find(
472  if (vchip_data)
473  {
474  DishEventVCHIPDescriptor vchip(vchip_data);
475  rating = vchip.rating();
476  rating_system = "VCHIP";
477  advisory = vchip.advisory();
478  }
479  }
480 
481  if (!advisory.isEmpty() && !rating.isEmpty())
482  rating += ", " + advisory;
483  else if (!advisory.isEmpty())
484  {
485  rating = advisory;
486  rating_system = "advisory";
487  }
488 
489  const unsigned char *tags_data = MPEGDescriptor::Find(
491  if (tags_data)
492  {
493  DishEventTagsDescriptor tags(tags_data);
494  seriesId = tags.seriesid();
495  programId = tags.programid();
496  originalairdate = tags.originalairdate(); // future use
497 
498  if (programId.startsWith("MV") || programId.startsWith("SP"))
499  seriesId = "";
500  }
501 
502  const unsigned char *properties_data = MPEGDescriptor::Find(
504  if (properties_data)
505  {
506  DishEventPropertiesDescriptor properties(properties_data);
507  subtitle_type |= properties.SubtitleProperties(descCompression);
508  audio_props |= properties.AudioProperties(descCompression);
509  }
510  }
511 
512  const unsigned char *content_data =
514  if (content_data)
515  {
516  if ((EITFixUp::kFixDish & fix) || (EITFixUp::kFixBell & fix))
517  {
518  DishContentDescriptor content(content_data);
519  switch (content.GetTheme())
520  {
521  case kThemeMovie :
522  category_type = ProgramInfo::kCategoryMovie;
523  break;
524  case kThemeSeries :
525  category_type = ProgramInfo::kCategorySeries;
526  break;
527  case kThemeSports :
528  category_type = ProgramInfo::kCategorySports;
529  break;
530  default :
531  category_type = ProgramInfo::kCategoryNone;
532  }
533  if (EITFixUp::kFixDish & fix)
534  category = content.GetCategory();
535  }
536  else if (EITFixUp::kFixAUDescription & fix)//AU Freeview assigned genres
537  {
538  ContentDescriptor content(content_data);
539  switch (content.Nibble1(0))
540  {
541  case 0x01:
542  category = "Movie";
543  break;
544  case 0x02:
545  category = "News";
546  break;
547  case 0x03:
548  category = "Entertainment";
549  break;
550  case 0x04:
551  category = "Sport";
552  break;
553  case 0x05:
554  category = "Children";
555  break;
556  case 0x06:
557  category = "Music";
558  break;
559  case 0x07:
560  category = "Arts/Culture";
561  break;
562  case 0x08:
563  category = "Current Affairs";
564  break;
565  case 0x09:
566  category = "Education";
567  break;
568  case 0x0A:
569  category = "Infotainment";
570  break;
571  case 0x0B:
572  category = "Special";
573  break;
574  case 0x0C:
575  category = "Comedy";
576  break;
577  case 0x0D:
578  category = "Drama";
579  break;
580  case 0x0E:
581  category = "Documentary";
582  break;
583  default:
584  category = "";
585  break;
586  }
587  category_type = content.GetMythCategory(0);
588  }
589  else if (EITFixUp::kFixGreekEIT & fix)//Greek
590  {
591  ContentDescriptor content(content_data);
592  switch (content.Nibble2(0))
593  {
594  case 0x01:
595  category = "Ταινία"; // confirmed
596  break;
597  case 0x02:
598  category = "Ενημερωτικό"; // confirmed
599  break;
600  case 0x04:
601  category = "Αθλητικό"; // confirmed
602  break;
603  case 0x05:
604  category = "Παιδικό"; // confirmed
605  break;
606  case 0x09:
607  category = "Ντοκιμαντέρ"; // confirmed
608  break;
609  default:
610  category = "";
611  break;
612  }
613  category_type = content.GetMythCategory(2);
614  }
615  else
616  {
617  ContentDescriptor content(content_data);
618  category = content.GetDescription(0);
619 #if 0 /* there is no category_type in DVB EIT */
620  category_type = content.GetMythCategory(0);
621 #endif
622  }
623  }
624 
625  desc_list_t contentIds =
627  for (uint j = 0; j < contentIds.size(); j++)
628  {
629  DVBContentIdentifierDescriptor desc(contentIds[j]);
630  for (uint k = 0; k < desc.CRIDCount(); k++)
631  {
632  if (desc.ContentEncoding(k) == 0)
633  {
634  // The CRID is a URI. It could contain UTF8 sequences encoded
635  // as %XX but there's no advantage in decoding them.
636  // The BBC currently uses private types 0x31 and 0x32.
637  // IDs from the authority eventis.nl are not fit for our scheduler
638  if (desc.ContentType(k) == 0x01 || desc.ContentType(k) == 0x31)
639  {
640  if (!desc.ContentId(k).startsWith ("eventis.nl/"))
641  {
642  programId = desc.ContentId(k);
643  }
644  }
645  else if (desc.ContentType(k) == 0x02 || desc.ContentType(k) == 0x32)
646  {
647  if (!desc.ContentId(k).startsWith ("eventis.nl/"))
648  {
649  seriesId = desc.ContentId(k);
650  }
651  category_type = ProgramInfo::kCategorySeries;
652  }
653  }
654  }
655  }
656 
657  /* if we don't have a subtitle, try to parse one from private descriptors */
658  if (subtitle.isEmpty()) {
659  bool isUPC = false;
660  /* is this event carrying UPC private data? */
662  for (uint j = 0; j < private_data_specifiers.size(); j++) {
663  PrivateDataSpecifierDescriptor desc(private_data_specifiers[j]);
665  isUPC = true;
666  }
667  }
668 
669  if (isUPC) {
671  for (uint j = 0; j < subtitles.size(); j++) {
672  PrivateUPCCablecomEpisodeTitleDescriptor desc(subtitles[j]);
673 
674  subtitle = desc.Text();
675  }
676  }
677  }
678 
679 
680  QDateTime starttime = eit->StartTimeUTC(i);
681  // fix starttime only if the duration is a multiple of a minute
682  if (!(eit->DurationInSeconds(i) % 60))
683  EITFixUp::TimeFix(starttime);
684  QDateTime endtime = starttime.addSecs(eit->DurationInSeconds(i));
685 
686  DBEventEIT *event = new DBEventEIT(
687  chanid,
688  title, subtitle, description,
689  category, category_type,
690  starttime, endtime, fix,
691  subtitle_type,
692  audio_props,
693  video_props, stars,
694  seriesId, programId,
695  season, episode, totalepisodes);
696  event->items = items;
697 
698  db_events.enqueue(event);
699  }
700 }
701 
702 // This function gets special EIT data from the German provider Premiere
703 // for the option channels Premiere Sport and Premiere Direkt
705 {
706  // set fixup for Premiere
707  FixupValue fix = fixup.value(133 << 16);
709 
710  QString title = QString("");
711  QString subtitle = QString("");
712  QString description = QString("");
713  QString category = QString("");
715  unsigned char subtitle_type=0, audio_props=0, video_props=0;
716  uint season = 0, episode = 0, totalepisodes = 0;
717  QMap<QString,QString> items;
718 
719  // Parse descriptors
721  cit->Descriptors(), cit->DescriptorsLength());
722 
724  title, subtitle, description, items);
725 
726  parse_dvb_component_descriptors(list, subtitle_type, audio_props,
727  video_props);
728 
729  const unsigned char *content_data =
731  if (content_data)
732  {
733  ContentDescriptor content(content_data);
734  // fix events without real content data
735  if (content.Nibble(0)==0x00)
736  {
737  if(content.UserNibble(0)==0x1)
738  {
739  category_type = ProgramInfo::kCategoryMovie;
740  }
741  else if(content.UserNibble(0)==0x0)
742  {
743  category_type = ProgramInfo::kCategorySports;
744  category = QObject::tr("Sports");
745  }
746  }
747  else
748  {
749  category_type = content.GetMythCategory(0);
750  category = content.GetDescription(0);
751  }
752  }
753 
754  uint tableid = cit->TableID();
755  uint version = cit->Version();
756  uint contentid = cit->ContentID();
757  // fake endtime
758  uint endtime = MythDate::current().addDays(1).toTime_t();
759 
760  // Find Transmissions
761  desc_list_t transmissions =
764  for(uint j=0; j< transmissions.size(); j++)
765  {
766  PremiereContentTransmissionDescriptor transmission(transmissions[j]);
767  uint networkid = transmission.OriginalNetworkID();
768  uint tsid = transmission.TSID();
769  uint serviceid = transmission.ServiceID();
770 
771  uint chanid = GetChanID(serviceid, networkid, tsid);
772 
773  if (!chanid)
774  {
775  LOG(VB_EIT, LOG_INFO, LOC +
776  QString("Premiere EIT for NIT %1, TID %2, SID %3, "
777  "count %4, title: %5. Channel not found!")
778  .arg(networkid).arg(tsid).arg(serviceid)
779  .arg(transmission.TransmissionCount()).arg(title));
780  continue;
781  }
782 
783  // Skip event if we have already processed it before...
784  if (!eitcache->IsNewEIT(chanid, tableid, version, contentid, endtime))
785  {
786  continue;
787  }
788 
789  for (uint k=0; k<transmission.TransmissionCount(); ++k)
790  {
791  QDateTime starttime = transmission.StartTimeUTC(k);
792  // fix starttime only if the duration is a multiple of a minute
793  if (!(cit->DurationInSeconds() % 60))
794  EITFixUp::TimeFix(starttime);
795  QDateTime endtime = starttime.addSecs(cit->DurationInSeconds());
796 
797  DBEventEIT *event = new DBEventEIT(
798  chanid,
799  title, subtitle, description,
800  category, category_type,
801  starttime, endtime, fix,
802  subtitle_type,
803  audio_props,
804  video_props, 0.0,
805  "", "",
806  season, episode, totalepisodes);
807  event->items = items;
808 
809  db_events.enqueue(event);
810  }
811  }
812 }
813 
814 
816 {
817  eitcache->PruneOldEntries(timestamp);
818 }
819 
821 {
822  eitcache->WriteToDB();
823 }
824 
826 // private methods and functions below this line //
828 
829 void EITHelper::CompleteEvent(uint atsc_major, uint atsc_minor,
830  const ATSCEvent &event,
831  const QString &ett)
832 {
833  uint chanid = GetChanID(atsc_major, atsc_minor);
834  if (!chanid)
835  return;
836 
837  QDateTime starttime = MythDate::fromTime_t(
838  event.start_time + GPS_EPOCH + gps_offset);
839 
840  // fix starttime only if the duration is a multiple of a minute
841  if (!(event.length % 60))
842  EITFixUp::TimeFix(starttime);
843  QDateTime endtime = starttime.addSecs(event.length);
844 
845  desc_list_t list = MPEGDescriptor::Parse(event.desc, event.desc_length);
846  unsigned char subtitle_type =
849  unsigned char audio_properties = AUD_UNKNOWN;
850  unsigned char video_properties = VID_UNKNOWN;
851 
852  uint atsc_key = (atsc_major << 16) | atsc_minor;
853 
854  QMutexLocker locker(&eitList_lock);
855  QString title = event.title;
856  QString subtitle = ett;
857  db_events.enqueue(new DBEventEIT(chanid, title, subtitle,
858  starttime, endtime,
859  fixup.value(atsc_key), subtitle_type,
860  audio_properties, video_properties));
861 }
862 
863 uint EITHelper::GetChanID(uint atsc_major, uint atsc_minor)
864 {
865  uint64_t key;
866  key = ((uint64_t) sourceid);
867  key |= ((uint64_t) atsc_minor) << 16;
868  key |= ((uint64_t) atsc_major) << 32;
869 
870  ServiceToChanID::const_iterator it = srv_to_chanid.find(key);
871  if (it != srv_to_chanid.end())
872  return max(*it, 0u);
873 
874  uint chanid = get_chan_id_from_db_atsc(sourceid, atsc_major, atsc_minor);
875  srv_to_chanid[key] = chanid;
876 
877  return chanid;
878 }
879 
880 uint EITHelper::GetChanID(uint serviceid, uint networkid, uint tsid)
881 {
882  uint64_t key;
883  key = ((uint64_t) sourceid);
884  key |= ((uint64_t) serviceid) << 16;
885  key |= ((uint64_t) networkid) << 32;
886  key |= ((uint64_t) tsid) << 48;
887 
888  ServiceToChanID::const_iterator it = srv_to_chanid.find(key);
889  if (it != srv_to_chanid.end())
890  return max(*it, 0u);
891 
892  uint chanid = get_chan_id_from_db_dvb(sourceid, serviceid, networkid, tsid);
893  srv_to_chanid[key] = chanid;
894 
895  return chanid;
896 }
897 
899 {
900  uint64_t key;
901  key = ((uint64_t) sourceid);
902  key |= ((uint64_t) program_number) << 16;
903  key |= ((uint64_t) channelid) << 32;
904 
905  ServiceToChanID::const_iterator it = srv_to_chanid.find(key);
906  if (it != srv_to_chanid.end())
907  return max(*it, 0u);
908 
909  uint chanid = get_chan_id_from_db_dtv(sourceid, program_number, channelid);
910  srv_to_chanid[key] = chanid;
911 
912  return chanid;
913 }
914 
916  uint atsc_major, uint atsc_minor)
917 {
918  MSqlQuery query(MSqlQuery::InitCon());
919  query.prepare(
920  "SELECT chanid, useonairguide "
921  "FROM channel "
922  "WHERE atsc_major_chan = :MAJORCHAN AND "
923  " atsc_minor_chan = :MINORCHAN AND "
924  " sourceid = :SOURCEID");
925  query.bindValue(":MAJORCHAN", atsc_major);
926  query.bindValue(":MINORCHAN", atsc_minor);
927  query.bindValue(":SOURCEID", sourceid);
928 
929  if (!query.exec() || !query.isActive())
930  MythDB::DBError("Looking up chanid 1", query);
931  else if (query.next())
932  {
933  bool useOnAirGuide = query.value(1).toBool();
934  return (useOnAirGuide) ? query.value(0).toUInt() : 0;
935  }
936 
937  return 0;
938 }
939 
940 // Figure out the chanid for this channel
942  uint networkid, uint transportid)
943 {
944  uint chanid = 0;
945  bool useOnAirGuide = false;
946  MSqlQuery query(MSqlQuery::InitCon());
947 
948  // DVB Link to chanid
949  QString qstr =
950  "SELECT chanid, useonairguide, channel.sourceid "
951  "FROM channel, dtv_multiplex "
952  "WHERE serviceid = :SERVICEID AND "
953  " networkid = :NETWORKID AND "
954  " transportid = :TRANSPORTID AND "
955  " channel.mplexid = dtv_multiplex.mplexid";
956 
957  query.prepare(qstr);
958  query.bindValue(":SERVICEID", serviceid);
959  query.bindValue(":NETWORKID", networkid);
960  query.bindValue(":TRANSPORTID", transportid);
961 
962  if (!query.exec() || !query.isActive())
963  MythDB::DBError("Looking up chanID", query);
964 
965  if (query.size() == 0) {
966  // Attempt fuzzy matching, by skipping the tsid
967  // DVB Link to chanid
968  QString qstr =
969  "SELECT chanid, useonairguide, channel.sourceid "
970  "FROM channel, dtv_multiplex "
971  "WHERE serviceid = :SERVICEID AND "
972  " networkid = :NETWORKID AND "
973  " channel.mplexid = dtv_multiplex.mplexid";
974 
975  query.prepare(qstr);
976  query.bindValue(":SERVICEID", serviceid);
977  query.bindValue(":NETWORKID", networkid);
978  if (!query.exec() || !query.isActive())
979  MythDB::DBError("Looking up chanID in fuzzy mode", query);
980  }
981 
982  while (query.next())
983  {
984  // Check to see if we are interested in this channel
985  chanid = query.value(0).toUInt();
986  useOnAirGuide = query.value(1).toBool();
987  if (sourceid == query.value(2).toUInt())
988  return useOnAirGuide ? chanid : 0;
989  }
990 
991  if (query.size() > 1)
992  {
993  LOG(VB_EIT, LOG_INFO,
994  LOC + QString("found %1 channels for networdid %2, "
995  "transportid %3, serviceid %4 but none "
996  "for current sourceid %5.")
997  .arg(query.size()).arg(networkid).arg(transportid)
998  .arg(serviceid).arg(sourceid));
999  }
1000 
1001  return useOnAirGuide ? chanid : 0;
1002 }
1003 
1004 /* Figure out the chanid for this channel from the sourceid,
1005  * program_number/service_id and the chanid of the channel we are tuned to
1006  *
1007  * TODO for SPTS (e.g. HLS / IPTV) it would be useful to match without an entry
1008  * in dtv_multiplex
1009  */
1011  uint tunedchanid)
1012 {
1013  uint chanid = 0;
1014  bool useOnAirGuide = false;
1015  MSqlQuery query(MSqlQuery::InitCon());
1016 
1017  // DVB Link to chanid
1018  QString qstr =
1019  "SELECT c1.chanid, c1.useonairguide, c1.sourceid "
1020  "FROM channel c1, dtv_multiplex m, channel c2 "
1021  "WHERE c1.serviceid = :SERVICEID AND "
1022  " c1.mplexid = m.mplexid AND "
1023  " m.mplexid = c2.mplexid AND "
1024  " c2.chanid = :CHANID";
1025 
1026  query.prepare(qstr);
1027  query.bindValue(":SERVICEID", serviceid);
1028  query.bindValue(":CHANID", tunedchanid);
1029 
1030  if (!query.exec() || !query.isActive())
1031  MythDB::DBError("Looking up chanID", query);
1032 
1033  while (query.next())
1034  {
1035  // Check to see if we are interested in this channel
1036  chanid = query.value(0).toUInt();
1037  useOnAirGuide = query.value(1).toBool();
1038  if (sourceid == query.value(2).toUInt())
1039  return useOnAirGuide ? chanid : 0;
1040  }
1041 
1042  if (query.size() > 1)
1043  {
1044  LOG(VB_EIT, LOG_INFO,
1045  LOC + QString("found %1 channels for multiplex of chanid %2, "
1046  "serviceid %3 but none "
1047  "for current sourceid %4.")
1048  .arg(query.size()).arg(tunedchanid)
1049  .arg(serviceid).arg(sourceid));
1050  }
1051 
1052  return useOnAirGuide ? chanid : 0;
1053 }
1054 
1055 static void init_fixup(FixupMap &fix)
1056 {
1058  // Fixups to make EIT provided listings more useful
1059  // transport_id<<32 | original_network_id<<16 | service_id
1060 
1061  // Bell Express VU Canada
1062  fix[ 256U << 16] = EITFixUp::kFixBell;
1063  fix[ 257U << 16] = EITFixUp::kFixBell;
1064  fix[ 4100U << 16] = EITFixUp::kFixBell;
1065  fix[ 4101U << 16] = EITFixUp::kFixBell;
1066  fix[ 4102U << 16] = EITFixUp::kFixBell;
1067  fix[ 4103U << 16] = EITFixUp::kFixBell;
1068  fix[ 4104U << 16] = EITFixUp::kFixBell;
1069  fix[ 4105U << 16] = EITFixUp::kFixBell;
1070  fix[ 4106U << 16] = EITFixUp::kFixBell;
1071  fix[ 4107U << 16] = EITFixUp::kFixBell;
1072  fix[ 4097U << 16] = EITFixUp::kFixBell;
1073  fix[ 4098U << 16] = EITFixUp::kFixBell;
1074 
1075  // United Kingdom - DVB-T/T2
1076  fix[ 9018U << 16] = EITFixUp::kFixUK;
1077 
1078  // UK - Astra 28.2
1079  for (int i = 2001; i <= 2035; ++i)
1080  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1081 
1082  fix[ 2036LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1083 
1084  for (int i = 2037; i <= 2057; ++i)
1085  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1086  fix[ 2059LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1087  fix[ 2061LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1088  fix[ 2063LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1089  fix[ 2064LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1090  fix[ 2066LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1091  fix[ 2068LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1092  fix[ 2069LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1093  fix[ 2076LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1094  fix[ 2081LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1095  fix[ 2089LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1096  fix[ 2096LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1097  fix[ 2107LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1098  fix[ 2112LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1099  fix[ 2116LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1100  fix[ 2301LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1101  fix[ 2302LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1102  fix[ 2303LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1103  fix[ 2304LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1104  fix[ 2305LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1105  fix[ 2306LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1106  fix[ 2311LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1107  fix[ 2312LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1108  fix[ 2313LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1109  fix[ 2314LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1110  fix[ 2315LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1111  fix[ 2316LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1112  for (int i = 2401; i <= 2413; ++i)
1113  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1114  fix[ 2601LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1115  fix[ 2602LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1116  fix[ 2603LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1117  fix[ 2604LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1118  fix[ 2612LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1119  fix[ 2614LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1120  fix[ 2611LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1121  fix[ 2612LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1122  fix[ 2613LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1123 
1124  // R.caroline
1125  fix[ 2315LL << 32 | 59U << 16] = EITFixUp::kFixUK;
1126 
1127  // ComHem Sweden
1128  fix[40999U << 16 ] = EITFixUp::kFixComHem;
1129  fix[40999U << 16 | 1070] = EITFixUp::kFixSubtitle;
1130  fix[40999U << 16 | 1308] = EITFixUp::kFixSubtitle;
1131  fix[40999U << 16 | 1041] = EITFixUp::kFixSubtitle;
1132  fix[40999U << 16 | 1306] = EITFixUp::kFixSubtitle;
1133  fix[40999U << 16 | 1307] = EITFixUp::kFixSubtitle;
1134  fix[40999U << 16 | 1030] = EITFixUp::kFixSubtitle;
1135  fix[40999U << 16 | 1016] = EITFixUp::kFixSubtitle;
1136  fix[40999U << 16 | 1131] = EITFixUp::kFixSubtitle;
1137  fix[40999U << 16 | 1068] = EITFixUp::kFixSubtitle;
1138  fix[40999U << 16 | 1069] = EITFixUp::kFixSubtitle;
1139 
1140  // Australia
1141  fix[ 4096U << 16] = EITFixUp::kFixAUStar;
1142  fix[ 4096U << 16] = EITFixUp::kFixAUStar;
1143  fix[ 4112U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUFreeview; // ABC Brisbane
1144  fix[ 4114U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUFreeview | EITFixUp::kFixAUNine;; // Nine Brisbane
1145  fix[ 4115U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUSeven; //Seven
1146  fix[ 4116U << 16] = EITFixUp::kFixAUDescription; //Ten
1147  fix[ 12801U << 16] = EITFixUp::kFixAUFreeview | EITFixUp::kFixAUDescription; //ABC
1148  fix[ 12802U << 16] = EITFixUp::kFixAUDescription; //SBS
1150  fix[ 12842U << 16] = EITFixUp::kFixAUDescription; // 31 Brisbane
1151  fix[ 12862U << 16] = EITFixUp::kFixAUDescription; //WestTV
1152 
1153  // MultiChoice Africa
1154  fix[ 6144U << 16] = EITFixUp::kFixMCA;
1155 
1156  // RTL Subtitle parsing
1157  fix[ 1089LL << 32 | 1 << 16] = // DVB-S
1158  fix[ 1041LL << 32 | 1 << 16] = // DVB-S RTL Group HD Austria Transponder
1159  fix[ 1057LL << 32 | 1 << 16] = // DVB-S RTL Group HD Transponder
1160  fix[ 773LL << 32 | 8468U << 16] = // DVB-T Berlin/Brandenburg
1161  fix[ 2819LL << 32 | 8468U << 16] = // DVB-T Niedersachsen + Bremen
1162  fix[ 8706LL << 32 | 8468U << 16] = // DVB-T NRW
1163  fix[ 12801LL << 32 | 8468U << 16] = // DVB-T Bayern
1165 
1166  // Mark HD+ channels as HDTV
1167  fix[ 1041LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1168  fix[ 1055LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1169  fix[ 1057LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1170  fix[ 1109LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1171 
1172  // PRO7/SAT.1
1173  fix[ 1017LL << 32 | 1 << 16] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1174  fix[ 1031LL << 32 | 1 << 16 | 5300] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1175  fix[ 1031LL << 32 | 1 << 16 | 5301] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1176  fix[ 1031LL << 32 | 1 << 16 | 5302] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1177  fix[ 1031LL << 32 | 1 << 16 | 5303] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1178  fix[ 1031LL << 32 | 1 << 16 | 5310] = EITFixUp::kFixP7S1;
1179  fix[ 1031LL << 32 | 1 << 16 | 5311] = EITFixUp::kFixP7S1;
1180  fix[ 1107LL << 32 | 1 << 16] = EITFixUp::kFixP7S1;
1181  fix[ 1082LL << 32 | 1 << 16] = EITFixUp::kFixP7S1;
1182  fix[ 5LL << 32 | 133 << 16 | 776] = EITFixUp::kFixP7S1;
1183  fix[ 8468 << 16 | 16426] = EITFixUp::kFixP7S1; // ProSieben MAXX - DVB-T Rhein/Main
1184  fix[ 8707LL << 32 | 8468 << 16] = EITFixUp::kFixP7S1; // ProSieben Sat.1 Mux - DVB-T Rhein/Main
1185 
1186  // ATV / ATV2
1187  fix[ 1117LL << 32 | 1 << 16 | 13012 ] = EITFixUp::kFixATV; // ATV
1188  fix[ 1003LL << 32 | 1 << 16 | 13223 ] = EITFixUp::kFixATV; // ATV2
1189  fix[ 1003LL << 32 | 1 << 16 | 13228 ] = EITFixUp::kFixHDTV | EITFixUp::kFixATV; // ATV HD
1190 
1191  // Disney Channel Germany
1192  fix[ 1055LL << 32 | 1 << 16 | 5500 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Disney Channel HD
1193  fix[ 1055LL << 32 | 1 << 16 | 5510 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Disney Channel HD Austria
1194  fix[ 5LL << 32 | 133 << 16 | 1793 ] = EITFixUp::kFixDisneyChannel; // Disney Channel HD Austria
1195  fix[ 1109LL << 32 | 1 << 16 | 5401 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Tele 5 HD
1196  fix[ 1109LL << 32 | 1 << 16 | 5421 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Tele 5 HD Austria
1197  fix[ 33LL << 32 | 133 << 16 | 51 ] = EITFixUp::kFixDisneyChannel; // Tele 5
1198 
1199  // Premiere EIT processing
1200  fix[ 1LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1201  fix[ 2LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1202  fix[ 3LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1203  fix[ 4LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1204  fix[ 6LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1205  fix[ 8LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1206  fix[ 9LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1207  fix[ 10LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1208  fix[ 11LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1209  fix[ 12LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1210  fix[ 13LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1211  fix[ 14LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1212  fix[ 15LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1213  fix[ 17LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1214  // Mark Premiere HD, AXN HD and Discovery HD as HDTV
1215  fix[ 6LL << 32 | 133 << 16 | 129] = EITFixUp::kFixHDTV;
1216  fix[ 6LL << 32 | 133 << 16 | 130] = EITFixUp::kFixHDTV;
1217  fix[ 10LL << 32 | 133 << 16 | 125] = EITFixUp::kFixHDTV;
1218 
1219  // Netherlands DVB-C
1220  fix[ 1000U << 16] = EITFixUp::kFixNL;
1221  // Canal Digitaal DVB-S 19.2 Dutch/Belgian ONID 53 covers all CanalDigitaal TiD
1222  fix[ 53U << 16] = EITFixUp::kFixNL;
1223  // Canal Digitaal DVB-S 23.5 Dutch/Belgian
1224  fix[ 3202LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1225  fix[ 3208LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1226  fix[ 3211LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1227  fix[ 3222LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1228  fix[ 3225LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1229 
1230  // Finland
1231  fix[ 8438U << 16] = // DVB-T Espoo
1232  fix[ 42249U << 16] = // DVB-C Welho
1233  fix[ 15U << 16] = // DVB-C Welho
1235 
1236  // DVB-C YouSee (Denmark)
1237  fix[65024U << 16] = EITFixUp::kFixDK;
1238 
1239  // DVB-S(2) Thor 0.8W Norwegian
1240  fix[70U << 16] = EITFixUp::kFixNO;
1241 
1242  // DVB-T NTV/NRK (Norway)
1243  fix[910LL << 32 | 8770U << 16 | 0x006f] = EITFixUp::kFixNRK_DVBT; //NRK Folkemusikk
1244  fix[910LL << 32 | 8770U << 16 | 0x0070] = EITFixUp::kFixNRK_DVBT; //NRK Stortinget
1245  fix[910LL << 32 | 8770U << 16 | 0x0071] = EITFixUp::kFixNRK_DVBT; //NRK Super
1246  fix[910LL << 32 | 8770U << 16 | 0x0072] = EITFixUp::kFixNRK_DVBT; //NRK Sport
1247  fix[910LL << 32 | 8770U << 16 | 0x0073] = EITFixUp::kFixNRK_DVBT; //NRK Gull
1248  fix[910LL << 32 | 8770U << 16 | 0x0074] = EITFixUp::kFixNRK_DVBT; //NRK Jazz
1249  fix[910LL << 32 | 8770U << 16 | 0x0067] = EITFixUp::kFixNRK_DVBT; //NRK Super / NRK3
1250  fix[910LL << 32 | 8770U << 16 | 0x0068] = EITFixUp::kFixNRK_DVBT; //NRK Tegnspr�
1251  fix[910LL << 32 | 8770U << 16 | 0x0069] = EITFixUp::kFixNRK_DVBT; //NRK P2
1252  fix[910LL << 32 | 8770U << 16 | 0x006a] = EITFixUp::kFixNRK_DVBT; //NRK P3
1253  fix[910LL << 32 | 8770U << 16 | 0x006b] = EITFixUp::kFixNRK_DVBT; //NRK Alltid Nyheter
1254  fix[910LL << 32 | 8770U << 16 | 0x006c] = EITFixUp::kFixNRK_DVBT; //NRK mP3
1255  fix[910LL << 32 | 8770U << 16 | 0x006d] = EITFixUp::kFixNRK_DVBT; //NRK Klassisk
1256  fix[910LL << 32 | 8770U << 16 | 0x006e] = EITFixUp::kFixNRK_DVBT; //NRK S�i Radio
1257  fix[910LL << 32 | 8770U << 16 | 0x0066] = EITFixUp::kFixNRK_DVBT; //NRK2
1258  fix[910LL << 32 | 8770U << 16 | 0x03f0] = EITFixUp::kFixNRK_DVBT; //NRK1 M�e og Romsdal
1259  fix[910LL << 32 | 8770U << 16 | 0x0455] = EITFixUp::kFixNRK_DVBT; //NRK P1 Tr�delag
1260  fix[910LL << 32 | 8770U << 16 | 0x03f1] = EITFixUp::kFixNRK_DVBT; //NRK1 Midtnytt
1261 
1263  // Special Early fixups for providers that break DVB EIT spec.
1264  // transport_id<<32 | network_id<<16 | service_id
1265 
1266  // Bell Express VU Canada
1267  fix[ 256U << 16] |= EITFixUp::kEFixForceISO8859_1;
1268  fix[ 257U << 16] |= EITFixUp::kEFixForceISO8859_1;
1269  fix[4100U << 16] |= EITFixUp::kEFixForceISO8859_1;
1270  fix[4101U << 16] |= EITFixUp::kEFixForceISO8859_1;
1271  fix[4102U << 16] |= EITFixUp::kEFixForceISO8859_1;
1272  fix[4103U << 16] |= EITFixUp::kEFixForceISO8859_1;
1273  fix[4104U << 16] |= EITFixUp::kEFixForceISO8859_1;
1274  fix[4105U << 16] |= EITFixUp::kEFixForceISO8859_1;
1275  fix[4106U << 16] |= EITFixUp::kEFixForceISO8859_1;
1276  fix[4107U << 16] |= EITFixUp::kEFixForceISO8859_1;
1277  fix[4097U << 16] |= EITFixUp::kEFixForceISO8859_1;
1278  fix[4098U << 16] |= EITFixUp::kEFixForceISO8859_1;
1279 
1280  //DVB-T Germany Berlin HSE/MonA TV
1281  fix[ 772LL << 32 | 8468 << 16 | 16387] = EITFixUp::kEFixForceISO8859_15;
1282  //DVB-T Germany Ruhrgebiet Tele 5
1283  //fix[ 8707LL << 32 | 8468 << 16 | 16413] = EITFixUp::kEFixForceISO8859_15; // they are sending the ISO 8859-9 signalling now
1284  // ANIXE
1285  fix[ 8707LL << 32 | 8468U << 16 | 16426 ] = // DVB-T Rhein-Main
1287 
1288  // DVB-C Kabel Deutschland encoding fixes Germany
1289  fix[ 112LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1290  fix[ 10000LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1291  fix[ 10001LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1292  fix[ 10002LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1293  fix[ 10003LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1294  fix[ 10006LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1295  fix[ 10009LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1296  fix[ 10010LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1297  // Mark program on the HD transponders as HDTV
1298  fix[ 10012LL << 32 | 61441U << 16] = EITFixUp::kFixHDTV;
1299  fix[ 10013LL << 32 | 61441U << 16] = EITFixUp::kFixHDTV;
1300  // On transport 10004 only DMAX needs no fixing:
1301  fix[10004LL<<32 | 61441U << 16 | 50403] = // BBC World Service
1302  fix[10004LL<<32 | 61441U << 16 | 53101] = // BBC Prime (engl)
1303  fix[10004LL<<32 | 61441U << 16 | 53108] = // Toon Disney (engl)
1304  fix[10004LL<<32 | 61441U << 16 | 53109] = // Sky News (engl)
1305  fix[10004LL<<32 | 61441U << 16 | 53406] = // BBC Prime
1306  fix[10004LL<<32 | 61441U << 16 | 53407] = // Boomerang (engl)
1307  fix[10004LL<<32 | 61441U << 16 | 53404] = // Boomerang
1308  fix[10004LL<<32 | 61441U << 16 | 53408] = // TCM Classic Movies (engl)
1309  fix[10004LL<<32 | 61441U << 16 | 53409] = // Extreme Sports
1310  fix[10004LL<<32 | 61441U << 16 | 53410] = // CNBC Europe (engl)
1311  fix[10004LL<<32 | 61441U << 16 | 53503] = // Detski Mir
1312  fix[10004LL<<32 | 61441U << 16 | 53411] = // Sat.1 Comedy
1313  fix[10004LL<<32 | 61441U << 16 | 53412] = // kabel eins classics
1314  fix[10004LL<<32 | 61441U << 16 | 53112] = // Extreme Sports (engl)
1315  fix[10004LL<<32 | 61441U << 16 | 53513] = // Playhouse Disney (engl)
1316  fix[10004LL<<32 | 61441U << 16 | 53618] = // K1010
1317  fix[10004LL<<32 | 61441U << 16 | 53619] = // GemsTV
1319  // On transport 10005 QVC and Giga Digital needs no fixing:
1320  fix[10005LL<<32 | 61441U << 16 | 50104] = // E! Entertainment
1321  fix[10005LL<<32 | 61441U << 16 | 50107] = // 13th Street (KD)
1322  fix[10005LL<<32 | 61441U << 16 | 50301] = // ESPN Classic
1323  fix[10005LL<<32 | 61441U << 16 | 50302] = // VH1 Classic
1324  fix[10005LL<<32 | 61441U << 16 | 50303] = // Wein TV
1325  fix[10005LL<<32 | 61441U << 16 | 50304] = // AXN
1326  fix[10005LL<<32 | 61441U << 16 | 50305] = // Silverline
1327  fix[10005LL<<32 | 61441U << 16 | 50306] = // NASN
1328  fix[10005LL<<32 | 61441U << 16 | 50307] = // Disney Toon
1329  fix[10005LL<<32 | 61441U << 16 | 53105] = // NASN (engl)
1330  fix[10005LL<<32 | 61441U << 16 | 53115] = // VH1 Classic (engl)
1331  fix[10005LL<<32 | 61441U << 16 | 53405] = // ESPN Classic (engl)
1332  fix[10005LL<<32 | 61441U << 16 | 53402] = // AXN (engl)
1333  fix[10005LL<<32 | 61441U << 16 | 53613] = // CNN (engl)
1334  fix[10005LL<<32 | 61441U << 16 | 53516] = // Voyages Television
1335  fix[10005LL<<32 | 61441U << 16 | 53611] = // Der Schmuckkanal
1336  fix[10005LL<<32 | 61441U << 16 | 53104] = // Jukebox
1338  // On transport 10007 only following channels need fixing:
1339  fix[10007LL<<32| 61441U << 16 | 53607] = // Eurosport
1340  fix[10007LL<<32| 61441U << 16 | 53608] = // Das Vierte
1341  fix[10007LL<<32| 61441U << 16 | 53609] = // Viva
1342  fix[10007LL<<32| 61441U << 16 | 53628] = // COMEDY CENTRAL
1344  // RTL Subtitle parsing
1345  fix[10007LL<<32| 61441U << 16 | 53601] = // RTL
1346  fix[10007LL<<32| 61441U << 16 | 53602] = // Super RTL
1347  fix[10007LL<<32| 61441U << 16 | 53604] = // VOX
1348  fix[10007LL<<32| 61441U << 16 | 53606] = // n-tv
1350  // On transport 10008 only following channels need fixing:
1351  fix[ 10008LL<<32 | 61441U << 16 | 53002] = // Tele 5
1353 
1354  // DVB-C Unitymedia Germany
1355  fix[ 9999 << 16 | 161LL << 32 | 12101 ] = // RTL Television
1356  fix[ 9999 << 16 | 161LL << 32 | 12104 ] = // VOX
1357  fix[ 9999 << 16 | 161LL << 32 | 12107 ] = // Super RTL
1358  fix[ 9999 << 16 | 161LL << 32 | 12109 ] = // n-tv
1359  fix[ 9999 << 16 | 301LL << 32 | 30114 ] = // RTL NITRO
1361  fix[ 9999 << 16 | 191LL << 32 | 11102 ] = // DAS VIERTE
1363  // on this transport are only HD services, two TBD, arte and ServusTV, I think arte properly signals HD!
1364  fix[ 9999 << 16 | 401LL << 32 | 29109 ] = // ServusTV HD
1366  // generic Unitymedia / Liberty Global / Eventis.nl?
1367  fix[ 9999 << 16 | 121LL << 32 | 12107 ] = // Super RTL
1368  fix[ 9999 << 16 | 151LL << 32 | 15110 ] = // Bibel TV
1369  fix[ 9999 << 16 | 161LL << 32 | 12107 ] = // Super RTL
1370  fix[ 9999 << 16 | 161LL << 32 | 12109 ] = // n-tv
1371  fix[ 9999 << 16 | 171LL << 32 | 17119 ] = // RiC
1372  fix[ 9999 << 16 | 171LL << 32 | 27102 ] = // DELUXE MUSIC
1373  fix[ 9999 << 16 | 181LL << 32 | 24108 ] = // DMAX
1374  fix[ 9999 << 16 | 181LL << 32 | 25102 ] = // TV5MONDE Europe
1375  fix[ 9999 << 16 | 191LL << 32 | 11102 ] = // Disney SD
1376  fix[ 9999 << 16 | 191LL << 32 | 12110 ] = // N24
1377  fix[ 9999 << 16 | 191LL << 32 | 12111 ] = // Tele 5
1378  fix[ 9999 << 16 | 201LL << 32 | 27103 ] = // TLC
1379  fix[ 9999 << 16 | 211LL << 32 | 29108 ] = // Astro TV
1380  fix[ 9999 << 16 | 231LL << 32 | 23117 ] = // Deutsches Musik Fernsehen
1381  fix[ 9999 << 16 | 231LL << 32 | 23115 ] = // Family TV
1382  fix[ 9999 << 16 | 271LL << 32 | 27101 ] = // DIE NEUE ZEIT TV
1383  fix[ 9999 << 16 | 541LL << 32 | 54101 ] = // HR HD
1385 
1386  // DVB-S Astra 19.2E DMAX Germany
1387  fix[ 1113LL << 32 | 1 << 16 | 12602] = EITFixUp::kEFixForceISO8859_15;
1388 
1389  // Premiere
1390  fix[133 << 16] = EITFixUp::kEFixForceISO8859_15;
1391 
1392  // DVB-S Astra 19.2E French channels
1393  fix[ 1022LL << 32 | 1 << 16 | 6901 ] = // DIRECT 8
1394  fix[ 1022LL << 32 | 1 << 16 | 6905 ] = // France 24 (en Francais)
1395  fix[ 1022LL << 32 | 1 << 16 | 6911 ] = // DIRECT 8
1396  fix[ 1072LL << 32 | 1 << 16 | 8201 ] = // CANAL+
1397  fix[ 1070LL << 32 | 1 << 16 | 8004 ] = // EURONEWS
1398  fix[ 1091LL << 32 | 1 << 16 | 31220 ] = // EuroNews
1399  fix[ 1094LL << 32 | 1 << 16 | 17027 ] = // LCP
1400  fix[ 1094LL << 32 | 1 << 16 | 17028 ] = // NT1
1401  fix[ 1100LL << 32 | 1 << 16 | 8710 ] = // NRJ 12
1403 
1404  // DVB-C T-Kábel Hungary
1405  // FIXME this should be more specific. Is the encoding really wrong for all services?
1406  fix[ 100 << 16] = EITFixUp::kEFixForceISO8859_2;
1407 
1408  // DVB-T Greece
1409  // Pelion Transmitter
1410  // transport_id<<32 | netword_id<<16 | service_id
1411  fix[ 100LL << 32 | 8492LL << 16 ] = // Ant1,Alpha,Art,10E
1412  fix[ 102LL << 32 | 8492LL << 16 ] = // Mega,Star,SKAI,M.tv
1413  fix[ 320LL << 32 | 8492LL << 16 ] = // Astra,Thessalia,TRT,TV10,ZEYS
1416  fix[ 2LL << 32 | 8492LL << 16 ] = // N1,Nplus,NHD,Vouli
1417  EITFixUp::kEFixForceISO8859_7 | // it is encoded in cp-1253
1418  EITFixUp::kFixGreekSubtitle | // Subtitle has too much info and is
1419  EITFixUp::kFixGreekEIT | // cut in db. Will move to descr.
1421 
1422  // DVB-S Star One C2 70W (Brazil)
1423  // it has original_network_id = 1 like Astra on 19.2E, but transport_id does
1424  // not collide at the moment
1425  fix[ 1LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1426  fix[ 2LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1427  fix[ 3LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1428  fix[ 4LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1429  fix[ 50LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1430  fix[ 51LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1431  fix[ 52LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1432  fix[ 53LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1433  fix[ 54LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1434  fix[ 55LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1435  fix[ 56LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1436  fix[ 57LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1437  fix[ 58LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1438  fix[ 59LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1439 }
1440 
1446 {
1449  maxStarttime, "EITScanner");
1450  seenEITother = false;
1451  maxStarttime = QDateTime();
1452 }
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:785
QDateTime StartTimeUTC(uint i) const
Definition: dvbtables.h:331
static void parse_dvb_event_descriptors(desc_list_t list, FixupValue fix, QMap< uint, uint > languagePreferences, QString &title, QString &subtitle, QString &description, QMap< QString, QString > &items)
Definition: eithelper.cpp:241
uint TSID(void) const
Definition: dvbtables.h:308
uint GetListSize(void) const
Definition: eithelper.cpp:55
MultipleStringStructure title(int i) const
Definition: atsctables.h:589
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:884
static uint get_chan_id_from_db_dtv(uint sourceid, uint programnumber, uint tunedchanid)
Definition: eithelper.cpp:1010
uint GetChanID(uint atsc_major, uint atsc_minor)
Definition: eithelper.cpp:863
void CompleteEvent(uint atsc_major, uint atsc_minor, const ATSCEvent &event, const QString &ett)
Definition: eithelper.cpp:829
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:83
static void init_fixup(FixupMap &fix)
Definition: eithelper.cpp:1055
const MultipleStringStructure ExtendedTextMessage() const
Definition: atsctables.h:663
QMap< FixupKey, FixupValue > FixupMap
Definition: eithelper.h:79
QMap< uint, uint > languagePreferences
Definition: eithelper.h:160
uint StartTimeRaw(uint i) const
Definition: atsctables.h:563
QString Text(void) const
QString EventName(void) const
const unsigned char * desc
Definition: eithelper.h:43
ExtendedTextTable contain additional text not contained in EventInformationTables.
Definition: atsctables.h:621
const char * subtitles[4]
Definition: vbilut.cpp:202
const unsigned char * Descriptors() const
uint ContentType(size_t n=0) const
QVariant value(int i) const
Definition: mythdbcon.h:182
uint Nibble(uint i) const
uint AudioProperties(uint compression_type) const
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
QString seriesid(void) const
unsigned char VideoProperties(void) const
unsigned char AudioProperties(void) const
uint32_t length
Definition: eithelper.h:39
static uint get_chan_id_from_db_atsc(uint sourceid, uint atscmajor, uint atscminor)
Definition: eithelper.cpp:915
unsigned int uint
Definition: compat.h:136
uint DescriptorsLength(uint i) const
Definition: dvbtables.h:353
static int iso639_str3_to_key(const unsigned char *iso639_2)
Definition: iso639.h:63
static const unsigned char * FindBestMatch(const desc_list_t &parsed, uint desc_tag, QMap< uint, uint > &langPref)
QString GetDescription(uint i) const
vector< const unsigned char * > desc_list_t
int size(void) const
Definition: mythdbcon.h:187
int iso639_key_to_canonical_key(int iso639_2)
Definition: iso639.cpp:122
EITHelper(void)
Definition: eithelper.cpp:37
void SetLanguagePreferences(const QStringList &langPref)
Definition: eithelper.cpp:116
static void TimeFix(QDateTime &dt)
Corrects starttime to the multiple of a minute.
Definition: eitfixup.h:83
QMutex eitList_lock
EIT List lock.
Definition: eithelper.h:140
MythDeque< DBEventEIT * > db_events
Definition: eithelper.h:158
static uint GetMplexID(uint sourceid, const QString &channum)
void enqueue(T d)
Adds item to the back of the list. O(1).
Definition: mythdeque.h:35
QString Name(uint) const
uint DurationInSeconds(uint i) const
Definition: dvbtables.h:342
const unsigned char * Descriptors(uint i) const
Definition: dvbtables.h:357
QString rating(void) const
uint Nibble1(uint i) const
void AddEIT(uint atsc_major, uint atsc_minor, const EventInformationTable *eit)
Definition: eithelper.cpp:145
uint UserNibble(uint i) const
const QString season
Definition: eitfixup.cpp:21
Overall structure.
uint64_t FixupKey
Definition: eithelper.h:77
QString rating(void) const
void Fix(DBEventEIT &event) const
Definition: eitfixup.cpp:247
void WriteEITCache(void)
Definition: eithelper.cpp:820
uint channelid
id of the channel
Definition: eithelper.h:150
ATSCSRCToEvents incomplete_events
Definition: eithelper.h:155
def rating(profile, smoonURL, gate)
Definition: scan.py:25
uint TableID(void) const
Definition: mpegtables.h:479
QString advisory(void) const
QDate originalairdate(void) const
uint32_t start_time
Definition: eithelper.h:38
static EITCache * eitcache
Definition: eithelper.h:144
float stars(void) const
QString Text(void) const
uint EventID(void) const
Definition: atsctables.h:659
QMap< uint, ATSCEtt > EventIDToETT
Definition: eithelper.h:72
void WriteToDB(void)
Definition: eitcache.cpp:298
MBASE_PUBLIC QDateTime fromTime_t(uint seconds)
Definition: mythdate.cpp:60
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
T dequeue()
Removes item from front of list and returns a copy. O(1).
Definition: mythdeque.h:25
uint EventID(uint i) const
Definition: atsctables.h:558
uint SubtitleProperties(uint compression_type) const
void AddETT(uint atsc_major, uint atsc_minor, const ExtendedTextTable *ett)
Definition: eithelper.cpp:190
QString GetBestMatch(QMap< uint, uint > &langPrefs) const
QString Description(uint) const
unsigned char SubtitleType(void) const
int gps_offset
Definition: eithelper.h:146
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:542
EITFixUp * eitfixup
Definition: eithelper.h:143
EIT Fix Up Functions.
Definition: eitfixup.h:13
static void RescheduleMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
void SetSourceID(uint _sourceid)
Definition: eithelper.cpp:133
QString ContentId(size_t n=0) const
static const unsigned char * Find(const desc_list_t &parsed, uint desc_tag)
bool isActive(void) const
Definition: mythdbcon.h:188
EventInformationTables contain program titles, start times, and channel information.
Definition: atsctables.h:521
FixupMap fixup
Definition: eithelper.h:154
uint PruneOldEntries(uint utc_timestamp)
Prunes entries that describe events ending before timestamp time.
Definition: eitcache.cpp:404
ServiceToChanID srv_to_chanid
Definition: eithelper.h:141
ProgramInfo::CategoryType GetMythCategory(uint i) const
bool seenEITother
if false we only reschedule the active mplex
Definition: eithelper.h:152
time_t EndTimeUnixUTC(uint i) const
Definition: dvbtables.h:335
uint32_t desc_length
Definition: eithelper.h:41
static void parse_dvb_component_descriptors(desc_list_t list, unsigned char &subtitle_type, unsigned char &audio_properties, unsigned char &video_properties)
Definition: eithelper.cpp:338
uint sourceid
id of the video source
Definition: eithelper.h:149
bool HasDescription(void) const
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:810
ATSCSRCToETTs unmatched_etts
Definition: eithelper.h:156
QString GetCategory(void) const
uint OriginalNetworkID(void) const
Definition: dvbtables.h:312
bool IsNewEIT(uint chanid, uint tableid, uint version, uint eventid, uint endtime)
Definition: eitcache.cpp:327
uint Nibble2(uint i) const
virtual ~EITHelper(void)
Definition: eithelper.cpp:46
void PruneEITCache(uint timestamp)
Definition: eithelper.cpp:815
uint EventCount() const
Definition: dvbtables.h:322
QDateTime maxStarttime
latest starttime of changed events
Definition: eithelper.h:151
uint ContentEncoding(size_t n=0) const
static const uint kChunkSize
Maximum number of DB inserts per ProcessEvents call.
Definition: eithelper.h:163
uint64_t FixupValue
Definition: eithelper.h:78
QString programid(void) const
QString advisory(void) const
QMap< QString, QString > Items(void) const
uint EventCount() const
Definition: atsctables.h:553
static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid, uint networkid, uint transportid)
Definition: eithelper.cpp:941
void SetChannelID(uint _channelid)
Definition: eithelper.cpp:139
uint LengthInSeconds(uint i) const
Definition: atsctables.h:580
static const QString LOC
uint32_t PrivateDataSpecifier(void) const
DishThemeType GetTheme(void) const
const unsigned char * Descriptors(uint i) const
Definition: atsctables.h:603
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:610
uint DescriptorsLength(uint i) const
Definition: atsctables.h:595
uint ProcessEvents(void)
Inserts events in EIT list.
Definition: eithelper.cpp:66
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:181
static desc_list_t FindBestMatches(const desc_list_t &parsed, uint desc_tag, QMap< uint, uint > &langPref)
uint ETMLocation(uint i) const
Definition: atsctables.h:575
static desc_list_t FindAll(const desc_list_t &parsed, uint desc_tag)
uint ServiceID(void) const
Definition: dvbtables.h:305
static desc_list_t Parse(const unsigned char *data, uint len)
uint Version(void) const
Definition: mpegtables.h:503
uint EventID(uint i) const
Definition: dvbtables.h:326
bool HasName(void) const
QMap< uint, ATSCEvent > EventIDToATSCEvent
Definition: eithelper.h:71
void RescheduleRecordings(void)
Tells scheduler about programming changes.
Definition: eithelper.cpp:1445
void SetFixup(uint atsc_major, uint atsc_minor, FixupValue eitfixup)
Definition: eithelper.cpp:109