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