MythTV  master
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;
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 #if QT_VERSION < QT_VERSION_CHECK(5,8,0)
759  uint endtime = MythDate::current().addDays(1).toTime_t();
760 #else
761  uint endtime = MythDate::current().addDays(1).toSecsSinceEpoch();
762 #endif
763 
764  // Find Transmissions
765  desc_list_t transmissions =
768  for(uint j=0; j< transmissions.size(); j++)
769  {
770  PremiereContentTransmissionDescriptor transmission(transmissions[j]);
771  uint networkid = transmission.OriginalNetworkID();
772  uint tsid = transmission.TSID();
773  uint serviceid = transmission.ServiceID();
774 
775  uint chanid = GetChanID(serviceid, networkid, tsid);
776 
777  if (!chanid)
778  {
779  LOG(VB_EIT, LOG_INFO, LOC +
780  QString("Premiere EIT for NIT %1, TID %2, SID %3, "
781  "count %4, title: %5. Channel not found!")
782  .arg(networkid).arg(tsid).arg(serviceid)
783  .arg(transmission.TransmissionCount()).arg(title));
784  continue;
785  }
786 
787  // Skip event if we have already processed it before...
788  if (!eitcache->IsNewEIT(chanid, tableid, version, contentid, endtime))
789  {
790  continue;
791  }
792 
793  for (uint k=0; k<transmission.TransmissionCount(); ++k)
794  {
795  QDateTime starttime = transmission.StartTimeUTC(k);
796  // fix starttime only if the duration is a multiple of a minute
797  if (!(cit->DurationInSeconds() % 60))
798  EITFixUp::TimeFix(starttime);
799  QDateTime endtime = starttime.addSecs(cit->DurationInSeconds());
800 
801  DBEventEIT *event = new DBEventEIT(
802  chanid,
803  title, subtitle, description,
804  category, category_type,
805  starttime, endtime, fix,
806  subtitle_type,
807  audio_props,
808  video_props, 0.0,
809  "", "",
810  season, episode, totalepisodes);
811  event->items = items;
812 
813  db_events.enqueue(event);
814  }
815  }
816 }
817 
818 
820 {
821  eitcache->PruneOldEntries(timestamp);
822 }
823 
825 {
826  eitcache->WriteToDB();
827 }
828 
830 // private methods and functions below this line //
832 
833 void EITHelper::CompleteEvent(uint atsc_major, uint atsc_minor,
834  const ATSCEvent &event,
835  const QString &ett)
836 {
837  uint chanid = GetChanID(atsc_major, atsc_minor);
838  if (!chanid)
839  return;
840 
841 #if QT_VERSION < QT_VERSION_CHECK(5,8,0)
842  QDateTime starttime = MythDate::fromTime_t(
843  event.start_time + GPS_EPOCH + gps_offset);
844 #else
845  QDateTime starttime = MythDate::fromSecsSinceEpoch(
846  event.start_time + GPS_EPOCH + gps_offset);
847 #endif
848 
849  // fix starttime only if the duration is a multiple of a minute
850  if (!(event.length % 60))
851  EITFixUp::TimeFix(starttime);
852  QDateTime endtime = starttime.addSecs(event.length);
853 
854  desc_list_t list = MPEGDescriptor::Parse(event.desc, event.desc_length);
855  unsigned char subtitle_type =
858  unsigned char audio_properties = AUD_UNKNOWN;
859  unsigned char video_properties = VID_UNKNOWN;
860 
861  uint atsc_key = (atsc_major << 16) | atsc_minor;
862 
863  QMutexLocker locker(&eitList_lock);
864  QString title = event.title;
865  QString subtitle = ett;
866  db_events.enqueue(new DBEventEIT(chanid, title, subtitle,
867  starttime, endtime,
868  fixup.value(atsc_key), subtitle_type,
869  audio_properties, video_properties));
870 }
871 
872 uint EITHelper::GetChanID(uint atsc_major, uint atsc_minor)
873 {
874  uint64_t key;
875  key = ((uint64_t) sourceid);
876  key |= ((uint64_t) atsc_minor) << 16;
877  key |= ((uint64_t) atsc_major) << 32;
878 
879  ServiceToChanID::const_iterator it = srv_to_chanid.find(key);
880  if (it != srv_to_chanid.end())
881  return *it;
882 
883  uint chanid = get_chan_id_from_db_atsc(sourceid, atsc_major, atsc_minor);
884  srv_to_chanid[key] = chanid;
885 
886  return chanid;
887 }
888 
889 uint EITHelper::GetChanID(uint serviceid, uint networkid, uint tsid)
890 {
891  uint64_t key;
892  key = ((uint64_t) sourceid);
893  key |= ((uint64_t) serviceid) << 16;
894  key |= ((uint64_t) networkid) << 32;
895  key |= ((uint64_t) tsid) << 48;
896 
897  ServiceToChanID::const_iterator it = srv_to_chanid.find(key);
898  if (it != srv_to_chanid.end())
899  return *it;
900 
901  uint chanid = get_chan_id_from_db_dvb(sourceid, serviceid, networkid, tsid);
902  srv_to_chanid[key] = chanid;
903 
904  return chanid;
905 }
906 
908 {
909  uint64_t key;
910  key = ((uint64_t) sourceid);
911  key |= ((uint64_t) program_number) << 16;
912  key |= ((uint64_t) channelid) << 32;
913 
914  ServiceToChanID::const_iterator it = srv_to_chanid.find(key);
915  if (it != srv_to_chanid.end())
916  return *it;
917 
918  uint chanid = get_chan_id_from_db_dtv(sourceid, program_number, channelid);
919  srv_to_chanid[key] = chanid;
920 
921  return chanid;
922 }
923 
925  uint atsc_major, uint atsc_minor)
926 {
927  MSqlQuery query(MSqlQuery::InitCon());
928  query.prepare(
929  "SELECT chanid, useonairguide "
930  "FROM channel "
931  "WHERE atsc_major_chan = :MAJORCHAN AND "
932  " atsc_minor_chan = :MINORCHAN AND "
933  " sourceid = :SOURCEID");
934  query.bindValue(":MAJORCHAN", atsc_major);
935  query.bindValue(":MINORCHAN", atsc_minor);
936  query.bindValue(":SOURCEID", sourceid);
937 
938  if (!query.exec() || !query.isActive())
939  MythDB::DBError("Looking up chanid 1", query);
940  else if (query.next())
941  {
942  bool useOnAirGuide = query.value(1).toBool();
943  return (useOnAirGuide) ? query.value(0).toUInt() : 0;
944  }
945 
946  return 0;
947 }
948 
949 // Figure out the chanid for this channel
951  uint networkid, uint transportid)
952 {
953  uint chanid = 0;
954  bool useOnAirGuide = false;
955  MSqlQuery query(MSqlQuery::InitCon());
956 
957  // DVB Link to chanid
958  QString qstr =
959  "SELECT chanid, useonairguide, channel.sourceid "
960  "FROM channel, dtv_multiplex "
961  "WHERE serviceid = :SERVICEID AND "
962  " networkid = :NETWORKID AND "
963  " transportid = :TRANSPORTID AND "
964  " channel.mplexid = dtv_multiplex.mplexid";
965 
966  query.prepare(qstr);
967  query.bindValue(":SERVICEID", serviceid);
968  query.bindValue(":NETWORKID", networkid);
969  query.bindValue(":TRANSPORTID", transportid);
970 
971  if (!query.exec() || !query.isActive())
972  MythDB::DBError("Looking up chanID", query);
973 
974  if (query.size() == 0) {
975  // Attempt fuzzy matching, by skipping the tsid
976  // DVB Link to chanid
977  QString qstr =
978  "SELECT chanid, useonairguide, channel.sourceid "
979  "FROM channel, dtv_multiplex "
980  "WHERE serviceid = :SERVICEID AND "
981  " networkid = :NETWORKID AND "
982  " channel.mplexid = dtv_multiplex.mplexid";
983 
984  query.prepare(qstr);
985  query.bindValue(":SERVICEID", serviceid);
986  query.bindValue(":NETWORKID", networkid);
987  if (!query.exec() || !query.isActive())
988  MythDB::DBError("Looking up chanID in fuzzy mode", query);
989  }
990 
991  while (query.next())
992  {
993  // Check to see if we are interested in this channel
994  chanid = query.value(0).toUInt();
995  useOnAirGuide = query.value(1).toBool();
996  if (sourceid == query.value(2).toUInt())
997  return useOnAirGuide ? chanid : 0;
998  }
999 
1000  if (query.size() > 1)
1001  {
1002  LOG(VB_EIT, LOG_INFO,
1003  LOC + QString("found %1 channels for networdid %2, "
1004  "transportid %3, serviceid %4 but none "
1005  "for current sourceid %5.")
1006  .arg(query.size()).arg(networkid).arg(transportid)
1007  .arg(serviceid).arg(sourceid));
1008  }
1009 
1010  return useOnAirGuide ? chanid : 0;
1011 }
1012 
1013 /* Figure out the chanid for this channel from the sourceid,
1014  * program_number/service_id and the chanid of the channel we are tuned to
1015  *
1016  * TODO for SPTS (e.g. HLS / IPTV) it would be useful to match without an entry
1017  * in dtv_multiplex
1018  */
1020  uint tunedchanid)
1021 {
1022  uint chanid = 0;
1023  bool useOnAirGuide = false;
1024  MSqlQuery query(MSqlQuery::InitCon());
1025 
1026  // DVB Link to chanid
1027  QString qstr =
1028  "SELECT c1.chanid, c1.useonairguide, c1.sourceid "
1029  "FROM channel c1, dtv_multiplex m, channel c2 "
1030  "WHERE c1.serviceid = :SERVICEID AND "
1031  " c1.mplexid = m.mplexid AND "
1032  " m.mplexid = c2.mplexid AND "
1033  " c2.chanid = :CHANID";
1034 
1035  query.prepare(qstr);
1036  query.bindValue(":SERVICEID", serviceid);
1037  query.bindValue(":CHANID", tunedchanid);
1038 
1039  if (!query.exec() || !query.isActive())
1040  MythDB::DBError("Looking up chanID", query);
1041 
1042  while (query.next())
1043  {
1044  // Check to see if we are interested in this channel
1045  chanid = query.value(0).toUInt();
1046  useOnAirGuide = query.value(1).toBool();
1047  if (sourceid == query.value(2).toUInt())
1048  return useOnAirGuide ? chanid : 0;
1049  }
1050 
1051  if (query.size() > 1)
1052  {
1053  LOG(VB_EIT, LOG_INFO,
1054  LOC + QString("found %1 channels for multiplex of chanid %2, "
1055  "serviceid %3 but none "
1056  "for current sourceid %4.")
1057  .arg(query.size()).arg(tunedchanid)
1058  .arg(serviceid).arg(sourceid));
1059  }
1060 
1061  return useOnAirGuide ? chanid : 0;
1062 }
1063 
1064 static void init_fixup(FixupMap &fix)
1065 {
1067  // Fixups to make EIT provided listings more useful
1068  // transport_id<<32 | original_network_id<<16 | service_id
1069 
1070  // Bell Express VU Canada
1071  fix[ 256U << 16] = EITFixUp::kFixBell;
1072  fix[ 257U << 16] = EITFixUp::kFixBell;
1073  fix[ 4100U << 16] = EITFixUp::kFixBell;
1074  fix[ 4101U << 16] = EITFixUp::kFixBell;
1075  fix[ 4102U << 16] = EITFixUp::kFixBell;
1076  fix[ 4103U << 16] = EITFixUp::kFixBell;
1077  fix[ 4104U << 16] = EITFixUp::kFixBell;
1078  fix[ 4105U << 16] = EITFixUp::kFixBell;
1079  fix[ 4106U << 16] = EITFixUp::kFixBell;
1080  fix[ 4107U << 16] = EITFixUp::kFixBell;
1081  fix[ 4097U << 16] = EITFixUp::kFixBell;
1082  fix[ 4098U << 16] = EITFixUp::kFixBell;
1083 
1084  // United Kingdom - DVB-T/T2
1085  fix[ 9018U << 16] = EITFixUp::kFixUK;
1086 
1087  // UK - Astra 28.2
1088  for (int i = 2001; i <= 2035; ++i)
1089  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1090 
1091  fix[ 2036LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1092 
1093  for (int i = 2037; i <= 2057; ++i)
1094  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1095  fix[ 2059LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1096  fix[ 2061LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1097  for (int i = 2063; i <= 2069; ++i)
1098  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1099  fix[ 2071LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1100  fix[ 2076LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1101  fix[ 2081LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1102  for (int i = 2089; i <= 2092; ++i)
1103  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1104  for (int i = 2094; i <= 2099; ++i)
1105  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1106  for (int i = 2102; i <= 2110; ++i)
1107  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1108  fix[ 2112LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1109  fix[ 2116LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1110  fix[ 2301LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1111  fix[ 2302LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1112  fix[ 2303LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1113  fix[ 2304LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1114  fix[ 2305LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1115  fix[ 2306LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1116  fix[ 2311LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1117  fix[ 2312LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1118  fix[ 2313LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1119  fix[ 2314LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1120  fix[ 2315LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1121  fix[ 2316LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1122  for (int i = 2401; i <= 2413; ++i)
1123  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1124  fix[ 2601LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1125  fix[ 2602LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1126  fix[ 2603LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1127  fix[ 2604LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1128  fix[ 2612LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1129  fix[ 2614LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1130  fix[ 2611LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1131  fix[ 2612LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1132  fix[ 2613LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1133 
1134  // R.caroline
1135  fix[ 2315LL << 32 | 59U << 16] = EITFixUp::kFixUK;
1136 
1137  // ComHem Sweden
1138  fix[40999U << 16 ] = EITFixUp::kFixComHem;
1139  fix[40999U << 16 | 1070] = EITFixUp::kFixSubtitle;
1140  fix[40999U << 16 | 1308] = EITFixUp::kFixSubtitle;
1141  fix[40999U << 16 | 1041] = EITFixUp::kFixSubtitle;
1142  fix[40999U << 16 | 1306] = EITFixUp::kFixSubtitle;
1143  fix[40999U << 16 | 1307] = EITFixUp::kFixSubtitle;
1144  fix[40999U << 16 | 1030] = EITFixUp::kFixSubtitle;
1145  fix[40999U << 16 | 1016] = EITFixUp::kFixSubtitle;
1146  fix[40999U << 16 | 1131] = EITFixUp::kFixSubtitle;
1147  fix[40999U << 16 | 1068] = EITFixUp::kFixSubtitle;
1148  fix[40999U << 16 | 1069] = EITFixUp::kFixSubtitle;
1149 
1150  // Australia
1151  fix[ 4096U << 16] = EITFixUp::kFixAUStar;
1152  fix[ 4096U << 16] = EITFixUp::kFixAUStar;
1153  fix[ 4112U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUFreeview; // ABC Brisbane
1154  fix[ 4114U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUFreeview | EITFixUp::kFixAUNine;; // Nine Brisbane
1155  fix[ 4115U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUSeven; //Seven
1156  fix[ 4116U << 16] = EITFixUp::kFixAUDescription; //Ten
1157  fix[ 12801U << 16] = EITFixUp::kFixAUFreeview | EITFixUp::kFixAUDescription; //ABC
1158  fix[ 12802U << 16] = EITFixUp::kFixAUDescription; //SBS
1160  fix[ 12842U << 16] = EITFixUp::kFixAUDescription; // 31 Brisbane
1161  fix[ 12862U << 16] = EITFixUp::kFixAUDescription; //WestTV
1162 
1163  // MultiChoice Africa
1164  fix[ 6144U << 16] = EITFixUp::kFixMCA;
1165 
1166  // RTL Subtitle parsing
1167  fix[ 1089LL << 32 | 1 << 16] = // DVB-S
1168  fix[ 1041LL << 32 | 1 << 16] = // DVB-S RTL Group HD Austria Transponder
1169  fix[ 1057LL << 32 | 1 << 16] = // DVB-S RTL Group HD Transponder
1170  fix[ 773LL << 32 | 8468U << 16] = // DVB-T Berlin/Brandenburg
1171  fix[ 2819LL << 32 | 8468U << 16] = // DVB-T Niedersachsen + Bremen
1172  fix[ 8706LL << 32 | 8468U << 16] = // DVB-T NRW
1173  fix[ 12801LL << 32 | 8468U << 16] = // DVB-T Bayern
1175 
1176  // Mark HD+ channels as HDTV
1177  fix[ 1041LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1178  fix[ 1055LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1179  fix[ 1057LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1180  fix[ 1109LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1181 
1182  // PRO7/SAT.1
1183  fix[ 1017LL << 32 | 1 << 16] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1184  fix[ 1031LL << 32 | 1 << 16 | 5300] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1185  fix[ 1031LL << 32 | 1 << 16 | 5301] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1186  fix[ 1031LL << 32 | 1 << 16 | 5302] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1187  fix[ 1031LL << 32 | 1 << 16 | 5303] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
1188  fix[ 1031LL << 32 | 1 << 16 | 5310] = EITFixUp::kFixP7S1;
1189  fix[ 1031LL << 32 | 1 << 16 | 5311] = EITFixUp::kFixP7S1;
1190  fix[ 1107LL << 32 | 1 << 16] = EITFixUp::kFixP7S1;
1191  fix[ 1082LL << 32 | 1 << 16] = EITFixUp::kFixP7S1;
1192  fix[ 5LL << 32 | 133 << 16 | 776] = EITFixUp::kFixP7S1;
1193  fix[ 8468 << 16 | 16426] = EITFixUp::kFixP7S1; // ProSieben MAXX - DVB-T Rhein/Main
1194  fix[ 8707LL << 32 | 8468 << 16] = EITFixUp::kFixP7S1; // ProSieben Sat.1 Mux - DVB-T Rhein/Main
1195 
1196  // ATV / ATV2
1197  fix[ 1117LL << 32 | 1 << 16 | 13012 ] = EITFixUp::kFixATV; // ATV
1198  fix[ 1003LL << 32 | 1 << 16 | 13223 ] = EITFixUp::kFixATV; // ATV2
1199  fix[ 1003LL << 32 | 1 << 16 | 13228 ] = EITFixUp::kFixHDTV | EITFixUp::kFixATV; // ATV HD
1200 
1201  // Disney Channel Germany
1202  fix[ 1055LL << 32 | 1 << 16 | 5500 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Disney Channel HD
1203  fix[ 1055LL << 32 | 1 << 16 | 5510 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Disney Channel HD Austria
1204  fix[ 5LL << 32 | 133 << 16 | 1793 ] = EITFixUp::kFixDisneyChannel; // Disney Channel HD Austria
1205  fix[ 1109LL << 32 | 1 << 16 | 5401 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Tele 5 HD
1206  fix[ 1109LL << 32 | 1 << 16 | 5421 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Tele 5 HD Austria
1207  fix[ 33LL << 32 | 133 << 16 | 51 ] = EITFixUp::kFixDisneyChannel; // Tele 5
1208 
1209  // Premiere EIT processing
1210  fix[ 1LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1211  fix[ 2LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1212  fix[ 3LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1213  fix[ 4LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1214  fix[ 6LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1215  fix[ 8LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1216  fix[ 9LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1217  fix[ 10LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1218  fix[ 11LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1219  fix[ 12LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1220  fix[ 13LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1221  fix[ 14LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1222  fix[ 15LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1223  fix[ 17LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1224  // Mark Premiere HD, AXN HD and Discovery HD as HDTV
1225  fix[ 6LL << 32 | 133 << 16 | 129] = EITFixUp::kFixHDTV;
1226  fix[ 6LL << 32 | 133 << 16 | 130] = EITFixUp::kFixHDTV;
1227  fix[ 10LL << 32 | 133 << 16 | 125] = EITFixUp::kFixHDTV;
1228 
1229  // Netherlands DVB-C
1230  fix[ 1000U << 16] = EITFixUp::kFixNL;
1231  // Canal Digitaal DVB-S 19.2 Dutch/Belgian ONID 53 covers all CanalDigitaal TiD
1232  fix[ 53U << 16] = EITFixUp::kFixNL;
1233  // Canal Digitaal DVB-S 23.5 Dutch/Belgian
1234  fix[ 3202LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1235  fix[ 3208LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1236  fix[ 3211LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1237  fix[ 3222LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1238  fix[ 3225LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1239 
1240  // Finland
1241  fix[ 8438U << 16] = // DVB-T Espoo
1242  fix[ 42249U << 16] = // DVB-C Welho
1243  fix[ 15U << 16] = // DVB-C Welho
1245 
1246  // DVB-C YouSee (Denmark)
1247  fix[65024U << 16] = EITFixUp::kFixDK;
1248 
1249  // DVB-S(2) Thor 0.8W Norwegian
1250  fix[70U << 16] = EITFixUp::kFixNO;
1251 
1252  // DVB-T NTV/NRK (Norway)
1253  fix[910LL << 32 | 8770U << 16 | 0x006f] = EITFixUp::kFixNRK_DVBT; //NRK Folkemusikk
1254  fix[910LL << 32 | 8770U << 16 | 0x0070] = EITFixUp::kFixNRK_DVBT; //NRK Stortinget
1255  fix[910LL << 32 | 8770U << 16 | 0x0071] = EITFixUp::kFixNRK_DVBT; //NRK Super
1256  fix[910LL << 32 | 8770U << 16 | 0x0072] = EITFixUp::kFixNRK_DVBT; //NRK Sport
1257  fix[910LL << 32 | 8770U << 16 | 0x0073] = EITFixUp::kFixNRK_DVBT; //NRK Gull
1258  fix[910LL << 32 | 8770U << 16 | 0x0074] = EITFixUp::kFixNRK_DVBT; //NRK Jazz
1259  fix[910LL << 32 | 8770U << 16 | 0x0067] = EITFixUp::kFixNRK_DVBT; //NRK Super / NRK3
1260  fix[910LL << 32 | 8770U << 16 | 0x0068] = EITFixUp::kFixNRK_DVBT; //NRK Tegnspr�
1261  fix[910LL << 32 | 8770U << 16 | 0x0069] = EITFixUp::kFixNRK_DVBT; //NRK P2
1262  fix[910LL << 32 | 8770U << 16 | 0x006a] = EITFixUp::kFixNRK_DVBT; //NRK P3
1263  fix[910LL << 32 | 8770U << 16 | 0x006b] = EITFixUp::kFixNRK_DVBT; //NRK Alltid Nyheter
1264  fix[910LL << 32 | 8770U << 16 | 0x006c] = EITFixUp::kFixNRK_DVBT; //NRK mP3
1265  fix[910LL << 32 | 8770U << 16 | 0x006d] = EITFixUp::kFixNRK_DVBT; //NRK Klassisk
1266  fix[910LL << 32 | 8770U << 16 | 0x006e] = EITFixUp::kFixNRK_DVBT; //NRK S�i Radio
1267  fix[910LL << 32 | 8770U << 16 | 0x0066] = EITFixUp::kFixNRK_DVBT; //NRK2
1268  fix[910LL << 32 | 8770U << 16 | 0x03f0] = EITFixUp::kFixNRK_DVBT; //NRK1 M�e og Romsdal
1269  fix[910LL << 32 | 8770U << 16 | 0x0455] = EITFixUp::kFixNRK_DVBT; //NRK P1 Tr�delag
1270  fix[910LL << 32 | 8770U << 16 | 0x03f1] = EITFixUp::kFixNRK_DVBT; //NRK1 Midtnytt
1271 
1273  // Special Early fixups for providers that break DVB EIT spec.
1274  // transport_id<<32 | network_id<<16 | service_id
1275 
1276  // Bell Express VU Canada
1277  fix[ 256U << 16] |= EITFixUp::kEFixForceISO8859_1;
1278  fix[ 257U << 16] |= EITFixUp::kEFixForceISO8859_1;
1279  fix[4100U << 16] |= EITFixUp::kEFixForceISO8859_1;
1280  fix[4101U << 16] |= EITFixUp::kEFixForceISO8859_1;
1281  fix[4102U << 16] |= EITFixUp::kEFixForceISO8859_1;
1282  fix[4103U << 16] |= EITFixUp::kEFixForceISO8859_1;
1283  fix[4104U << 16] |= EITFixUp::kEFixForceISO8859_1;
1284  fix[4105U << 16] |= EITFixUp::kEFixForceISO8859_1;
1285  fix[4106U << 16] |= EITFixUp::kEFixForceISO8859_1;
1286  fix[4107U << 16] |= EITFixUp::kEFixForceISO8859_1;
1287  fix[4097U << 16] |= EITFixUp::kEFixForceISO8859_1;
1288  fix[4098U << 16] |= EITFixUp::kEFixForceISO8859_1;
1289 
1290  //DVB-T Germany Berlin HSE/MonA TV
1291  fix[ 772LL << 32 | 8468 << 16 | 16387] = EITFixUp::kEFixForceISO8859_15;
1292  //DVB-T Germany Ruhrgebiet Tele 5
1293  //fix[ 8707LL << 32 | 8468 << 16 | 16413] = EITFixUp::kEFixForceISO8859_15; // they are sending the ISO 8859-9 signalling now
1294  // ANIXE
1295  fix[ 8707LL << 32 | 8468U << 16 | 16426 ] = // DVB-T Rhein-Main
1297 
1298  // DVB-C Kabel Deutschland encoding fixes Germany
1299  fix[ 112LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1300  fix[ 10000LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1301  fix[ 10001LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1302  fix[ 10002LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1303  fix[ 10003LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1304  fix[ 10006LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1305  fix[ 10009LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1306  fix[ 10010LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
1307  // Mark program on the HD transponders as HDTV
1308  fix[ 10012LL << 32 | 61441U << 16] = EITFixUp::kFixHDTV;
1309  fix[ 10013LL << 32 | 61441U << 16] = EITFixUp::kFixHDTV;
1310  // On transport 10004 only DMAX needs no fixing:
1311  fix[10004LL<<32 | 61441U << 16 | 50403] = // BBC World Service
1312  fix[10004LL<<32 | 61441U << 16 | 53101] = // BBC Prime (engl)
1313  fix[10004LL<<32 | 61441U << 16 | 53108] = // Toon Disney (engl)
1314  fix[10004LL<<32 | 61441U << 16 | 53109] = // Sky News (engl)
1315  fix[10004LL<<32 | 61441U << 16 | 53406] = // BBC Prime
1316  fix[10004LL<<32 | 61441U << 16 | 53407] = // Boomerang (engl)
1317  fix[10004LL<<32 | 61441U << 16 | 53404] = // Boomerang
1318  fix[10004LL<<32 | 61441U << 16 | 53408] = // TCM Classic Movies (engl)
1319  fix[10004LL<<32 | 61441U << 16 | 53409] = // Extreme Sports
1320  fix[10004LL<<32 | 61441U << 16 | 53410] = // CNBC Europe (engl)
1321  fix[10004LL<<32 | 61441U << 16 | 53503] = // Detski Mir
1322  fix[10004LL<<32 | 61441U << 16 | 53411] = // Sat.1 Comedy
1323  fix[10004LL<<32 | 61441U << 16 | 53412] = // kabel eins classics
1324  fix[10004LL<<32 | 61441U << 16 | 53112] = // Extreme Sports (engl)
1325  fix[10004LL<<32 | 61441U << 16 | 53513] = // Playhouse Disney (engl)
1326  fix[10004LL<<32 | 61441U << 16 | 53618] = // K1010
1327  fix[10004LL<<32 | 61441U << 16 | 53619] = // GemsTV
1329  // On transport 10005 QVC and Giga Digital needs no fixing:
1330  fix[10005LL<<32 | 61441U << 16 | 50104] = // E! Entertainment
1331  fix[10005LL<<32 | 61441U << 16 | 50107] = // 13th Street (KD)
1332  fix[10005LL<<32 | 61441U << 16 | 50301] = // ESPN Classic
1333  fix[10005LL<<32 | 61441U << 16 | 50302] = // VH1 Classic
1334  fix[10005LL<<32 | 61441U << 16 | 50303] = // Wein TV
1335  fix[10005LL<<32 | 61441U << 16 | 50304] = // AXN
1336  fix[10005LL<<32 | 61441U << 16 | 50305] = // Silverline
1337  fix[10005LL<<32 | 61441U << 16 | 50306] = // NASN
1338  fix[10005LL<<32 | 61441U << 16 | 50307] = // Disney Toon
1339  fix[10005LL<<32 | 61441U << 16 | 53105] = // NASN (engl)
1340  fix[10005LL<<32 | 61441U << 16 | 53115] = // VH1 Classic (engl)
1341  fix[10005LL<<32 | 61441U << 16 | 53405] = // ESPN Classic (engl)
1342  fix[10005LL<<32 | 61441U << 16 | 53402] = // AXN (engl)
1343  fix[10005LL<<32 | 61441U << 16 | 53613] = // CNN (engl)
1344  fix[10005LL<<32 | 61441U << 16 | 53516] = // Voyages Television
1345  fix[10005LL<<32 | 61441U << 16 | 53611] = // Der Schmuckkanal
1346  fix[10005LL<<32 | 61441U << 16 | 53104] = // Jukebox
1348  // On transport 10007 only following channels need fixing:
1349  fix[10007LL<<32| 61441U << 16 | 53607] = // Eurosport
1350  fix[10007LL<<32| 61441U << 16 | 53608] = // Das Vierte
1351  fix[10007LL<<32| 61441U << 16 | 53609] = // Viva
1352  fix[10007LL<<32| 61441U << 16 | 53628] = // COMEDY CENTRAL
1354  // RTL Subtitle parsing
1355  fix[10007LL<<32| 61441U << 16 | 53601] = // RTL
1356  fix[10007LL<<32| 61441U << 16 | 53602] = // Super RTL
1357  fix[10007LL<<32| 61441U << 16 | 53604] = // VOX
1358  fix[10007LL<<32| 61441U << 16 | 53606] = // n-tv
1360  // On transport 10008 only following channels need fixing:
1361  fix[ 10008LL<<32 | 61441U << 16 | 53002] = // Tele 5
1363 
1364  // DVB-C Unitymedia Germany
1365  fix[ 9999 << 16 | 161LL << 32 | 12101 ] = // RTL Television
1366  fix[ 9999 << 16 | 161LL << 32 | 12104 ] = // VOX
1367  fix[ 9999 << 16 | 161LL << 32 | 12107 ] = // Super RTL
1368  fix[ 9999 << 16 | 161LL << 32 | 12109 ] = // n-tv
1369  fix[ 9999 << 16 | 301LL << 32 | 30114 ] = // RTL NITRO
1371  fix[ 9999 << 16 | 191LL << 32 | 11102 ] = // DAS VIERTE
1373  // on this transport are only HD services, two TBD, arte and ServusTV, I think arte properly signals HD!
1374  fix[ 9999 << 16 | 401LL << 32 | 29109 ] = // ServusTV HD
1376  // generic Unitymedia / Liberty Global / Eventis.nl?
1377  fix[ 9999 << 16 | 121LL << 32 | 12107 ] = // Super RTL
1378  fix[ 9999 << 16 | 151LL << 32 | 15110 ] = // Bibel TV
1379  fix[ 9999 << 16 | 161LL << 32 | 12107 ] = // Super RTL
1380  fix[ 9999 << 16 | 161LL << 32 | 12109 ] = // n-tv
1381  fix[ 9999 << 16 | 171LL << 32 | 17119 ] = // RiC
1382  fix[ 9999 << 16 | 171LL << 32 | 27102 ] = // DELUXE MUSIC
1383  fix[ 9999 << 16 | 181LL << 32 | 24108 ] = // DMAX
1384  fix[ 9999 << 16 | 181LL << 32 | 25102 ] = // TV5MONDE Europe
1385  fix[ 9999 << 16 | 191LL << 32 | 11102 ] = // Disney SD
1386  fix[ 9999 << 16 | 191LL << 32 | 12110 ] = // N24
1387  fix[ 9999 << 16 | 191LL << 32 | 12111 ] = // Tele 5
1388  fix[ 9999 << 16 | 201LL << 32 | 27103 ] = // TLC
1389  fix[ 9999 << 16 | 211LL << 32 | 29108 ] = // Astro TV
1390  fix[ 9999 << 16 | 231LL << 32 | 23117 ] = // Deutsches Musik Fernsehen
1391  fix[ 9999 << 16 | 231LL << 32 | 23115 ] = // Family TV
1392  fix[ 9999 << 16 | 271LL << 32 | 27101 ] = // DIE NEUE ZEIT TV
1393  fix[ 9999 << 16 | 541LL << 32 | 54101 ] = // HR HD
1395 
1396  // DVB-S Astra 19.2E DMAX Germany
1397  fix[ 1113LL << 32 | 1 << 16 | 12602] = EITFixUp::kEFixForceISO8859_15;
1398 
1399  // Premiere
1400  fix[133 << 16] = EITFixUp::kEFixForceISO8859_15;
1401 
1402  // DVB-S Astra 19.2E French channels
1403  fix[ 1022LL << 32 | 1 << 16 | 6901 ] = // DIRECT 8
1404  fix[ 1022LL << 32 | 1 << 16 | 6905 ] = // France 24 (en Francais)
1405  fix[ 1022LL << 32 | 1 << 16 | 6911 ] = // DIRECT 8
1406  fix[ 1072LL << 32 | 1 << 16 | 8201 ] = // CANAL+
1407  fix[ 1070LL << 32 | 1 << 16 | 8004 ] = // EURONEWS
1408  fix[ 1091LL << 32 | 1 << 16 | 31220 ] = // EuroNews
1409  fix[ 1094LL << 32 | 1 << 16 | 17027 ] = // LCP
1410  fix[ 1094LL << 32 | 1 << 16 | 17028 ] = // NT1
1411  fix[ 1100LL << 32 | 1 << 16 | 8710 ] = // NRJ 12
1413 
1414  // DVB-C T-Kábel Hungary
1415  // FIXME this should be more specific. Is the encoding really wrong for all services?
1416  fix[ 100 << 16] = EITFixUp::kEFixForceISO8859_2;
1417 
1418  // DVB-T Greece
1419  // Pelion Transmitter
1420  // transport_id<<32 | netword_id<<16 | service_id
1421  fix[ 100LL << 32 | 8492LL << 16 ] = // Ant1,Alpha,Art,10E
1422  fix[ 102LL << 32 | 8492LL << 16 ] = // Mega,Star,SKAI,M.tv
1423  fix[ 320LL << 32 | 8492LL << 16 ] = // Astra,Thessalia,TRT,TV10,ZEYS
1426  fix[ 2LL << 32 | 8492LL << 16 ] = // N1,Nplus,NHD,Vouli
1427  EITFixUp::kEFixForceISO8859_7 | // it is encoded in cp-1253
1428  EITFixUp::kFixGreekSubtitle | // Subtitle has too much info and is
1429  EITFixUp::kFixGreekEIT | // cut in db. Will move to descr.
1431 
1432  // DVB-S Star One C2 70W (Brazil)
1433  // it has original_network_id = 1 like Astra on 19.2E, but transport_id does
1434  // not collide at the moment
1435  fix[ 1LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1436  fix[ 2LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1437  fix[ 3LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1438  fix[ 4LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1439  fix[ 50LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1440  fix[ 51LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1441  fix[ 52LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1442  fix[ 53LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1443  fix[ 54LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1444  fix[ 55LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1445  fix[ 56LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1446  fix[ 57LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1447  fix[ 58LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1448  fix[ 59LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1449 }
1450 
1456 {
1459  maxStarttime, "EITScanner");
1460  seenEITother = false;
1461  maxStarttime = QDateTime();
1462 }
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:810
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 Version(void) const
Definition: mpegtables.h:503
ProgramInfo::CategoryType GetMythCategory(uint i) const
QMap< QString, QString > Items(void) const
uint TSID(void) const
Definition: dvbtables.h:308
DishThemeType GetTheme(void) const
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:915
static uint get_chan_id_from_db_dtv(uint sourceid, uint programnumber, uint tunedchanid)
Definition: eithelper.cpp:1019
uint GetChanID(uint atsc_major, uint atsc_minor)
Definition: eithelper.cpp:872
void CompleteEvent(uint atsc_major, uint atsc_minor, const ATSCEvent &event, const QString &ett)
Definition: eithelper.cpp:833
uint SubtitleProperties(uint compression_type) const
QString EventName(void) const
static void init_fixup(FixupMap &fix)
Definition: eithelper.cpp:1064
#define GPS_EPOCH
Seconds between start of GPS time and the start of UNIX time.
Definition: mpegtables.h:28
QMap< FixupKey, FixupValue > FixupMap
Definition: eithelper.h:79
QMap< uint, uint > languagePreferences
Definition: eithelper.h:160
#define LOC
Definition: eithelper.cpp:35
unsigned char SubtitleType(void) const
const unsigned char * desc
Definition: eithelper.h:43
ExtendedTextTable contain additional text not contained in EventInformationTables.
Definition: atsctables.h:625
const char * subtitles[4]
Definition: vbilut.cpp:202
uint UserNibble(uint i) const
#define GPS_LEAP_SECONDS
Leap seconds as of June 30th, 2012.
Definition: mpegtables.h:31
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
int size(void) const
Definition: mythdbcon.h:187
QString ContentId(size_t n=0) const
const unsigned char * Descriptors(uint i) const
Definition: dvbtables.h:357
uint32_t length
Definition: eithelper.h:39
static uint get_chan_id_from_db_atsc(uint sourceid, uint atscmajor, uint atscminor)
Definition: eithelper.cpp:924
bool HasName(void) const
unsigned char VideoProperties(void) const
unsigned int uint
Definition: compat.h:136
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)
vector< const unsigned char * > desc_list_t
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
uint GetListSize(void) const
Definition: eithelper.cpp:55
void AddEIT(uint atsc_major, uint atsc_minor, const EventInformationTable *eit)
Definition: eithelper.cpp:145
uint EventCount() const
Definition: atsctables.h:553
QDateTime StartTimeUTC(uint i) const
Definition: dvbtables.h:331
QString Text(void) const
QString advisory(void) const
const QString season
Definition: eitfixup.cpp:21
Overall structure.
QVariant value(int i) const
Definition: mythdbcon.h:182
uint64_t FixupKey
Definition: eithelper.h:77
void WriteEITCache(void)
Definition: eithelper.cpp:824
uint EventCount() const
Definition: dvbtables.h:322
uint channelid
id of the channel
Definition: eithelper.h:150
QString seriesid(void) const
ATSCSRCToEvents incomplete_events
Definition: eithelper.h:155
def rating(profile, smoonURL, gate)
Definition: scan.py:25
MBASE_PUBLIC QDateTime fromSecsSinceEpoch(uint seconds)
This function takes the number of seconds since the start of the epoch and returns a QDateTime with t...
Definition: mythdate.cpp:88
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:83
uint ServiceID(void) const
Definition: dvbtables.h:305
uint ETMLocation(uint i) const
Definition: atsctables.h:579
uint32_t start_time
Definition: eithelper.h:38
static EITCache * eitcache
Definition: eithelper.h:144
QMap< uint, ATSCEtt > EventIDToETT
Definition: eithelper.h:72
void WriteToDB(void)
Definition: eitcache.cpp:315
uint DescriptorsLength(uint i) const
Definition: dvbtables.h:353
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
void AddETT(uint atsc_major, uint atsc_minor, const ExtendedTextTable *ett)
Definition: eithelper.cpp:190
bool isActive(void) const
Definition: mythdbcon.h:188
uint EventID(uint i) const
Definition: atsctables.h:558
QString Name(uint) const
uint OriginalNetworkID(void) const
Definition: dvbtables.h:312
int gps_offset
Definition: eithelper.h:146
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:555
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)
QString GetDescription(uint i) const
void SetSourceID(uint _sourceid)
Definition: eithelper.cpp:133
static const unsigned char * Find(const desc_list_t &parsed, uint desc_tag)
QDate originalairdate(void) const
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:421
ServiceToChanID srv_to_chanid
Definition: eithelper.h:141
uint Nibble2(uint i) const
bool seenEITother
if false we only reschedule the active mplex
Definition: eithelper.h:152
QString GetBestMatch(QMap< uint, uint > &langPrefs) const
QString Text(void) const
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
uint AudioProperties(uint compression_type) const
uint TableID(void) const
Definition: mpegtables.h:479
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:835
ATSCSRCToETTs unmatched_etts
Definition: eithelper.h:156
uint32_t PrivateDataSpecifier(void) const
uint StartTimeRaw(uint i) const
Definition: atsctables.h:563
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:38
bool IsNewEIT(uint chanid, uint tableid, uint version, uint eventid, uint endtime)
Definition: eitcache.cpp:344
const unsigned char * Descriptors(uint i) const
Definition: atsctables.h:607
uint LengthInSeconds(uint i) const
Definition: atsctables.h:584
virtual ~EITHelper(void)
Definition: eithelper.cpp:46
void PruneEITCache(uint timestamp)
Definition: eithelper.cpp:819
uint DurationInSeconds(uint i) const
Definition: dvbtables.h:342
time_t EndTimeUnixUTC(uint i) const
Definition: dvbtables.h:335
QString rating(void) const
QDateTime maxStarttime
latest starttime of changed events
Definition: eithelper.h:151
static const uint kChunkSize
Maximum number of DB inserts per ProcessEvents call.
Definition: eithelper.h:163
uint ContentType(size_t n=0) const
uint Nibble(uint i) const
uint EventID(uint i) const
Definition: dvbtables.h:326
uint EventID(void) const
Definition: atsctables.h:663
uint64_t FixupValue
Definition: eithelper.h:78
QString GetCategory(void) const
QString programid(void) const
const MultipleStringStructure ExtendedTextMessage() const
Definition: atsctables.h:667
static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid, uint networkid, uint transportid)
Definition: eithelper.cpp:950
void SetChannelID(uint _channelid)
Definition: eithelper.cpp:139
uint ContentEncoding(size_t n=0) const
uint DescriptorsLength(uint i) const
Definition: atsctables.h:599
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:623
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)
static desc_list_t FindAll(const desc_list_t &parsed, uint desc_tag)
MultipleStringStructure title(int i) const
Definition: atsctables.h:593
static desc_list_t Parse(const unsigned char *data, uint len)
unsigned char AudioProperties(void) const
const unsigned char * Descriptors() const
void Fix(DBEventEIT &event) const
Definition: eitfixup.cpp:247
QMap< uint, ATSCEvent > EventIDToATSCEvent
Definition: eithelper.h:71
QString rating(void) const
void RescheduleRecordings(void)
Tells scheduler about programming changes.
Definition: eithelper.cpp:1455
uint Nibble1(uint i) const
void SetFixup(uint atsc_major, uint atsc_minor, FixupValue eitfixup)
Definition: eithelper.cpp:109
QString advisory(void) const