MythTV  master
eithelper.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 // Std C++ headers
4 #include <algorithm>
5 
6 // MythTV includes
7 #include "libmythbase/compat.h" // for gmtime_r on windows.
8 #include "libmythbase/mythdate.h"
9 #include "libmythbase/mythdb.h"
10 #include "libmythbase/programinfo.h" // for subtitle types and audio and video properties
11 
12 #include "channelutil.h"
13 #include "eitcache.h"
14 #include "eitfixup.h"
15 #include "eithelper.h"
16 #include "mpeg/atsctables.h"
17 #include "mpeg/dishdescriptors.h"
18 #include "mpeg/dvbtables.h"
20 #include "mpeg/premieretables.h"
21 #include "programdata.h"
22 #include "scheduledrecording.h" // for ScheduledRecording
23 
24 const uint EITHelper::kMaxQueueSize = 10000;
25 
27 
28 static uint get_chan_id_from_db_atsc(uint sourceid,
29  uint atsc_major, uint atsc_minor);
30 static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid,
31  uint networkid, uint transportid);
32 static uint get_chan_id_from_db_dtv(uint sourceid,
33  uint serviceid, uint tunedchanid);
34 static void init_fixup(FixupMap &fix);
35 
36 #define LOC QString("EITHelper: ")
37 #define LOC_ID QString("EITHelper[%1]: ").arg(m_cardnum)
38 
40  m_cardnum(cardnum)
41 {
42  m_chunkSize = gCoreContext->GetNumSetting("EITEventChunkSize", 20);
43  m_queueSize = std::min(m_chunkSize * 50, kMaxQueueSize);
44  LOG(VB_EIT, LOG_INFO, LOC_ID +
45  QString("EITHelper chunk size %1 and queue size %2 events")
46  .arg(m_chunkSize).arg(m_queueSize));
47 
48  // Save EIT cache in database table eit_cache iff true
49  bool persistent = gCoreContext->GetBoolSetting("EITCachePersistent", true);
50  s_eitCache->SetPersistent(persistent);
51  LOG(VB_EIT, LOG_INFO, LOC_ID +
52  QString("EITCache %1")
53  .arg(persistent ? "in memory, backup to database" : "in memory only"));
54 
56 }
57 
59 {
60  QMutexLocker locker(&m_eitListLock);
61  while (!m_dbEvents.empty())
62  delete m_dbEvents.dequeue();
63 }
64 
66 {
67  QMutexLocker locker(&m_eitListLock);
68  return m_dbEvents.size();
69 }
70 
71 bool EITHelper::EventQueueFull(void) const
72 {
73  uint listsize = GetListSize();
74  bool full = listsize > m_queueSize;
75  return full;
76 }
77 
87 {
88  QMutexLocker locker(&m_eitListLock);
89 
90  if (m_dbEvents.empty())
91  return 0;
92 
94 
95  uint eventCount = 0;
96  uint insertCount = 0;
97  for (; (eventCount < m_chunkSize) && (!m_dbEvents.empty()); eventCount++)
98  {
99  DBEventEIT *event = m_dbEvents.dequeue();
100  m_eitListLock.unlock();
101 
102  EITFixUp::Fix(*event);
103 
104  insertCount += event->UpdateDB(query, 1000);
105  m_maxStarttime = std::max (m_maxStarttime, event->m_starttime);
106 
107  delete event;
108  m_eitListLock.lock();
109  }
110 
111  if (!insertCount)
112  return 0;
113 
114  if (!m_incompleteEvents.empty())
115  {
116  LOG(VB_EIT, LOG_DEBUG, LOC_ID +
117  QString("Added %1 events -- complete: %2 incomplete: %3")
118  .arg(insertCount).arg(m_dbEvents.size())
119  .arg(m_incompleteEvents.size()));
120  }
121  else
122  {
123  LOG(VB_EIT, LOG_DEBUG, LOC_ID +
124  QString("Added %1/%2 events, queued: %3")
125  .arg(insertCount).arg(eventCount).arg(m_dbEvents.size()));
126  }
127 
128  return insertCount;
129 }
130 
131 void EITHelper::SetFixup(uint atsc_major, uint atsc_minor, FixupValue eitfixup)
132 {
133  QMutexLocker locker(&m_eitListLock);
134  FixupKey atsc_key = (atsc_major << 16) | atsc_minor;
135  m_fixup[atsc_key] = eitfixup;
136 }
137 
138 void EITHelper::SetLanguagePreferences(const QStringList &langPref)
139 {
140  QMutexLocker locker(&m_eitListLock);
141 
142  uint priority = 1;
143  QStringList::const_iterator it;
144  for (it = langPref.begin(); it != langPref.end(); ++it)
145  {
146  if (!(*it).isEmpty())
147  {
148  uint language_key = iso639_str3_to_key(*it);
149  uint canonoical_key = iso639_key_to_canonical_key(language_key);
150  m_languagePreferences[canonoical_key] = priority++;
151  }
152  }
153 }
154 
156 {
157  QMutexLocker locker(&m_eitListLock);
158  m_sourceid = sourceid;
159 }
160 
162 {
163  QMutexLocker locker(&m_eitListLock);
164  m_channelid = channelid;
165 }
166 
167 void EITHelper::AddEIT(uint atsc_major, uint atsc_minor,
168  const EventInformationTable *eit)
169 {
170  uint atsc_key = (atsc_major << 16) | atsc_minor;
171  EventIDToATSCEvent &events = m_incompleteEvents[atsc_key];
172 
173  for (uint i = 0; i < eit->EventCount(); i++)
174  {
175  ATSCEvent ev(eit->StartTimeRaw(i), eit->LengthInSeconds(i),
176  eit->ETMLocation(i),
178  eit->Descriptors(i), eit->DescriptorsLength(i));
179 
180  // Create an event immediately if the ETM_location specifies
181  // that there is no ETT event coming; otherwise save the EIT
182  // event in the incomplete_events for this channel.
183  if (!ev.m_etm)
184  {
185  CompleteEvent(atsc_major, atsc_minor, ev, "");
186  }
187  else
188  {
189  // If there is an existing EIT event with this event_id then
190  // delete the descriptor to avoid a memory leak.
191  EventIDToATSCEvent::iterator it = events.find(eit->EventID(i));
192  if (it != events.end())
193  {
194  delete [] (*it).m_desc;
195  }
196 
197  // Save the EIT event in the incomplete_events for this channel.
198  auto *tmp = new unsigned char[ev.m_descLength];
199  memcpy(tmp, eit->Descriptors(i), ev.m_descLength);
200  ev.m_desc = tmp;
201  events.insert(eit->EventID(i), ev);
202  }
203  }
204 }
205 
206 void EITHelper::AddETT(uint atsc_major, uint atsc_minor,
207  const ExtendedTextTable *ett)
208 {
209  // Find the matching incomplete EIT event for this ETT
210  // If we have no EIT event then just discard the ETT.
211  uint atsc_key = (atsc_major << 16) | atsc_minor;
212  ATSCSRCToEvents::iterator eits_it = m_incompleteEvents.find(atsc_key);
213  if (eits_it != m_incompleteEvents.end())
214  {
215  EventIDToATSCEvent::iterator it = (*eits_it).find(ett->EventID());
216  if (it != (*eits_it).end())
217  {
218  // Only consider EIT events from the very recent past.
219  if (!it->IsStale()) {
221  atsc_major, atsc_minor, *it,
223  }
224 
225  // Remove EIT event from the incomplete_event list.
226  delete [] (*it).m_desc;
227  (*eits_it).erase(it);
228  }
229  }
230 }
231 
233  QMap<uint,uint> languagePreferences,
234  QString &title, QString &subtitle,
235  QString &description, QMultiMap<QString,QString> &items)
236 {
237  const unsigned char *bestShortEvent =
239  list, DescriptorID::short_event, languagePreferences);
240 
241  // from EN 300 468, Appendix A.2 - Selection of character table
242  const enc_override enc_1 { 0x10, 0x00, 0x01 };
243  const enc_override enc_2 { 0x10, 0x00, 0x02 };
244  const enc_override enc_7 { 0x10, 0x00, 0x07 }; // Latin/Greek Alphabet
245  const enc_override enc_9 { 0x10, 0x00, 0x09 }; // could use { 0x05 } instead
246  const enc_override enc_15 { 0x10, 0x00, 0x0f }; // could use { 0x0B } instead
247  const enc_override enc_none {};
248  enc_override enc = enc_none;
249 
250  // Is this BellExpressVU EIT (Canada) ?
251  // Use an encoding override of ISO 8859-1 (Latin1)
253  {
254  enc = enc_1;
255  }
256 
257  // Is this broken DVB provider in Central Europe?
258  // Use an encoding override of ISO 8859-2 (Latin2)
260  {
261  enc = enc_2;
262  }
263 
264  // Is this broken DVB provider in Western Europe?
265  // Use an encoding override of ISO 8859-9 (Latin5)
267  {
268  enc = enc_9;
269  }
270 
271  // Is this broken DVB provider in Western Europe?
272  // Use an encoding override of ISO 8859-15 (Latin9)
274  {
275  enc = enc_15;
276  }
277 
278  // Is this broken DVB provider in Greece?
279  // Use an encoding override of ISO 8859-7 (Latin/Greek)
281  {
282  enc = enc_7;
283  }
284 
285  if (bestShortEvent)
286  {
287  ShortEventDescriptor sed(bestShortEvent);
288  if (sed.IsValid())
289  {
290  title = sed.EventName(enc);
291  subtitle = sed.Text(enc);
292  }
293  }
294 
295  std::vector<const unsigned char*> bestExtendedEvents =
297  list, DescriptorID::extended_event, languagePreferences);
298 
299  description = "";
300  for (auto & best_event : bestExtendedEvents)
301  {
302  if (!best_event)
303  {
304  description = "";
305  break;
306  }
307 
308  ExtendedEventDescriptor eed(best_event);
309  if (eed.IsValid())
310  {
311  description += eed.Text(enc);
312  }
313  // add items from the descriptor to the items
314  items.unite (eed.Items());
315  }
316 }
317 
318 static inline void parse_dvb_component_descriptors(const desc_list_t& list,
319  unsigned char &subtitle_type,
320  unsigned char &audio_properties,
321  unsigned char &video_properties)
322 {
323  desc_list_t components =
325  for (auto & comp : components)
326  {
327  ComponentDescriptor component(comp);
328  if (!component.IsValid())
329  continue;
330  video_properties |= component.VideoProperties();
331  audio_properties |= component.AudioProperties();
332  subtitle_type |= component.SubtitleType();
333  }
334 }
335 
337 {
338  // Discard event if incoming event queue full
339  if (EventQueueFull())
340  return;
341 
342  uint chanid = 0;
343  if ((eit->TableID() == TableID::PF_EIT) ||
344  ((eit->TableID() >= TableID::SC_EITbeg) && (eit->TableID() <= TableID::SC_EITend)))
345  {
346  // EITa(ctive)
347  chanid = GetChanID(eit->ServiceID());
348  }
349  else
350  {
351  // EITo(ther)
352  chanid = GetChanID(eit->ServiceID(), eit->OriginalNetworkID(), eit->TSID());
353  // do not reschedule if its only present+following
354  if (eit->TableID() != TableID::PF_EITo)
355  {
356  m_seenEITother = true;
357  }
358  }
359  if (!chanid)
360  return;
361 
362  uint descCompression = (eit->TableID() > 0x80) ? 2 : 1;
363  FixupValue fix = m_fixup.value((FixupKey)eit->OriginalNetworkID() << 16);
364  fix |= m_fixup.value((((FixupKey)eit->TSID()) << 32) |
365  ((FixupKey)eit->OriginalNetworkID() << 16));
366  fix |= m_fixup.value(((FixupKey)eit->OriginalNetworkID() << 16) |
367  (FixupKey)eit->ServiceID());
368  fix |= m_fixup.value((((FixupKey)eit->TSID()) << 32) |
369  ((FixupKey)eit->OriginalNetworkID() << 16) |
370  (FixupKey)eit->ServiceID());
372 
373  uint tableid = eit->TableID();
374  uint version = eit->Version();
375  for (uint i = 0; i < eit->EventCount(); i++)
376  {
377  // Skip event if we have already processed it before...
378  if (!s_eitCache->IsNewEIT(chanid, tableid, version, eit->EventID(i),
379  eit->EndTimeUnixUTC(i)))
380  {
381  continue;
382  }
383 
384  QString title = QString("");
385  QString subtitle = QString("");
386  QString description = QString("");
387  QString category = QString("");
389  unsigned char subtitle_type=0;
390  unsigned char audio_props=0;
391  unsigned char video_props=0;
392  uint season = 0;
393  uint episode = 0;
394  uint totalepisodes = 0;
395  QMultiMap<QString,QString> items;
396 
397  // Parse descriptors
399  eit->Descriptors(i), eit->DescriptorsLength(i));
400 
401  const unsigned char *dish_event_name = nullptr;
402  if (EITFixUp::kFixDish & fix)
403  {
404  dish_event_name = MPEGDescriptor::Find(
406  }
407 
408  if (dish_event_name)
409  {
410  DishEventNameDescriptor dend(dish_event_name);
411  if (dend.IsValid() && dend.HasName())
412  title = dend.Name(descCompression);
413 
414  const unsigned char *dish_event_description =
417  if (dish_event_description)
418  {
419  DishEventDescriptionDescriptor dedd(dish_event_description);
420  if (dedd.IsValid() && dedd.HasDescription())
421  description = dedd.Description(descCompression);
422  }
423  }
424  else
425  {
427  title, subtitle, description, items);
428  }
429 
430  parse_dvb_component_descriptors(list, subtitle_type, audio_props,
431  video_props);
432 
433  QString programId = QString("");
434  QString seriesId = QString("");
435  QString rating = QString("");
436  QString rating_system = QString("");
437  QString advisory = QString("");
438  float stars = 0.0;
439  QDate originalairdate;
440 
441  if (EITFixUp::kFixDish & fix)
442  {
443  const unsigned char *mpaa_data = MPEGDescriptor::Find(
445  if (mpaa_data)
446  {
447  DishEventMPAADescriptor mpaa(mpaa_data);
448  if (mpaa.IsValid())
449  stars = mpaa.stars();
450 
451  if (stars != 0.0F) // Only movies for now
452  {
453  rating = mpaa.rating();
454  rating_system = "MPAA";
455  advisory = mpaa.advisory();
456  }
457  }
458 
459  if (stars == 0.0F) // Not MPAA rated, check VCHIP
460  {
461  const unsigned char *vchip_data = MPEGDescriptor::Find(
463  if (vchip_data)
464  {
465  DishEventVCHIPDescriptor vchip(vchip_data);
466  rating = vchip.rating();
467  rating_system = "VCHIP";
468  advisory = vchip.advisory();
469  }
470  }
471 
472  if (!advisory.isEmpty() && !rating.isEmpty())
473  rating += ", " + advisory;
474  else if (!advisory.isEmpty())
475  {
476  rating = advisory;
477  rating_system = "advisory";
478  }
479 
480  const unsigned char *tags_data = MPEGDescriptor::Find(
482  if (tags_data)
483  {
484  DishEventTagsDescriptor tags(tags_data);
485  seriesId = tags.seriesid();
486  programId = tags.programid();
487  originalairdate = tags.originalairdate(); // future use
488 
489  if (programId.startsWith("MV") || programId.startsWith("SP"))
490  seriesId = "";
491  }
492 
493  const unsigned char *properties_data = MPEGDescriptor::Find(
495  if (properties_data)
496  {
497  DishEventPropertiesDescriptor properties(properties_data);
498  subtitle_type |= properties.SubtitleProperties(descCompression);
499  audio_props |= properties.AudioProperties(descCompression);
500  }
501  }
502 
503  const unsigned char *content_data =
505  if (content_data)
506  {
507  if ((EITFixUp::kFixDish & fix) || (EITFixUp::kFixBell & fix))
508  {
509  DishContentDescriptor content(content_data);
510  switch (content.GetTheme())
511  {
512  case kThemeMovie :
513  category_type = ProgramInfo::kCategoryMovie;
514  break;
515  case kThemeSeries :
516  category_type = ProgramInfo::kCategorySeries;
517  break;
518  case kThemeSports :
519  category_type = ProgramInfo::kCategorySports;
520  break;
521  default :
522  category_type = ProgramInfo::kCategoryNone;
523  }
524  if (EITFixUp::kFixDish & fix)
525  category = content.GetCategory();
526  }
527  else if (EITFixUp::kFixAUDescription & fix)//AU Freeview assigned genres
528  {
529  static const std::array<const std::string,16> s_auGenres
530  {/* 0*/"Unknown", "Movie", "News", "Entertainment",
531  /* 4*/"Sport", "Children", "Music", "Arts/Culture",
532  /* 8*/"Current Affairs", "Education", "Infotainment",
533  /*11*/"Special", "Comedy", "Drama", "Documentary",
534  /*15*/"Unknown"};
535  ContentDescriptor content(content_data);
536  if (content.IsValid())
537  {
538  category = QString::fromStdString(s_auGenres[content.Nibble1(0)]);
539  category_type = content.GetMythCategory(0);
540  }
541  }
542  else if (EITFixUp::kFixGreekEIT & fix)//Greek
543  {
544  static const std::array<const std::string,16>s_grGenres
545  {/* 0*/"Unknown", "Ταινία", "Ενημερωτικό", "Unknown",
546  /* 4*/"Αθλητικό", "Παιδικό", "Unknown", "Unknown",
547  /* 8*/"Unknown", "Ντοκιμαντέρ", "Unknown", "Unknown",
548  /*12*/"Unknown", "Unknown", "Unknown", "Unknown"};
549  ContentDescriptor content(content_data);
550  if (content.IsValid())
551  {
552  category = QString::fromStdString(s_grGenres[content.Nibble2(0)]);
553  category_type = content.GetMythCategory(2);
554  }
555  }
556  else
557  {
558  ContentDescriptor content(content_data);
559  if (content.IsValid())
560  {
561  category = content.GetDescription(0);
562 #if 0 /* there is no category_type in DVB EIT */
563  category_type = content.GetMythCategory(0);
564 #endif
565  }
566  }
567  }
568 
569  desc_list_t contentIds =
571  for (auto & id : contentIds)
572  {
574  if (!desc.IsValid())
575  continue;
576  for (size_t k = 0; k < desc.CRIDCount(); k++)
577  {
578  if (desc.ContentEncoding(k) == 0)
579  {
580  // The CRID is a URI. It could contain UTF8 sequences encoded
581  // as %XX but there's no advantage in decoding them.
582  // The BBC currently uses private types 0x31 and 0x32.
583  // IDs from the authority eventis.nl are not fit for our scheduler
584  if (desc.ContentType(k) == 0x01 || desc.ContentType(k) == 0x31)
585  {
586  if (!desc.ContentId(k).startsWith ("eventis.nl/"))
587  {
588  programId = desc.ContentId(k);
589  }
590  }
591  else if (desc.ContentType(k) == 0x02 || desc.ContentType(k) == 0x32)
592  {
593  if (!desc.ContentId(k).startsWith ("eventis.nl/"))
594  {
595  seriesId = desc.ContentId(k);
596  }
597  category_type = ProgramInfo::kCategorySeries;
598  }
599  }
600  }
601  }
602 
603  /* if we don't have a subtitle, try to parse one from private descriptors */
604  if (subtitle.isEmpty()) {
605  bool isUPC = false;
606  /* is this event carrying UPC private data? */
608  for (auto & specifier : private_data_specifiers) {
609  PrivateDataSpecifierDescriptor desc(specifier);
610  if (!desc.IsValid())
611  continue;
613  isUPC = true;
614  }
615  }
616 
617  if (isUPC) {
619  for (auto & st : subtitles) {
621  if (!desc.IsValid())
622  continue;
623  subtitle = desc.Text();
624  }
625  }
626  }
627 
628 
629  QDateTime starttime = eit->StartTimeUTC(i);
630  // fix starttime only if the duration is a multiple of a minute
631  if (!(eit->DurationInSeconds(i) % 60))
632  EITFixUp::TimeFix(starttime);
633  QDateTime endtime = starttime.addSecs(eit->DurationInSeconds(i));
634 
635  auto *event = new DBEventEIT(
636  chanid,
637  title, subtitle, description,
638  category, category_type,
639  starttime, endtime, fix,
640  subtitle_type,
641  audio_props,
642  video_props, stars,
643  seriesId, programId,
644  season, episode, totalepisodes);
645  event->m_items = items;
646 
647  m_dbEvents.enqueue(event);
648  }
649 }
650 
651 // This function gets special EIT data from the German provider Premiere
652 // for the option channels Premiere Sport and Premiere Direkt
654 {
655  // Discard event if incoming event queue full
656  if (EventQueueFull())
657  return;
658 
659  // set fixup for Premiere
660  FixupValue fix = m_fixup.value(133 << 16);
662 
663  QString title = QString("");
664  QString subtitle = QString("");
665  QString description = QString("");
666  QString category = QString("");
668  unsigned char subtitle_type=0;
669  unsigned char audio_props=0;
670  unsigned char video_props=0;
671  uint season = 0;
672  uint episode = 0;
673  uint totalepisodes = 0;
674  QMultiMap<QString,QString> items;
675 
676  // Parse descriptors
678  cit->Descriptors(), cit->DescriptorsLength());
679 
681  title, subtitle, description, items);
682 
683  parse_dvb_component_descriptors(list, subtitle_type, audio_props,
684  video_props);
685 
686  const unsigned char *content_data =
688  if (content_data)
689  {
690  ContentDescriptor content(content_data);
691  // fix events without real content data
692  if (content.IsValid() && (content.Nibble(0)==0x00))
693  {
694  if(content.UserNibble(0)==0x1)
695  {
696  category_type = ProgramInfo::kCategoryMovie;
697  }
698  else if(content.UserNibble(0)==0x0)
699  {
700  category_type = ProgramInfo::kCategorySports;
701  category = QObject::tr("Sports");
702  }
703  }
704  else
705  {
706  category_type = content.GetMythCategory(0);
707  category = content.GetDescription(0);
708  }
709  }
710 
711  uint tableid = cit->TableID();
712  uint version = cit->Version();
713  uint contentid = cit->ContentID();
714  // fake endtime
715  uint endtime = MythDate::current().addDays(1).toSecsSinceEpoch();
716 
717  // Find Transmissions
718  desc_list_t transmissions =
721  for (auto & trans : transmissions)
722  {
723  PremiereContentTransmissionDescriptor transmission(trans);
724  if (!transmission.IsValid())
725  continue;
726  uint networkid = transmission.OriginalNetworkID();
727  uint tsid = transmission.TSID();
728  uint serviceid = transmission.ServiceID();
729 
730  uint chanid = GetChanID(serviceid, networkid, tsid);
731 
732  if (!chanid)
733  {
734  LOG(VB_EIT, LOG_INFO, LOC_ID +
735  QString("Premiere EIT for NIT %1, TID %2, SID %3, "
736  "count %4, title: %5. Channel not found!")
737  .arg(networkid).arg(tsid).arg(serviceid)
738  .arg(transmission.TransmissionCount()).arg(title));
739  continue;
740  }
741 
742  // Skip event if we have already processed it before...
743  if (!s_eitCache->IsNewEIT(chanid, tableid, version, contentid, endtime))
744  {
745  continue;
746  }
747 
748  for (uint k=0; k<transmission.TransmissionCount(); ++k)
749  {
750  QDateTime txstart = transmission.StartTimeUTC(k);
751  // fix txstart only if the duration is a multiple of a minute
752  if (!(cit->DurationInSeconds() % 60))
753  EITFixUp::TimeFix(txstart);
754  QDateTime txend = txstart.addSecs(cit->DurationInSeconds());
755 
756  auto *event = new DBEventEIT(
757  chanid,
758  title, subtitle, description,
759  category, category_type,
760  txstart, txend, fix,
761  subtitle_type,
762  audio_props,
763  video_props, 0.0,
764  "", "",
765  season, episode, totalepisodes);
766  event->m_items = items;
767 
768  m_dbEvents.enqueue(event);
769  }
770  }
771 }
772 
773 
775 {
776  s_eitCache->PruneOldEntries(timestamp);
777 }
778 
780 {
782 }
783 
785 // private methods and functions below this line //
787 
788 void EITHelper::CompleteEvent(uint atsc_major, uint atsc_minor,
789  const ATSCEvent &event,
790  const QString &ett)
791 {
792  // Discard event if incoming event queue full
793  if (EventQueueFull())
794  return;
795 
796  uint chanid = GetChanID(atsc_major, atsc_minor);
797  if (!chanid)
798  return;
799 
800  QDateTime starttime = MythDate::fromSecsSinceEpoch(
801  event.m_startTime + GPS_EPOCH + m_gpsOffset);
802 
803  // fix starttime only if the duration is a multiple of a minute
804  if (!(event.m_length % 60))
805  EITFixUp::TimeFix(starttime);
806  QDateTime endtime = starttime.addSecs(event.m_length);
807 
809  unsigned char subtitle_type =
811  SUB_HARDHEAR : SUB_UNKNOWN;
812  unsigned char audio_properties = AUD_UNKNOWN;
813  unsigned char video_properties = VID_UNKNOWN;
814 
815  uint atsc_key = (atsc_major << 16) | atsc_minor;
816 
817  QMutexLocker locker(&m_eitListLock);
818  QString title = event.m_title;
819  const QString& subtitle = ett;
820  m_dbEvents.enqueue(new DBEventEIT(chanid, title, subtitle,
821  starttime, endtime,
822  m_fixup.value(atsc_key), subtitle_type,
823  audio_properties, video_properties));
824 }
825 
826 uint EITHelper::GetChanID(uint atsc_major, uint atsc_minor)
827 {
828  uint sourceid = m_sourceid;
829  if (sourceid == 0)
830  return 0;
831 
832  uint64_t key = sourceid;
833  key |= ((uint64_t) atsc_minor) << 16;
834  key |= ((uint64_t) atsc_major) << 32;
835 
836  ServiceToChanID::const_iterator it = m_srvToChanid.constFind(key);
837  if (it != m_srvToChanid.constEnd())
838  return *it;
839 
840  uint chanid = get_chan_id_from_db_atsc(sourceid, atsc_major, atsc_minor);
841  m_srvToChanid[key] = chanid;
842 
843  return chanid;
844 }
845 
846 uint EITHelper::GetChanID(uint serviceid, uint networkid, uint tsid)
847 {
848  uint sourceid = m_sourceid;
849  if (sourceid == 0)
850  return 0;
851 
852  uint64_t key = sourceid;
853  key |= ((uint64_t) serviceid) << 16;
854  key |= ((uint64_t) networkid) << 32;
855  key |= ((uint64_t) tsid) << 48;
856 
857  ServiceToChanID::const_iterator it = m_srvToChanid.constFind(key);
858  if (it != m_srvToChanid.constEnd())
859  return *it;
860 
861  uint chanid = get_chan_id_from_db_dvb(sourceid, serviceid, networkid, tsid);
862  m_srvToChanid[key] = chanid;
863 
864  return chanid;
865 }
866 
868 {
869  uint sourceid = m_sourceid;
870  if (sourceid == 0)
871  return 0;
872 
873  uint64_t key = sourceid;
874  key |= ((uint64_t) program_number) << 16;
875  key |= ((uint64_t) m_channelid) << 32;
876 
877  ServiceToChanID::const_iterator it = m_srvToChanid.constFind(key);
878  if (it != m_srvToChanid.constEnd())
879  return *it;
880 
881  uint chanid = get_chan_id_from_db_dtv(sourceid, program_number, m_channelid);
882  m_srvToChanid[key] = chanid;
883 
884  return chanid;
885 }
886 
888  uint atsc_major, uint atsc_minor)
889 {
890  MSqlQuery query(MSqlQuery::InitCon());
891  query.prepare(
892  "SELECT chanid, useonairguide "
893  "FROM channel "
894  "WHERE deleted IS NULL AND "
895  " atsc_major_chan = :MAJORCHAN AND "
896  " atsc_minor_chan = :MINORCHAN AND "
897  " sourceid = :SOURCEID");
898  query.bindValue(":MAJORCHAN", atsc_major);
899  query.bindValue(":MINORCHAN", atsc_minor);
900  query.bindValue(":SOURCEID", sourceid);
901 
902  if (!query.exec() || !query.isActive())
903  MythDB::DBError("Looking up chanid 1", query);
904  else if (query.next())
905  {
906  bool useOnAirGuide = query.value(1).toBool();
907  return (useOnAirGuide) ? query.value(0).toUInt() : 0;
908  }
909 
910  return 0;
911 }
912 
913 // Figure out the chanid for this channel
914 static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid,
915  uint networkid, uint transportid)
916 {
917  MSqlQuery query(MSqlQuery::InitCon());
918 
919  // DVB Link to chanid
920  QString qstr =
921  "SELECT chanid, useonairguide "
922  "FROM channel, dtv_multiplex "
923  "WHERE deleted IS NULL AND "
924  " serviceid = :SERVICEID AND "
925  " networkid = :NETWORKID AND "
926  " transportid = :TRANSPORTID AND "
927  " channel.sourceid = :SOURCEID AND "
928  " channel.mplexid = dtv_multiplex.mplexid";
929 
930  query.prepare(qstr);
931  query.bindValue(":SERVICEID", serviceid);
932  query.bindValue(":NETWORKID", networkid);
933  query.bindValue(":TRANSPORTID", transportid);
934  query.bindValue(":SOURCEID", sourceid);
935 
936  if (!query.exec() || !query.isActive())
937  {
938  MythDB::DBError("Looking up chanID", query);
939  return 0;
940  }
941 
942  if (query.size() > 1)
943  {
944  LOG(VB_EIT, LOG_ERR, LOC +
945  QString("Found %1 channels for sourceid %1 networkid %2 "
946  "transportid %3 serviceid %4 but only one expected")
947  .arg(query.size())
948  .arg(sourceid).arg(networkid).arg(transportid).arg(serviceid));
949  }
950 
951  while (query.next())
952  {
953  uint chanid = query.value(0).toUInt();
954  bool useOnAirGuide = query.value(1).toBool();
955  return useOnAirGuide ? chanid : 0;
956  }
957 
958  // EIT information for channels that are not present such as encrypted
959  // channels when only FTA channels are selected etc.
960  LOG(VB_EIT, LOG_DEBUG, LOC +
961  QString("No channel found for sourceid %1 networkid %2 "
962  "transportid %3 serviceid %4")
963  .arg(sourceid).arg(networkid).arg(transportid).arg(serviceid));
964 
965  return 0;
966 }
967 
968 /* Figure out the chanid for this channel from the sourceid,
969  * program_number/service_id and the chanid of the channel we are tuned to
970  *
971  * TODO for SPTS (e.g. HLS / IPTV) it would be useful to match without an entry
972  * in dtv_multiplex
973  */
974 static uint get_chan_id_from_db_dtv(uint sourceid, uint serviceid,
975  uint tunedchanid)
976 {
977  uint db_sourceid = 0;
978  MSqlQuery query(MSqlQuery::InitCon());
979 
980  // DVB Link to chanid
981  QString qstr =
982  "SELECT c1.chanid, c1.useonairguide, c1.sourceid "
983  "FROM channel c1, dtv_multiplex m, channel c2 "
984  "WHERE c1.deleted IS NULL AND "
985  " c1.serviceid = :SERVICEID AND "
986  " c1.mplexid = m.mplexid AND "
987  " m.mplexid = c2.mplexid AND "
988  " c2.chanid = :CHANID";
989 
990  query.prepare(qstr);
991  query.bindValue(":SERVICEID", serviceid);
992  query.bindValue(":CHANID", tunedchanid);
993 
994  if (!query.exec() || !query.isActive())
995  {
996  MythDB::DBError("Looking up chanID", query);
997  return 0;
998  }
999 
1000  while (query.next())
1001  {
1002  // Check to see if we are interested in this channel
1003  uint chanid = query.value(0).toUInt();
1004  bool useOnAirGuide = query.value(1).toBool();
1005  db_sourceid = query.value(2).toUInt();
1006  if (sourceid == db_sourceid)
1007  return useOnAirGuide ? chanid : 0;
1008  }
1009 
1010  if (query.size() > 0)
1011  {
1012  LOG(VB_EIT, LOG_DEBUG,
1013  LOC + QString("Found %1 channels for multiplex of chanid %2, "
1014  "serviceid %3, sourceid %4 in database but none "
1015  "for current sourceid %5.")
1016  .arg(query.size()).arg(tunedchanid)
1017  .arg(serviceid).arg(db_sourceid).arg(sourceid));
1018  }
1019 
1020  return 0;
1021 }
1022 
1023 static void init_fixup(FixupMap &fix)
1024 {
1026  // Fixups to make EIT provided listings more useful
1027  // transport_id<<32 | original_network_id<<16 | service_id
1028 
1029  // Bell Express VU Canada
1030  fix[ 256U << 16] = EITFixUp::kFixBell;
1031  fix[ 257U << 16] = EITFixUp::kFixBell;
1032  fix[ 4100U << 16] = EITFixUp::kFixBell;
1033  fix[ 4101U << 16] = EITFixUp::kFixBell;
1034  fix[ 4102U << 16] = EITFixUp::kFixBell;
1035  fix[ 4103U << 16] = EITFixUp::kFixBell;
1036  fix[ 4104U << 16] = EITFixUp::kFixBell;
1037  fix[ 4105U << 16] = EITFixUp::kFixBell;
1038  fix[ 4106U << 16] = EITFixUp::kFixBell;
1039  fix[ 4107U << 16] = EITFixUp::kFixBell;
1040  fix[ 4097U << 16] = EITFixUp::kFixBell;
1041  fix[ 4098U << 16] = EITFixUp::kFixBell;
1042 
1043  // United Kingdom - DVB-T/T2
1044  fix[ 9018U << 16] = EITFixUp::kFixUK;
1045 
1046  // UK - Astra 28.2
1047  for (int i = 2001; i <= 2035; ++i)
1048  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1049 
1050  fix[ 2036LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1051 
1052  for (int i = 2037; i <= 2057; ++i)
1053  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1054  fix[ 2059LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1055  fix[ 2061LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1056  for (int i = 2063; i <= 2069; ++i)
1057  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1058  fix[ 2071LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1059  fix[ 2076LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1060  fix[ 2081LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1061  for (int i = 2089; i <= 2092; ++i)
1062  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1063  for (int i = 2094; i <= 2099; ++i)
1064  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1065  for (int i = 2102; i <= 2110; ++i)
1066  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1067  fix[ 2112LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1068  fix[ 2116LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1069  fix[ 2301LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1070  fix[ 2302LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1071  fix[ 2303LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1072  fix[ 2304LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1073  fix[ 2305LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1074  fix[ 2306LL << 32 | 2U << 16] = EITFixUp::kFixUK | EITFixUp::kFixHTML;
1075  fix[ 2311LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1076  fix[ 2312LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1077  fix[ 2313LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1078  fix[ 2314LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1079  fix[ 2315LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1080  fix[ 2316LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1081  for (int i = 2401; i <= 2413; ++i)
1082  fix[ (long long)i << 32 | 2U << 16] = EITFixUp::kFixUK;
1083  fix[ 2601LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1084  fix[ 2602LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1085  fix[ 2603LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1086  fix[ 2604LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1087  fix[ 2612LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1088  fix[ 2614LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1089  fix[ 2611LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1090  fix[ 2612LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1091  fix[ 2613LL << 32 | 2U << 16] = EITFixUp::kFixUK;
1092 
1093  // R.caroline
1094  fix[ 2315LL << 32 | 59U << 16] = EITFixUp::kFixUK;
1095 
1096  // ComHem Sweden
1097  fix[40999U << 16 ] = EITFixUp::kFixComHem;
1098  fix[40999U << 16 | 1070] = EITFixUp::kFixSubtitle;
1099  fix[40999U << 16 | 1308] = EITFixUp::kFixSubtitle;
1100  fix[40999U << 16 | 1041] = EITFixUp::kFixSubtitle;
1101  fix[40999U << 16 | 1306] = EITFixUp::kFixSubtitle;
1102  fix[40999U << 16 | 1307] = EITFixUp::kFixSubtitle;
1103  fix[40999U << 16 | 1030] = EITFixUp::kFixSubtitle;
1104  fix[40999U << 16 | 1016] = EITFixUp::kFixSubtitle;
1105  fix[40999U << 16 | 1131] = EITFixUp::kFixSubtitle;
1106  fix[40999U << 16 | 1068] = EITFixUp::kFixSubtitle;
1107  fix[40999U << 16 | 1069] = EITFixUp::kFixSubtitle;
1108 
1109  // Australia
1110  fix[ 4096U << 16] = EITFixUp::kFixAUStar;
1111  fix[ 4112U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUFreeview; // ABC Brisbane
1112  fix[ 4114U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUFreeview | EITFixUp::kFixAUNine;; // Nine Brisbane
1113  fix[ 4115U << 16] = EITFixUp::kFixAUDescription | EITFixUp::kFixAUSeven; //Seven
1114  fix[ 4116U << 16] = EITFixUp::kFixAUDescription; //Ten
1115  fix[ 12801U << 16] = EITFixUp::kFixAUFreeview | EITFixUp::kFixAUDescription; //ABC
1116  fix[ 12802U << 16] = EITFixUp::kFixAUDescription; //SBS
1118  fix[ 12842U << 16] = EITFixUp::kFixAUDescription; // 31 Brisbane
1119  fix[ 12862U << 16] = EITFixUp::kFixAUDescription; //WestTV
1120 
1121  // MultiChoice Africa
1122  fix[ 6144U << 16] = EITFixUp::kFixMCA;
1123 
1124  // RTL Subtitle parsing
1125  fix[ 1089LL << 32 | 1 << 16] = // DVB-S
1126  fix[ 1041LL << 32 | 1 << 16] = // DVB-S RTL Group HD Austria Transponder
1127  fix[ 1057LL << 32 | 1 << 16] = // DVB-S RTL Group HD Transponder
1129 
1130  // Mark HD+ channels as HDTV
1131  fix[ 1041LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1132  fix[ 1055LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1133  fix[ 1057LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1134  fix[ 1109LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
1135 
1136  // PRO7/SAT.1 DVB-S
1137  fix[ 1017LL << 32 | 1 << 16] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Austria transponder
1138  fix[ 1031LL << 32 | 1 << 16 | 5300] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // SAT.1 HD Austria
1139  fix[ 1031LL << 32 | 1 << 16 | 5301] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // ProSieben HD Austria
1140  fix[ 1031LL << 32 | 1 << 16 | 5302] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // kabel eins HD Austria
1141  fix[ 1031LL << 32 | 1 << 16 | 5303] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // PULS 4 HD Austria
1142  fix[ 1031LL << 32 | 1 << 16 | 5310] = EITFixUp::kFixP7S1; // SAT.1 Gold Austria
1143  fix[ 1031LL << 32 | 1 << 16 | 5311] = EITFixUp::kFixP7S1; // Pro7 MAXX Austria
1144  fix[ 1107LL << 32 | 1 << 16] = EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Germany transponder
1145  fix[ 1082LL << 32 | 1 << 16] = EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Switzerland transponder
1146  fix[ 5LL << 32 | 133 << 16 | 776] = EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Germany transponder
1147 
1148  // ATV / ATV2
1149  fix[ 1117LL << 32 | 1 << 16 | 13012 ] = EITFixUp::kFixATV; // ATV
1150  fix[ 1003LL << 32 | 1 << 16 | 13223 ] = EITFixUp::kFixATV; // ATV2
1151  fix[ 1003LL << 32 | 1 << 16 | 13228 ] = EITFixUp::kFixHDTV | EITFixUp::kFixATV; // ATV HD
1152 
1153  // Disney Channel Germany
1154  fix[ 1055LL << 32 | 1 << 16 | 5500 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Disney Channel HD
1155  fix[ 1055LL << 32 | 1 << 16 | 5510 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Disney Channel HD Austria
1156  fix[ 5LL << 32 | 133 << 16 | 1793 ] = EITFixUp::kFixDisneyChannel; // Disney Channel HD Austria
1157  fix[ 1109LL << 32 | 1 << 16 | 5401 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Tele 5 HD
1158  fix[ 1109LL << 32 | 1 << 16 | 5421 ] = EITFixUp::kFixHDTV | EITFixUp::kFixDisneyChannel; // Tele 5 HD Austria
1159  fix[ 33LL << 32 | 133 << 16 | 51 ] = EITFixUp::kFixDisneyChannel; // Tele 5
1160 
1161  // Premiere EIT processing
1162  fix[ 1LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1163  fix[ 2LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1164  fix[ 3LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1165  fix[ 4LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1166  fix[ 6LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1167  fix[ 8LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1168  fix[ 9LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1169  fix[ 10LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1170  fix[ 11LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1171  fix[ 12LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1172  fix[ 13LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1173  fix[ 14LL << 32 | 133 << 16] = EITFixUp::kFixPremiere | EITFixUp::kFixHDTV;
1174  fix[ 15LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1175  fix[ 17LL << 32 | 133 << 16] = EITFixUp::kFixPremiere;
1176  // Mark Premiere HD, AXN HD and Discovery HD as HDTV
1177  fix[ 6LL << 32 | 133 << 16 | 129] = EITFixUp::kFixHDTV;
1178  fix[ 6LL << 32 | 133 << 16 | 130] = EITFixUp::kFixHDTV;
1179  fix[ 10LL << 32 | 133 << 16 | 125] = EITFixUp::kFixHDTV;
1180 
1181  // Netherlands DVB-C
1182  fix[ 1000U << 16] = EITFixUp::kFixNL;
1183  // Canal Digitaal DVB-S 19.2 Dutch/Belgian ONID 53 covers all CanalDigitaal TiD
1184  fix[ 53U << 16] = EITFixUp::kFixNL;
1185  // Canal Digitaal DVB-S 23.5 Dutch/Belgian
1186  fix[ 3202LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1187  fix[ 3208LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1188  fix[ 3211LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1189  fix[ 3222LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1190  fix[ 3225LL << 32 | 3U << 16] = EITFixUp::kFixNL;
1191 
1192  // Finland
1193  fix[ 8438U << 16] = // DVB-T Espoo
1194  fix[ 42249U << 16] = // DVB-C Welho
1195  fix[ 15U << 16] = // DVB-C Welho
1197 
1198  // DVB-C YouSee (Denmark)
1199  fix[65024U << 16] = EITFixUp::kFixDK;
1200 
1201  // DVB-S(2) Thor 0.8W Norwegian
1202  fix[70U << 16] = EITFixUp::kFixNO;
1203 
1204  // DVB-T NTV/NRK (Norway)
1205  fix[910LL << 32 | 8770U << 16 | 0x006f] = EITFixUp::kFixNRK_DVBT; //NRK Folkemusikk
1206  fix[910LL << 32 | 8770U << 16 | 0x0070] = EITFixUp::kFixNRK_DVBT; //NRK Stortinget
1207  fix[910LL << 32 | 8770U << 16 | 0x0071] = EITFixUp::kFixNRK_DVBT; //NRK Super
1208  fix[910LL << 32 | 8770U << 16 | 0x0072] = EITFixUp::kFixNRK_DVBT; //NRK Sport
1209  fix[910LL << 32 | 8770U << 16 | 0x0073] = EITFixUp::kFixNRK_DVBT; //NRK Gull
1210  fix[910LL << 32 | 8770U << 16 | 0x0074] = EITFixUp::kFixNRK_DVBT; //NRK Jazz
1211  fix[910LL << 32 | 8770U << 16 | 0x0067] = EITFixUp::kFixNRK_DVBT; //NRK Super / NRK3
1212  fix[910LL << 32 | 8770U << 16 | 0x0068] = EITFixUp::kFixNRK_DVBT; //NRK Tegnspr�
1213  fix[910LL << 32 | 8770U << 16 | 0x0069] = EITFixUp::kFixNRK_DVBT; //NRK P2
1214  fix[910LL << 32 | 8770U << 16 | 0x006a] = EITFixUp::kFixNRK_DVBT; //NRK P3
1215  fix[910LL << 32 | 8770U << 16 | 0x006b] = EITFixUp::kFixNRK_DVBT; //NRK Alltid Nyheter
1216  fix[910LL << 32 | 8770U << 16 | 0x006c] = EITFixUp::kFixNRK_DVBT; //NRK mP3
1217  fix[910LL << 32 | 8770U << 16 | 0x006d] = EITFixUp::kFixNRK_DVBT; //NRK Klassisk
1218  fix[910LL << 32 | 8770U << 16 | 0x006e] = EITFixUp::kFixNRK_DVBT; //NRK S�i Radio
1219  fix[910LL << 32 | 8770U << 16 | 0x0066] = EITFixUp::kFixNRK_DVBT; //NRK2
1220  fix[910LL << 32 | 8770U << 16 | 0x03f0] = EITFixUp::kFixNRK_DVBT; //NRK1 M�e og Romsdal
1221  fix[910LL << 32 | 8770U << 16 | 0x0455] = EITFixUp::kFixNRK_DVBT; //NRK P1 Tr�delag
1222  fix[910LL << 32 | 8770U << 16 | 0x03f1] = EITFixUp::kFixNRK_DVBT; //NRK1 Midtnytt
1223 
1225  // Special Early fixups for providers that break DVB EIT spec.
1226  // transport_id<<32 | network_id<<16 | service_id
1227 
1228  // Bell Express VU Canada
1229  fix[ 256U << 16] |= EITFixUp::kEFixForceISO8859_1;
1230  fix[ 257U << 16] |= EITFixUp::kEFixForceISO8859_1;
1231  fix[4100U << 16] |= EITFixUp::kEFixForceISO8859_1;
1232  fix[4101U << 16] |= EITFixUp::kEFixForceISO8859_1;
1233  fix[4102U << 16] |= EITFixUp::kEFixForceISO8859_1;
1234  fix[4103U << 16] |= EITFixUp::kEFixForceISO8859_1;
1235  fix[4104U << 16] |= EITFixUp::kEFixForceISO8859_1;
1236  fix[4105U << 16] |= EITFixUp::kEFixForceISO8859_1;
1237  fix[4106U << 16] |= EITFixUp::kEFixForceISO8859_1;
1238  fix[4107U << 16] |= EITFixUp::kEFixForceISO8859_1;
1239  fix[4097U << 16] |= EITFixUp::kEFixForceISO8859_1;
1240  fix[4098U << 16] |= EITFixUp::kEFixForceISO8859_1;
1241 
1242  // DVB-C Vodafone Germany
1243  fix[ 10000LL<<32 | 61441U << 16 | 53626 ] = EITFixUp::kFixP7S1; // SAT.1
1244  fix[ 10006LL<<32 | 61441U << 16 | 50019 ] = EITFixUp::kFixP7S1; // sixx HD
1245  fix[ 10008LL<<32 | 61441U << 16 | 53621 ] = EITFixUp::kFixP7S1; // ProSieben
1246  fix[ 10008LL<<32 | 61441U << 16 | 53622 ] = EITFixUp::kFixP7S1; // kabel eins
1247  fix[ 10008LL<<32 | 61441U << 16 | 50700 ] = EITFixUp::kFixP7S1; // sixx
1248  fix[ 10011LL<<32 | 61441U << 16 | 50056 ] = EITFixUp::kFixP7S1; // kabel eins CLASSICS HD
1249  fix[ 10011LL<<32 | 61441U << 16 | 50058 ] = EITFixUp::kFixP7S1; // SAT.1 emotions HD
1250  fix[ 10013LL<<32 | 61441U << 16 | 50015 ] = EITFixUp::kFixP7S1; // ProSieben HD
1251  fix[ 10013LL<<32 | 61441U << 16 | 50057 ] = EITFixUp::kFixP7S1; // ProSieben FUN HD
1252  fix[ 10013LL<<32 | 61441U << 16 | 50086 ] = EITFixUp::kFixP7S1; // Kabel eins Doku HD
1253  fix[ 10014LL<<32 | 61441U << 16 | 50086 ] = EITFixUp::kFixP7S1; // kabel eins HD
1254  fix[ 10017LL<<32 | 61441U << 16 | 50122 ] = EITFixUp::kFixP7S1; // kabel eins Doku
1255  fix[ 10017LL<<32 | 61441U << 16 | 53009 ] = EITFixUp::kFixP7S1; // ProSieben MAXX
1256  fix[ 10017LL<<32 | 61441U << 16 | 53324 ] = EITFixUp::kFixP7S1; // SAT.1 Gold
1257  fix[ 10019LL<<32 | 61441U << 16 | 50018 ] = EITFixUp::kFixP7S1; // SAT.1 HD
1258  fix[ 10020LL<<32 | 61441U << 16 | 50046 ] = EITFixUp::kFixP7S1; // ProSieben MAXX HD
1259  fix[ 10020LL<<32 | 61441U << 16 | 50074 ] = EITFixUp::kFixP7S1; // SAT.1 Gold HD
1260 
1261  // DVB-C Unitymedia Germany
1262  fix[ 9999 << 16 | 161LL << 32 | 12101 ] = // RTL Television
1263  fix[ 9999 << 16 | 161LL << 32 | 12104 ] = // VOX
1264  fix[ 9999 << 16 | 161LL << 32 | 12107 ] = // Super RTL
1265  fix[ 9999 << 16 | 161LL << 32 | 12109 ] = // n-tv
1266  fix[ 9999 << 16 | 301LL << 32 | 30114 ] = // RTL NITRO
1268  fix[ 9999 << 16 | 191LL << 32 | 11102 ] = // DAS VIERTE
1270  // on this transport are only HD services, two TBD, arte and ServusTV, I think arte properly signals HD!
1271  fix[ 9999 << 16 | 401LL << 32 | 29109 ] = // ServusTV HD
1273  // generic Unitymedia / Liberty Global / Eventis.nl?
1274  fix[ 9999 << 16 | 121LL << 32 | 12107 ] = // Super RTL
1275  fix[ 9999 << 16 | 151LL << 32 | 15110 ] = // Bibel TV
1276  fix[ 9999 << 16 | 161LL << 32 | 12107 ] = // Super RTL
1277  fix[ 9999 << 16 | 161LL << 32 | 12109 ] = // n-tv
1278  fix[ 9999 << 16 | 171LL << 32 | 17119 ] = // RiC
1279  fix[ 9999 << 16 | 171LL << 32 | 27102 ] = // DELUXE MUSIC
1280  fix[ 9999 << 16 | 181LL << 32 | 24108 ] = // DMAX
1281  fix[ 9999 << 16 | 181LL << 32 | 25102 ] = // TV5MONDE Europe
1282  fix[ 9999 << 16 | 191LL << 32 | 11102 ] = // Disney SD
1283  fix[ 9999 << 16 | 191LL << 32 | 12110 ] = // N24
1284  fix[ 9999 << 16 | 191LL << 32 | 12111 ] = // Tele 5
1285  fix[ 9999 << 16 | 201LL << 32 | 27103 ] = // TLC
1286  fix[ 9999 << 16 | 211LL << 32 | 29108 ] = // Astro TV
1287  fix[ 9999 << 16 | 231LL << 32 | 23117 ] = // Deutsches Musik Fernsehen
1288  fix[ 9999 << 16 | 231LL << 32 | 23115 ] = // Family TV
1289  fix[ 9999 << 16 | 271LL << 32 | 27101 ] = // DIE NEUE ZEIT TV
1290  fix[ 9999 << 16 | 541LL << 32 | 54101 ] = // HR HD
1292 
1293  // DVB-S Astra 19.2E DMAX Germany
1294  fix[ 1113LL << 32 | 1 << 16 | 12602] = EITFixUp::kEFixForceISO8859_15;
1295 
1296  // Premiere
1297  fix[133 << 16] = EITFixUp::kEFixForceISO8859_15;
1298 
1299  // DVB-S Astra 19.2E French channels
1300  fix[ 1022LL << 32 | 1 << 16 | 6901 ] = // DIRECT 8
1301  fix[ 1022LL << 32 | 1 << 16 | 6905 ] = // France 24 (en Francais)
1302  fix[ 1022LL << 32 | 1 << 16 | 6911 ] = // DIRECT 8
1303  fix[ 1072LL << 32 | 1 << 16 | 8201 ] = // CANAL+
1304  fix[ 1070LL << 32 | 1 << 16 | 8004 ] = // EURONEWS
1305  fix[ 1091LL << 32 | 1 << 16 | 31220 ] = // EuroNews
1306  fix[ 1094LL << 32 | 1 << 16 | 17027 ] = // LCP
1307  fix[ 1094LL << 32 | 1 << 16 | 17028 ] = // NT1
1308  fix[ 1100LL << 32 | 1 << 16 | 8710 ] = // NRJ 12
1310 
1311  // DVB-C T-Kábel Hungary
1312  // FIXME this should be more specific. Is the encoding really wrong for all services?
1313  fix[ 100 << 16] = EITFixUp::kEFixForceISO8859_2;
1314 
1315  // DVB-T Greece
1316  // Pelion Transmitter
1317  // transport_id<<32 | netword_id<<16 | service_id
1318  fix[ 100LL << 32 | 8492LL << 16 ] = // Ant1,Alpha,Art,10E
1319  fix[ 102LL << 32 | 8492LL << 16 ] = // Mega,Star,SKAI,M.tv
1320  fix[ 320LL << 32 | 8492LL << 16 ] = // Astra,Thessalia,TRT,TV10,ZEYS
1324  fix[ 2LL << 32 | 8492LL << 16 ] = // N1,Nplus,NHD,Vouli
1325  EITFixUp::kEFixForceISO8859_7 | // it is encoded in cp-1253
1326  EITFixUp::kFixGreekSubtitle | // Subtitle has too much info and is
1327  EITFixUp::kFixGreekEIT | // cut in db. Will move to descr.
1329 
1330  //DVB-S & S2 Greek Nova Provider
1331  // Hotbird 11823H DVB-S
1332  fix[ 5500LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
1333  // Hotbird 11938H DVB-S
1334  fix[ 6100LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
1335  // Hotbird 12130H DVB-S2
1336  fix[ 7100LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
1337  // Hotbird 12169H DVB-S2
1338  fix[ 7300LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
1339 
1340  // DVB-S Star One C2 70W (Brazil)
1341  // it has original_network_id = 1 like Astra on 19.2E, but transport_id does
1342  // not collide at the moment
1343  fix[ 1LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1344  fix[ 2LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1345  fix[ 3LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1346  fix[ 4LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1347  fix[ 50LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1348  fix[ 51LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1349  fix[ 52LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1350  fix[ 53LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1351  fix[ 54LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1352  fix[ 55LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1353  fix[ 56LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1354  fix[ 57LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1355  fix[ 58LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1356  fix[ 59LL << 32 | 1LL << 16 ] = EITFixUp::kEFixForceISO8859_1;
1357 
1358  // Eutelsat Satellite System at 7°E
1359  fix[ 126U << 16 ] = EITFixUp::kEFixForceISO8859_9;
1360 }
1361 
1367 {
1370  m_maxStarttime, "EITScanner");
1371  m_seenEITother = false;
1372  m_maxStarttime = QDateTime();
1373 }
FixupKey
uint64_t FixupKey
Definition: eithelper.h:80
DescriptorID::dvb_content_identifier
@ dvb_content_identifier
Definition: mpegdescriptors.h:129
EITHelper::m_chunkSize
uint m_chunkSize
Definition: eithelper.h:154
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:215
EITHelper::m_dbEvents
MythDeque< DBEventEIT * > m_dbEvents
Definition: eithelper.h:160
parse_dvb_component_descriptors
static void parse_dvb_component_descriptors(const desc_list_t &list, unsigned char &subtitle_type, unsigned char &audio_properties, unsigned char &video_properties)
Definition: eithelper.cpp:318
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:812
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
EITFixUp::kFixUK
@ kFixUK
Definition: eitfixup.h:35
EITFixUp::kFixBell
@ kFixBell
Definition: eitfixup.h:34
EITFixUp::kEFixForceISO8859_15
@ kEFixForceISO8859_15
Definition: eitfixup.h:65
EITHelper::WriteEITCache
static void WriteEITCache(void)
Definition: eithelper.cpp:779
EventInformationTable::LengthInSeconds
uint LengthInSeconds(uint i) const
Definition: atsctables.h:585
iso639_key_to_canonical_key
int iso639_key_to_canonical_key(int iso639_2)
Definition: iso639.cpp:118
DVBEventInformationTable::EventID
uint EventID(uint i) const
Definition: dvbtables.h:334
PremiereContentTransmissionDescriptor::ServiceID
uint ServiceID() const
Definition: premieredescriptors.h:41
DVBEventInformationTable::DurationInSeconds
uint DurationInSeconds(uint i) const
Definition: dvbtables.h:350
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:214
EITFixUp::kFixAUDescription
@ kFixAUDescription
Definition: eitfixup.h:52
ComponentDescriptor::AudioProperties
uint AudioProperties(void) const
Definition: dvbdescriptors.h:505
EITHelper::SetFixup
void SetFixup(uint atsc_major, uint atsc_minor, FixupValue eitfixup)
Definition: eithelper.cpp:131
PrivateDescriptorID::dish_event_vchip
@ dish_event_vchip
Definition: mpegdescriptors.h:219
DVBEventInformationTable
Definition: dvbtables.h:293
EITHelper::m_incompleteEvents
ATSCSRCToEvents m_incompleteEvents
Definition: eithelper.h:158
PremiereContentInformationTable
Definition: premieretables.h:10
EITFixUp::kFixNO
@ kFixNO
Definition: eitfixup.h:47
ComponentDescriptor::VideoProperties
uint VideoProperties(void) const
Definition: dvbdescriptors.h:442
EITFixUp::kFixNRK_DVBT
@ kFixNRK_DVBT
Definition: eitfixup.h:48
DishEventNameDescriptor::HasName
bool HasName(void) const
Definition: dishdescriptors.h:78
ProgramInfo::kCategorySeries
@ kCategorySeries
Definition: programinfo.h:77
EITHelper::AddETT
void AddETT(uint atsc_major, uint atsc_minor, const ExtendedTextTable *ett)
Definition: eithelper.cpp:206
mythdb.h
EITFixUp::Fix
static void Fix(DBEventEIT &event)
Definition: eitfixup.cpp:46
EITFixUp::kFixAUStar
@ kFixAUStar
Definition: eitfixup.h:39
EITFixUp::kFixPremiere
@ kFixPremiere
Definition: eitfixup.h:43
TableID::SC_EITbeg
@ SC_EITbeg
Definition: mpegtables.h:280
DishEventPropertiesDescriptor::AudioProperties
uint AudioProperties(uint compression_type) const
Definition: dishdescriptors.cpp:62
DVBEventInformationTable::Descriptors
const unsigned char * Descriptors(uint i) const
Definition: dvbtables.h:365
PremiereContentInformationTable::DescriptorsLength
uint DescriptorsLength() const
Definition: premieretables.h:29
EITFixUp::kFixATV
@ kFixATV
Definition: eitfixup.h:58
PremiereContentTransmissionDescriptor::TSID
uint TSID() const
Definition: premieredescriptors.h:35
EITHelper::SetSourceID
void SetSourceID(uint sourceid)
Definition: eithelper.cpp:155
EventInformationTable::DescriptorsLength
uint DescriptorsLength(uint i) const
Definition: atsctables.h:600
PrivateDescriptorID::dish_event_tags
@ dish_event_tags
Definition: mpegdescriptors.h:220
EITHelper::m_sourceid
uint m_sourceid
Definition: eithelper.h:150
EITFixUp::kFixHTML
@ kFixHTML
Definition: eitfixup.h:56
LOC_ID
#define LOC_ID
Definition: eithelper.cpp:37
DVBContentIdentifierDescriptor::CRIDCount
size_t CRIDCount() const
Definition: dvbdescriptors.h:2935
EITHelper::m_eitListLock
QMutex m_eitListLock
Definition: eithelper.h:141
programdata.h
FixupValue
uint64_t FixupValue
Definition: eithelper.h:81
build_compdb.content
content
Definition: build_compdb.py:38
ProgramInfo::CategoryType
CategoryType
Definition: programinfo.h:76
kThemeSports
@ kThemeSports
Definition: dishdescriptors.h:141
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:204
get_chan_id_from_db_dtv
static uint get_chan_id_from_db_dtv(uint sourceid, uint serviceid, uint tunedchanid)
Definition: eithelper.cpp:974
ATSCEvent::m_length
uint32_t m_length
Definition: eithelper.h:43
DescriptorID::caption_service
@ caption_service
Definition: mpegdescriptors.h:163
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:618
x0
static int x0
Definition: mythsocket.cpp:49
ProgramInfo::kCategorySports
@ kCategorySports
Definition: programinfo.h:78
EITHelper::kMaxQueueSize
static const uint kMaxQueueSize
Definition: eithelper.h:164
PrivateDescriptorID::dish_event_description
@ dish_event_description
Definition: mpegdescriptors.h:217
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
EITFixUp::kFixSubtitle
@ kFixSubtitle
Definition: eitfixup.h:38
DVBEventInformationTable::OriginalNetworkID
uint OriginalNetworkID(void) const
Definition: dvbtables.h:320
EventIDToATSCEvent
QMap< uint, ATSCEvent > EventIDToATSCEvent
Definition: eithelper.h:75
EITHelper::m_channelid
uint m_channelid
Definition: eithelper.h:151
ChannelUtil::GetMplexID
static uint GetMplexID(uint sourceid, const QString &channum)
Definition: channelutil.cpp:462
EventInformationTable::EventCount
uint EventCount() const
Definition: atsctables.h:557
PremiereContentTransmissionDescriptor::OriginalNetworkID
uint OriginalNetworkID() const
Definition: premieredescriptors.h:38
PrivateUPCCablecomEpisodeTitleDescriptor::Text
QString Text(void) const
Definition: dvbdescriptors.h:3049
enc_override
std::vector< uint8_t > enc_override
Definition: dvbdescriptors.h:43
ATSCEvent::m_descLength
uint32_t m_descLength
Definition: eithelper.h:45
DVBEventInformationTable::TSID
uint TSID(void) const
Definition: dvbtables.h:316
ShortEventDescriptor::Text
QString Text(void) const
Definition: dvbdescriptors.h:2216
DishEventDescriptionDescriptor
Definition: dishdescriptors.h:82
EITHelper::m_fixup
FixupMap m_fixup
Definition: eithelper.h:157
DVBContentIdentifierDescriptor::ContentType
uint ContentType(size_t n=0) const
Definition: dvbdescriptors.h:2914
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:15
PrivateDataSpecifierID::UPC1
@ UPC1
Definition: mpegdescriptors.h:276
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
ShortEventDescriptor
Definition: dvbdescriptors.h:2188
DishEventNameDescriptor
Definition: dishdescriptors.h:68
DVBEventInformationTable::EventCount
uint EventCount() const
Definition: dvbtables.h:330
ProgramInfo::kCategoryNone
@ kCategoryNone
Definition: programinfo.h:77
EITHelper::AddEIT
void AddEIT(uint atsc_major, uint atsc_minor, const EventInformationTable *eit)
Definition: eithelper.cpp:167
EITHelper::m_queueSize
uint m_queueSize
Definition: eithelper.h:155
DVBContentIdentifierDescriptor::ContentEncoding
uint ContentEncoding(size_t n=0) const
Definition: dvbdescriptors.h:2916
DishEventTagsDescriptor::seriesid
QString seriesid(void) const
Definition: dishdescriptors.cpp:120
EITCache::WriteToDB
void WriteToDB(void)
Definition: eitcache.cpp:328
MPEGDescriptor::IsValid
bool IsValid(void) const
Definition: mpegdescriptors.h:342
PrivateDescriptorID::dish_event_name
@ dish_event_name
Definition: mpegdescriptors.h:216
EITHelper::RescheduleRecordings
void RescheduleRecordings(void)
Tells scheduler about programming changes.
Definition: eithelper.cpp:1366
mythdate.h
PrivateUPCCablecomEpisodeTitleDescriptor
Definition: dvbdescriptors.h:3015
DishEventDescriptionDescriptor::HasDescription
bool HasDescription(void) const
Definition: dishdescriptors.h:95
EITFixUp::TimeFix
static void TimeFix(QDateTime &dt)
Corrects starttime to the multiple of a minute.
Definition: eitfixup.h:83
MythDate::fromSecsSinceEpoch
MBASE_PUBLIC QDateTime fromSecsSinceEpoch(int64_t seconds)
This function takes the number of seconds since the start of the epoch and returns a QDateTime with t...
Definition: mythdate.cpp:81
programinfo.h
MPEGDescriptor::Parse
static desc_list_t Parse(const unsigned char *data, uint len)
Definition: mpegdescriptors.cpp:17
DescriptorID::component
@ component
Definition: mpegdescriptors.h:89
DVBEventInformationTable::DescriptorsLength
uint DescriptorsLength(uint i) const
Definition: dvbtables.h:361
ExtendedEventDescriptor::Items
QMultiMap< QString, QString > Items(void) const
Definition: dvbdescriptors.cpp:1146
EITHelper::m_languagePreferences
QMap< uint, uint > m_languagePreferences
Definition: eithelper.h:162
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:550
compat.h
eithelper.h
EITFixUp::kFixNL
@ kFixNL
Definition: eitfixup.h:45
eitcache.h
PremiereContentTransmissionDescriptor::StartTimeUTC
QDateTime StartTimeUTC(uint i) const
Definition: premieredescriptors.cpp:27
EITFixUp::kFixGreekEIT
@ kFixGreekEIT
Definition: eitfixup.h:69
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:225
EITFixUp::kFixDisneyChannel
@ kFixDisneyChannel
Definition: eitfixup.h:59
x1
static int x1
Definition: mythsocket.cpp:50
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:37
desc_list_t
std::vector< const unsigned char * > desc_list_t
Definition: mpegdescriptors.h:18
EITHelper::SetChannelID
void SetChannelID(uint channelid)
Definition: eithelper.cpp:161
ProgramInfo::kCategoryMovie
@ kCategoryMovie
Definition: programinfo.h:77
ExtendedEventDescriptor
Definition: dvbdescriptors.h:1566
DVBEventInformationTable::ServiceID
uint ServiceID(void) const
Definition: dvbtables.h:313
EITHelper::m_gpsOffset
int m_gpsOffset
Definition: eithelper.h:146
DishEventVCHIPDescriptor::advisory
QString advisory(void) const
Definition: dishdescriptors.cpp:264
TableID::SC_EITend
@ SC_EITend
Definition: mpegtables.h:281
DishEventMPAADescriptor::advisory
QString advisory(void) const
Definition: dishdescriptors.cpp:205
dvbtables.h
scheduledrecording.h
PrivateDataSpecifierDescriptor::PrivateDataSpecifier
uint32_t PrivateDataSpecifier(void) const
Definition: dvbdescriptors.h:1936
init_fixup
static void init_fixup(FixupMap &fix)
Definition: eithelper.cpp:1023
EITHelper::~EITHelper
virtual ~EITHelper(void)
Definition: eithelper.cpp:58
EITFixUp::kFixDK
@ kFixDK
Definition: eitfixup.h:50
get_chan_id_from_db_dvb
static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid, uint networkid, uint transportid)
Definition: eithelper.cpp:914
EITCache::PruneOldEntries
uint PruneOldEntries(uint utc_timestamp)
Prunes entries that describe events ending before timestamp time.
Definition: eitcache.cpp:435
EventInformationTable
EventInformationTables contain program titles, start times, and channel information.
Definition: atsctables.h:525
EITFixUp::kFixGreekCategories
@ kFixGreekCategories
Definition: eitfixup.h:70
EventInformationTable::StartTimeRaw
uint StartTimeRaw(uint i) const
Definition: atsctables.h:568
EITHelper::CompleteEvent
void CompleteEvent(uint atsc_major, uint atsc_minor, const ATSCEvent &event, const QString &ett)
Definition: eithelper.cpp:788
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
PremiereContentInformationTable::ContentID
uint ContentID(void) const
Definition: premieretables.h:19
EventInformationTable::ETMLocation
uint ETMLocation(uint i) const
Definition: atsctables.h:580
EITFixUp::kEFixForceISO8859_1
@ kEFixForceISO8859_1
Definition: eitfixup.h:62
DishEventVCHIPDescriptor::rating
QString rating(void) const
Definition: dishdescriptors.cpp:249
MPEGDescriptor::FindAll
static desc_list_t FindAll(const desc_list_t &parsed, uint desc_tag)
Definition: mpegdescriptors.cpp:97
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:916
ATSCEvent::m_desc
const unsigned char * m_desc
Definition: eithelper.h:47
EITCache::IsNewEIT
bool IsNewEIT(uint chanid, uint tableid, uint version, uint eventid, uint endtime)
Definition: eitcache.cpp:360
PrivateDataSpecifierDescriptor
Definition: dvbdescriptors.h:1924
EITFixUp::kFixAUFreeview
@ kFixAUFreeview
Definition: eitfixup.h:51
EITHelper::GetChanID
uint GetChanID(uint atsc_major, uint atsc_minor)
Definition: eithelper.cpp:826
channelutil.h
DishEventDescriptionDescriptor::Description
QString Description(uint compression_type) const
Definition: dishdescriptors.cpp:39
EITFixUp::kFixFI
@ kFixFI
Definition: eitfixup.h:42
ATSCEvent::m_etm
uint32_t m_etm
Definition: eithelper.h:44
EITFixUp::kFixComHem
@ kFixComHem
Definition: eitfixup.h:37
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:910
PrivateDescriptorID::upc_event_episode_title
@ upc_event_episode_title
Definition: mpegdescriptors.h:226
EITFixUp::kFixRTL
@ kFixRTL
Definition: eitfixup.h:41
EITHelper::SetLanguagePreferences
void SetLanguagePreferences(const QStringList &langPref)
Definition: eithelper.cpp:138
DishEventPropertiesDescriptor
Definition: dishdescriptors.h:99
DishEventTagsDescriptor
Definition: dishdescriptors.h:123
EITFixUp::kFixDish
@ kFixDish
Definition: eitfixup.h:49
EITHelper::m_seenEITother
bool m_seenEITother
Definition: eithelper.h:153
EITFixUp::kFixGenericDVB
@ kFixGenericDVB
Definition: eitfixup.h:33
DishEventTagsDescriptor::originalairdate
QDate originalairdate(void) const
Definition: dishdescriptors.cpp:144
PremiereContentTransmissionDescriptor::TransmissionCount
uint TransmissionCount(void) const
Definition: premieredescriptors.h:49
PrivateDescriptorID::premiere_content_transmission
@ premiere_content_transmission
Definition: mpegdescriptors.h:243
PremiereContentTransmissionDescriptor
Definition: premieredescriptors.h:18
PremiereContentInformationTable::DurationInSeconds
uint DurationInSeconds() const
Definition: premieretables.h:24
eitfixup.h
DishEventMPAADescriptor::stars
float stars(void) const
Definition: dishdescriptors.cpp:174
DBEventEIT
Definition: programdata.h:177
EITHelper::ProcessEvents
uint ProcessEvents(void)
Get events from queue and insert into DB after processing.
Definition: eithelper.cpp:86
GPS_EPOCH
static constexpr qint64 GPS_EPOCH
Seconds between start of GPS time and the start of UNIX time.
Definition: mpegtables.h:31
EITFixUp::kFixAUSeven
@ kFixAUSeven
Definition: eitfixup.h:54
PrivateDescriptorID::dish_event_mpaa
@ dish_event_mpaa
Definition: mpegdescriptors.h:215
ContentDescriptor
Definition: dvbdescriptors.h:617
EITFixUp::kEFixForceISO8859_2
@ kEFixForceISO8859_2
Definition: eitfixup.h:63
MPEGDescriptor::FindBestMatch
static const unsigned char * FindBestMatch(const desc_list_t &parsed, uint desc_tag, QMap< uint, uint > &langPref)
Definition: mpegdescriptors.cpp:113
EITHelper::EITHelper
EITHelper(uint cardnum)
Definition: eithelper.cpp:39
ShortEventDescriptor::EventName
QString EventName(void) const
Definition: dvbdescriptors.h:2209
PSIPTable::TableID
uint TableID(void) const
Definition: mpegtables.h:515
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:888
DescriptorID::extended_event
@ extended_event
Definition: mpegdescriptors.h:86
ComponentDescriptor
Definition: dvbdescriptors.h:394
PrivateDescriptorID::dish_event_properties
@ dish_event_properties
Definition: mpegdescriptors.h:218
ExtendedTextTable::ExtendedTextMessage
MultipleStringStructure ExtendedTextMessage() const
Definition: atsctables.h:668
EITHelper::m_srvToChanid
ServiceToChanID m_srvToChanid
Definition: eithelper.h:142
MPEGDescriptor::FindBestMatches
static desc_list_t FindBestMatches(const desc_list_t &parsed, uint desc_tag, QMap< uint, uint > &langPref)
Definition: mpegdescriptors.cpp:158
TableID::PF_EIT
@ PF_EIT
Definition: mpegtables.h:272
EITFixUp::kFixHDTV
@ kFixHDTV
Definition: eitfixup.h:44
subtitles
const std::array< const std::string, 4 > subtitles
Definition: vbilut.cpp:201
EITFixUp::kFixGreekSubtitle
@ kFixGreekSubtitle
Definition: eitfixup.h:68
EITFixUp::kFixMCA
@ kFixMCA
Definition: eitfixup.h:40
premieretables.h
get_chan_id_from_db_atsc
static uint get_chan_id_from_db_atsc(uint sourceid, uint atsc_major, uint atsc_minor)
Definition: eithelper.cpp:887
EITFixUp::kFixP7S1
@ kFixP7S1
Definition: eitfixup.h:55
ExtendedEventDescriptor::Text
QString Text(void) const
Definition: dvbdescriptors.h:1601
TableID::PF_EITo
@ PF_EITo
Definition: mpegtables.h:279
DVBContentIdentifierDescriptor::ContentId
QString ContentId(size_t n=0) const
Definition: dvbdescriptors.h:2919
EventInformationTable::Descriptors
const unsigned char * Descriptors(uint i) const
Definition: atsctables.h:608
DishEventMPAADescriptor
Definition: dishdescriptors.h:14
dishdescriptors.h
atsctables.h
EITFixUp::kFixUnitymedia
@ kFixUnitymedia
Definition: eitfixup.h:57
EITHelper::GetListSize
uint GetListSize(void) const
Definition: eithelper.cpp:65
EventInformationTable::EventID
uint EventID(uint i) const
Definition: atsctables.h:563
EITCache::SetPersistent
void SetPersistent(bool persistent)
Definition: eitcache.h:66
DishEventTagsDescriptor::programid
QString programid(void) const
Definition: dishdescriptors.cpp:87
EITHelper::PruneEITCache
static void PruneEITCache(uint timestamp)
Definition: eithelper.cpp:774
ExtendedTextTable
ExtendedTextTable contain additional text not contained in EventInformationTables.
Definition: atsctables.h:626
ComponentDescriptor::SubtitleType
uint SubtitleType(void) const
Definition: dvbdescriptors.h:590
kThemeSeries
@ kThemeSeries
Definition: dishdescriptors.h:145
EventInformationTable::title
MultipleStringStructure title(int i) const
Definition: atsctables.h:594
parse_dvb_event_descriptors
static void parse_dvb_event_descriptors(const desc_list_t &list, FixupValue fix, QMap< uint, uint > languagePreferences, QString &title, QString &subtitle, QString &description, QMultiMap< QString, QString > &items)
Definition: eithelper.cpp:232
EITFixUp::kEFixForceISO8859_7
@ kEFixForceISO8859_7
Definition: eitfixup.h:66
ATSCEvent::m_startTime
uint32_t m_startTime
Definition: eithelper.h:42
premieredescriptors.h
DescriptorID::private_data_specifier
@ private_data_specifier
Definition: mpegdescriptors.h:104
DescriptorID::content
@ content
Definition: mpegdescriptors.h:93
DishEventVCHIPDescriptor
Definition: dishdescriptors.h:43
ATSCEvent
Definition: eithelper.h:26
EITFixUp::kFixAUNine
@ kFixAUNine
Definition: eitfixup.h:53
DVBContentIdentifierDescriptor
Definition: dvbdescriptors.h:2887
EITFixUp::kEFixForceISO8859_9
@ kEFixForceISO8859_9
Definition: eitfixup.h:64
DishEventMPAADescriptor::rating
QString rating(void) const
Definition: dishdescriptors.cpp:190
MPEGDescriptor::Find
static const unsigned char * Find(const desc_list_t &parsed, uint desc_tag)
Definition: mpegdescriptors.cpp:78
iso639_str3_to_key
static int iso639_str3_to_key(const unsigned char *iso639_2)
Definition: iso639.h:60
PremiereContentInformationTable::Descriptors
const unsigned char * Descriptors() const
Definition: premieretables.h:36
FixupMap
QMap< FixupKey, FixupValue > FixupMap
Definition: eithelper.h:82
MythDeque::dequeue
T dequeue()
Removes item from front of list and returns a copy. O(1).
Definition: mythdeque.h:31
EITHelper::s_eitCache
static EITCache * s_eitCache
Definition: eithelper.h:144
MultipleStringStructure::GetBestMatch
QString GetBestMatch(QMap< uint, uint > &langPrefs) const
Definition: atscdescriptors.cpp:91
kThemeMovie
@ kThemeMovie
Definition: dishdescriptors.h:140
DishEventPropertiesDescriptor::SubtitleProperties
uint SubtitleProperties(uint compression_type) const
Definition: dishdescriptors.cpp:55
ScheduledRecording::RescheduleMatch
static void RescheduleMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduledrecording.h:17
ExtendedTextTable::EventID
uint EventID(void) const
Definition: atsctables.h:664
nv_python_libs.bbciplayer.bbciplayer_api.version
string version
Definition: bbciplayer_api.py:77
EITHelper::m_maxStarttime
QDateTime m_maxStarttime
Definition: eithelper.h:152
DescriptorID::short_event
@ short_event
Definition: mpegdescriptors.h:85
EITCache
Definition: eitcache.h:22
PSIPTable::Version
uint Version(void) const
Definition: mpegtables.h:541
DishContentDescriptor
Definition: dishdescriptors.h:155
uint
unsigned int uint
Definition: freesurround.h:24
DishEventNameDescriptor::Name
QString Name(uint compression_type) const
Definition: dishdescriptors.cpp:12
MythDeque::enqueue
void enqueue(const T &d)
Adds item to the back of the list. O(1).
Definition: mythdeque.h:41
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:837
EITHelper::EventQueueFull
bool EventQueueFull(void) const
Definition: eithelper.cpp:71
DVBEventInformationTable::StartTimeUTC
QDateTime StartTimeUTC(uint i) const
Definition: dvbtables.h:339
LOC
#define LOC
Definition: eithelper.cpp:36
DVBEventInformationTable::EndTimeUnixUTC
time_t EndTimeUnixUTC(uint i) const
Definition: dvbtables.h:343