MythTV  master
hdhrchannelfetcher.cpp
Go to the documentation of this file.
1 // Std C headers
2 #include <cmath>
3 #include <unistd.h>
4 #include <utility>
5 
6 // Qt headers
7 #include <QFile>
8 #include <QRegularExpression>
9 #include <QTextStream>
10 #include <QString>
11 #include <QStringList>
12 #include <QDomDocument>
13 
14 #ifdef USING_HDHOMERUN
15 #include HDHOMERUN_HEADERFILE
16 #endif
17 
18 // MythTV headers
21 #include "cardutil.h"
22 #include "channelutil.h"
23 #include "libmyth/mythcontext.h"
24 #include "scanmonitor.h"
25 #include "hdhrchannelfetcher.h"
26 
27 #define LOC QString("HDHRChanFetch: ")
28 
29 namespace {
30 
31 constexpr const char* QUERY_CHANNELS
32 { "http://{IP}/lineup.xml?tuning" };
33 
34 QString getFirstText(QDomElement &element)
35 {
36  for (QDomNode dname = element.firstChild(); !dname.isNull();
37  dname = dname.nextSibling())
38  {
39  QDomText t = dname.toText();
40  if (!t.isNull())
41  return t.data();
42  }
43  return {};
44 }
45 
46 QString getStrValue(const QDomElement &element, const QString &name, int index=0)
47 {
48  QDomNodeList nodes = element.elementsByTagName(name);
49  if (!nodes.isEmpty())
50  {
51  if (index >= nodes.count())
52  index = 0;
53  QDomElement e = nodes.at(index).toElement();
54  return getFirstText(e);
55  }
56  return {};
57 }
58 
59 int getIntValue(const QDomElement &element, const QString &name, int index=0)
60 {
61  QString value = getStrValue(element, name, index);
62  return value.toInt();
63 }
64 
65 bool sendQuery(const QString& query, QDomDocument* xmlDoc)
66 {
67  QByteArray result;
68 
69  if (!GetMythDownloadManager()->download(query, &result, true))
70  return false;
71 
72 #if QT_VERSION < QT_VERSION_CHECK(6,5,0)
73  QString errorMsg;
74  int errorLine = 0;
75  int errorColumn = 0;
76 
77  if (!xmlDoc->setContent(result, false, &errorMsg, &errorLine, &errorColumn))
78  {
79  LOG(VB_GENERAL, LOG_ERR, LOC +
80  QString("Error parsing: %1\nat line: %2 column: %3 msg: %4").
81  arg(query).arg(errorLine).arg(errorColumn).arg(errorMsg));
82  return false;
83  }
84 #else
85  auto parseResult = xmlDoc->setContent(result);
86  if (!parseResult)
87  {
88  LOG(VB_GENERAL, LOG_ERR, LOC +
89  QString("Error parsing: %1\nat line: %2 column: %3 msg: %4").
90  arg(query).arg(parseResult.errorLine).arg(parseResult.errorColumn)
91  .arg(parseResult.errorMessage));
92  return false;
93  }
94 #endif
95 
96  // Check for a status or error element
97  QDomNodeList statusNodes = xmlDoc->elementsByTagName("Status");
98 
99  if (!statusNodes.count())
100  statusNodes = xmlDoc->elementsByTagName("Error");
101 
102  if (statusNodes.count())
103  {
104  QDomElement elem = statusNodes.at(0).toElement();
105  if (!elem.isNull())
106  {
107  int errorCode = getIntValue(elem, "ErrorCode");
108  QString errorDesc = getStrValue(elem, "ErrorDescription");
109 
110  if (errorCode == 0 /* SUCCESS */)
111  return true;
112 
113  LOG(VB_GENERAL, LOG_ERR, LOC +
114  QString("API Error: %1 - %2, Query was: %3").arg(errorCode).arg(errorDesc, query));
115 
116  return false;
117  }
118  }
119 
120  // No error detected so assume we got a valid xml result
121  return true;
122 }
123 
124 hdhr_chan_map_t *getChannels(const QString& ip)
125 {
126  auto *result = new hdhr_chan_map_t;
127  auto *xmlDoc = new QDomDocument();
128  QString query = QUERY_CHANNELS;
129 
130  query.replace("{IP}", ip);
131 
132  if (!sendQuery(query, xmlDoc))
133  {
134  delete xmlDoc;
135  delete result;
136  return nullptr;
137  }
138 
139  QDomNodeList chanNodes = xmlDoc->elementsByTagName("Program");
140 
141  for (int x = 0; x < chanNodes.count(); x++)
142  {
143  QDomElement chanElem = chanNodes.at(x).toElement();
144  QString guideName = getStrValue(chanElem, "GuideName");
145  QString guideNumber = getStrValue(chanElem, "GuideNumber");
146  QString url = getStrValue(chanElem, "URL");
147  QString modulation = getStrValue(chanElem, "Modulation");
148  QString videoCodec = getStrValue(chanElem, "VideoCodec");
149  QString audioCodec = getStrValue(chanElem, "AudioCodec");
150  uint frequency = getStrValue(chanElem, "Frequency").toUInt();
151  uint serviceID = getStrValue(chanElem, "ProgramNumber").toUInt();
152  uint transportID = getStrValue(chanElem, "TransportStreamID").toUInt();
153  QString onid = getStrValue(chanElem, "OriginalNetworkID");
154 
155  // Fixup: Remove leading colon in network ID:
156  // <OriginalNetworkID>:8720</OriginalNetworkID>
157  // This looks a bug in the XML representation, N.B. bug not present in JSON.
158  onid.replace(":", "");
159  uint originalNetworkID = onid.toUInt();
160 
161  LOG(VB_CHANSCAN, LOG_DEBUG, LOC + QString("ONID/TID/SID %1 %2 %3")
162  .arg(originalNetworkID).arg(transportID).arg(serviceID));
163 
164  HDHRChannelInfo chanInfo(guideName, guideNumber, url, modulation, videoCodec,
165  audioCodec, frequency, serviceID, originalNetworkID, transportID);
166 
167  result->insert(guideNumber, chanInfo);
168  }
169  return result;
170 }
171 
172 QString HDHRIPv4Address([[maybe_unused]] const QString &device)
173 {
174 #ifdef USING_HDHOMERUN
175  hdhomerun_device_t *hdhr =
176  hdhomerun_device_create_from_str(device.toLatin1(), nullptr);
177  if (!hdhr)
178  return {};
179 
180  uint32_t ipv4 = hdhomerun_device_get_device_ip(hdhr);
181  hdhomerun_device_destroy(hdhr);
182 
183  if (!ipv4)
184  return {};
185 
186  return QString("%1.%2.%3.%4").arg(ipv4>>24&0xff).arg(ipv4>>16&0xff).arg(ipv4>>8&0xff).arg(ipv4&0xff);
187 #else
188  return {};
189 #endif
190 }
191 
192 // Examples of hdhrmod values: a8qam64-6875 a8qam256-6900 t8dvbt2 8vsb
193 DTVModulationSystem HDHRMod2Modsys(const QString& hdhrmod)
194 {
195  if (hdhrmod.contains("dvbt2"))
197  if (hdhrmod.contains("dvbt"))
199  if (hdhrmod.startsWith("a8qam"))
201  if (hdhrmod.contains("vsb"))
203  if (hdhrmod.contains("psk"))
206 }
207 
208 signed char HDHRMod2Bandwidth(const QString& hdhrmod)
209 {
210  if (hdhrmod.startsWith("t8") || hdhrmod.startsWith("a8"))
211  return '8';
212  if (hdhrmod.startsWith("t7") || hdhrmod.startsWith("a7"))
213  return '7';
214  if (hdhrmod.startsWith("t6") || hdhrmod.startsWith("a6"))
215  return '6';
216  return 'a';
217 }
218 
219 uint HDHRMod2SymbolRate(const QString& hdhrmod)
220 {
221  static const QRegularExpression re(R"(^(a8qam\d+-)(\d+))");
222  QRegularExpressionMatch match = re.match(hdhrmod);
223  if (match.hasMatch())
224  {
225  QString matched = match.captured(2);
226  return matched.toUInt() * 1000;
227  }
228  return 0;
229 }
230 
231 QString HDHRMod2Modulation(const QString& hdhrmod)
232 {
233  if (hdhrmod.contains("qam256"))
235  if (hdhrmod.contains("qam128"))
237  if (hdhrmod.contains("qam64"))
239  if (hdhrmod.contains("qam16"))
241  if (hdhrmod.contains("qpsk"))
243  if (hdhrmod.contains("8vsb"))
246 }
247 
248 void HDHRMajorMinorChannel(QString channum, uint &atsc_major_channel, uint &atsc_minor_channel)
249 {
250  if (channum.contains("."))
251  {
252  QChar dot;
253  QTextStream(&channum) >> atsc_major_channel >> dot >> atsc_minor_channel;
254  }
255 }
256 
257 } // namespace
258 
259 HDHRChannelFetcher::HDHRChannelFetcher(uint cardid, QString inputname, uint sourceid,
260  ServiceRequirements serviceType, ScanMonitor *monitor) :
261  m_scanMonitor(monitor),
262  m_cardId(cardid),
263  m_inputName(std::move(inputname)),
264  m_sourceId(sourceid),
265  m_serviceType(serviceType),
266  m_thread(new MThread("HDHRChannelFetcher", this))
267 {
268  LOG(VB_CHANSCAN, LOG_INFO, LOC + QString("Has ScanMonitor %1")
269  .arg(monitor?"true":"false"));
270 }
271 
273 {
274  Stop();
275  delete m_thread;
276  m_thread = nullptr;
277  delete m_channels;
278  m_channels = nullptr;
279 }
280 
285 {
286  m_lock.lock();
287 
288  while (m_threadRunning)
289  {
290  m_stopNow = true;
291  m_lock.unlock();
292  m_thread->wait(5ms);
293  m_lock.lock();
294  }
295 
296  m_lock.unlock();
297 
298  m_thread->wait();
299 }
300 
302 {
303  while (!m_thread->isFinished())
304  m_thread->wait(500ms);
305 
306  LOG(VB_CHANSCAN, LOG_INFO, LOC + QString("Found %1 channels")
307  .arg(m_channels->size()));
308  return *m_channels;
309 }
310 
312 {
313  Stop();
314  m_stopNow = false;
315  m_thread->start();
316 }
317 
319 {
320  m_lock.lock();
321  m_threadRunning = true;
322  m_lock.unlock();
323 
324  bool usingCableCard = CardUtil::IsCableCardPresent(m_cardId, QString("HDHOMERUN"));
325 
326  // Step 1/3 : Get the IP of the HDHomeRun to query
327  QString dev = CardUtil::GetVideoDevice(m_cardId);
328  QString ip = HDHRIPv4Address(dev);
329 
330  if (m_stopNow || ip.isEmpty())
331  {
332  LOG(VB_CHANNEL, LOG_INFO, LOC +
333  QString("Failed to get IP address from videodev (%1)").arg(dev));
334  QMutexLocker locker(&m_lock);
335  m_threadRunning = false;
336  m_stopNow = true;
337  return;
338  }
339  LOG(VB_CHANNEL, LOG_INFO, LOC + QString("HDHomeRun IP: %1").arg(ip));
340 
341  // Step 2/3 : Download
342  if (m_scanMonitor)
343  {
345  m_scanMonitor->ScanAppendTextToLog(tr("Downloading Channel List"));
346  }
347 
348  delete m_channels;
349  m_channels = getChannels(ip);
350 
351  if (m_stopNow || !m_channels)
352  {
353  if (!m_channels && m_scanMonitor)
354  {
355  m_scanMonitor->ScanAppendTextToLog(QCoreApplication::translate("(Common)", "Error"));
357  m_scanMonitor->ScanErrored(tr("Downloading Channel List Failed"));
358  }
359  QMutexLocker locker(&m_lock);
360  m_threadRunning = false;
361  m_stopNow = true;
362  return;
363  }
364 
365  // Step 3/3 : Process
366  if (m_scanMonitor)
367  {
369  m_scanMonitor->ScanAppendTextToLog(tr("Adding Channels"));
370  }
372  LOG(VB_CHANSCAN, LOG_INFO, LOC + QString("Found %1 channels").arg(m_channels->size()));
373 
374  // Add the channels to the DB
375  hdhr_chan_map_t::const_iterator it = m_channels->cbegin();
376  for (uint i = 1; it != m_channels->cend(); ++it, ++i)
377  {
378  const QString& channum = it.key();
379  QString name = (*it).m_name;
380  uint serviceID = (*it).m_serviceID;
381  QString channelType = (*it).m_channelType;
382  QString hdhrmod = (*it).m_modulation;
383  uint networkID = (*it).m_networkID;
384  uint transportID = (*it).m_transportID;
385  uint frequency = (*it).m_frequency;
386 
387  DTVModulationSystem modsys = HDHRMod2Modsys(hdhrmod);
388  QString modulation = HDHRMod2Modulation(hdhrmod);
389  uint symbolrate = HDHRMod2SymbolRate(hdhrmod);
390  signed char bandwidth = HDHRMod2Bandwidth(hdhrmod);
391  uint atsc_major_channel = 0;
392  uint atsc_minor_channel = 0;
393  HDHRMajorMinorChannel(channum, atsc_major_channel, atsc_minor_channel);
394  QString sistandard = (atsc_major_channel > 0 && atsc_minor_channel > 0) ? "atsc" : "dvb";
395 
396  bool use_on_air_guide = true;
397 
398  QString msg = tr("%1 channel %2: %3").arg(channelType).arg(channum, -5, QChar(' ')).arg(name, -15, QChar(' '));
399  LOG(VB_CHANSCAN, LOG_INFO, QString("Found %1").arg(msg));
400 
401  if ((channelType == "Radio") && (m_serviceType & kRequireVideo))
402  { // NOLINT(bugprone-branch-clone)
403  // Ignore this radio channel
404  if (m_scanMonitor)
405  {
406  m_scanMonitor->ScanAppendTextToLog(tr("Ignoring %1").arg(msg));
407  }
408  }
409  else if ((channelType == "Data") && (m_serviceType != kRequireNothing))
410  {
411  // Ignore this data channel
412  if (m_scanMonitor)
413  {
414  m_scanMonitor->ScanAppendTextToLog(tr("Ignoring %1").arg(msg));
415  }
416  }
417  else
418  {
419  // This is a TV channel or another channel type that we want
420  int chanid = ChannelUtil::GetChanID(m_sourceId, channum);
421  bool adding_channel = chanid <= 0;
422 
423  if (adding_channel)
424  chanid = ChannelUtil::CreateChanID(m_sourceId, channum);
425 
426  if (m_scanMonitor)
427  {
428  if (adding_channel)
429  {
430  m_scanMonitor->ScanAppendTextToLog(tr("Adding %1").arg(msg));
431  }
432  else
433  {
434  m_scanMonitor->ScanAppendTextToLog(tr("Updating %1").arg(msg));
435  }
436  }
437 
438  uint mplexID {0};
439  QString freqID;
440 
441  if (usingCableCard)
442  {
443  // With a CableCard, we're going to use virtual
444  // channel tuning, so no dtv_multiplex is needed.
445  mplexID = 0;
446  // When virtual channel tuning, vchan is acquired from freqid field
447  freqID = channum;
448  }
449  else
450  {
451  // A new dtv_multiplex entry will be created if necessary, otherwise an existing one is returned
452  mplexID = ChannelUtil::CreateMultiplex(m_sourceId, sistandard, frequency, modulation,
453  transportID, networkID, symbolrate, bandwidth,
454  'v', 'a', 'a', QString(), QString(), 'a', QString(),
455  QString(), QString(), modsys.toString(), "0.35");
456  if (mplexID == 0)
457  {
458  LOG(VB_GENERAL, LOG_ERR, QString("No multiplex for %1 sid:%2 freq:%3 url:%4")
459  .arg(msg).arg(serviceID, -5, 10, QChar(' ')).arg(frequency).arg((*it).m_tuning.GetDataURL().toString()));
460  continue;
461  }
462  }
463 
464  if (adding_channel)
465  {
466  ChannelUtil::CreateChannel(mplexID, m_sourceId, chanid, name, name,
467  channum, serviceID, atsc_major_channel, atsc_minor_channel,
468  use_on_air_guide, kChannelVisible, freqID,
469  QString(), "Default", QString());
470 
471  ChannelUtil::CreateIPTVTuningData(chanid, (*it).m_tuning);
472  }
473  else
474  {
475  ChannelUtil::UpdateChannel(mplexID, m_sourceId, chanid, name, name,
476  channum, serviceID, atsc_major_channel, atsc_minor_channel,
477  use_on_air_guide, kChannelVisible, freqID,
478  QString(), "Default", QString());
479 
480  ChannelUtil::UpdateIPTVTuningData(chanid, (*it).m_tuning);
481  }
482  LOG(VB_GENERAL, LOG_INFO, QString("%1 sid:%2 freq:%3 url:%4")
483  .arg(msg).arg(serviceID, -5, 10, QChar(' ')).arg(frequency).arg((*it).m_tuning.GetDataURL().toString()));
484  }
486  }
487 
488  if (m_scanMonitor)
489  {
490  m_scanMonitor->ScanAppendTextToLog(tr("Done"));
493  }
494 
495  QMutexLocker locker(&m_lock);
496  m_threadRunning = false;
497  m_stopNow = true;
498 }
499 
501 {
502  uint minval = 70;
503  uint range = 100 - minval;
504  uint pct = minval + (uint) truncf((((float)val) / m_chanCnt) * range);
505  if (m_scanMonitor)
507 }
DTVModulation::toString
QString toString() const
Definition: dtvconfparserhelpers.h:412
HDHRChannelInfo
Definition: hdhrchannelfetcher.h:23
HDHRChannelFetcher::GetChannels
hdhr_chan_map_t GetChannels(void)
Definition: hdhrchannelfetcher.cpp:301
MThread::start
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
Definition: mthread.cpp:283
DTVModulation::kModulationQAM256
@ kModulationQAM256
Definition: dtvconfparserhelpers.h:363
HDHRChannelFetcher::m_cardId
uint m_cardId
Definition: hdhrchannelfetcher.h:114
DTVModulationSystem::kModulationSystem_DVBT
@ kModulationSystem_DVBT
Definition: dtvconfparserhelpers.h:659
HDHRChannelFetcher::m_chanCnt
uint m_chanCnt
Definition: hdhrchannelfetcher.h:119
MThread::wait
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
Definition: mthread.cpp:300
HDHRChannelFetcher::m_thread
MThread * m_thread
Definition: hdhrchannelfetcher.h:122
ScanMonitor::ScanPercentComplete
void ScanPercentComplete(int pct)
Definition: scanmonitor.cpp:103
anonymous_namespace{hdhrchannelfetcher.cpp}::HDHRMod2SymbolRate
uint HDHRMod2SymbolRate(const QString &hdhrmod)
Definition: hdhrchannelfetcher.cpp:219
anonymous_namespace{hdhrchannelfetcher.cpp}::HDHRMajorMinorChannel
void HDHRMajorMinorChannel(QString channum, uint &atsc_major_channel, uint &atsc_minor_channel)
Definition: hdhrchannelfetcher.cpp:248
anonymous_namespace{hdhrchannelfetcher.cpp}::getStrValue
QString getStrValue(const QDomElement &element, const QString &name, int index=0)
Definition: hdhrchannelfetcher.cpp:46
HDHRChannelFetcher::m_scanMonitor
ScanMonitor * m_scanMonitor
Definition: hdhrchannelfetcher.h:113
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
anonymous_namespace{hdhrchannelfetcher.cpp}::HDHRIPv4Address
QString HDHRIPv4Address([[maybe_unused]] const QString &device)
Definition: hdhrchannelfetcher.cpp:172
HDHRChannelFetcher::HDHRChannelFetcher
HDHRChannelFetcher(uint cardid, QString inputname, uint sourceid, ServiceRequirements serviceType, ScanMonitor *monitor=nullptr)
Definition: hdhrchannelfetcher.cpp:259
ScanMonitor::ScanErrored
void ScanErrored(const QString &error)
Definition: scanmonitor.cpp:128
HDHRChannelFetcher::m_threadRunning
bool m_threadRunning
Definition: hdhrchannelfetcher.h:120
DTVModulation::kModulation8VSB
@ kModulation8VSB
Definition: dtvconfparserhelpers.h:365
scanmonitor.h
HDHRChannelFetcher::m_sourceId
uint m_sourceId
Definition: hdhrchannelfetcher.h:116
kChannelVisible
@ kChannelVisible
Definition: channelinfo.h:23
DTVModulationSystem::kModulationSystem_UNDEFINED
@ kModulationSystem_UNDEFINED
Definition: dtvconfparserhelpers.h:656
ChannelUtil::GetChanID
static int GetChanID(int db_mplexid, int service_transport_id, int major_channel, int minor_channel, int program_number)
Definition: channelutil.cpp:1335
mythlogging.h
DTVModulationSystem::kModulationSystem_ATSC
@ kModulationSystem_ATSC
Definition: dtvconfparserhelpers.h:667
HDHRChannelFetcher::Scan
void Scan(void)
Definition: hdhrchannelfetcher.cpp:311
DTVModulation::kModulationQAM16
@ kModulationQAM16
Definition: dtvconfparserhelpers.h:359
HDHRChannelFetcher::m_stopNow
bool m_stopNow
Definition: hdhrchannelfetcher.h:121
hardwareprofile.i18n.t
t
Definition: i18n.py:36
ChannelUtil::UpdateChannel
static bool UpdateChannel(uint db_mplexid, uint source_id, uint channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, ChannelVisibleType visible, const QString &freqid=QString(), const QString &icon=QString(), QString format=QString(), const QString &xmltvid=QString(), const QString &default_authority=QString(), uint service_type=0, int recpriority=INT_MIN, int tmOffset=INT_MIN, int commMethod=INT_MIN)
Definition: channelutil.cpp:1596
HDHRChannelFetcher::Stop
void Stop(void)
Stops the scanning thread running.
Definition: hdhrchannelfetcher.cpp:284
ServiceRequirements
ServiceRequirements
Definition: channelscantypes.h:4
anonymous_namespace{hdhrchannelfetcher.cpp}::HDHRMod2Modsys
DTVModulationSystem HDHRMod2Modsys(const QString &hdhrmod)
Definition: hdhrchannelfetcher.cpp:193
ChannelUtil::CreateChanID
static int CreateChanID(uint sourceid, const QString &chan_num)
Creates a unique channel ID for database use.
Definition: channelutil.cpp:1471
anonymous_namespace{hdhrchannelfetcher.cpp}::getChannels
hdhr_chan_map_t * getChannels(const QString &ip)
Definition: hdhrchannelfetcher.cpp:124
MThread::isFinished
bool isFinished(void) const
Definition: mthread.cpp:258
kRequireVideo
@ kRequireVideo
Definition: channelscantypes.h:7
ScanMonitor::ScanAppendTextToLog
void ScanAppendTextToLog(const QString &status)
Definition: scanmonitor.cpp:109
hdhr_chan_map_t
QMap< QString, HDHRChannelInfo > hdhr_chan_map_t
Definition: hdhrchannelfetcher.h:90
ChannelUtil::CreateChannel
static bool CreateChannel(uint db_mplexid, uint db_sourceid, uint new_channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, ChannelVisibleType visible, const QString &freqid, const QString &icon=QString(), QString format="Default", const QString &xmltvid=QString(), const QString &default_authority=QString(), uint service_type=0, int recpriority=0, int tmOffset=0, int commMethod=-1)
Definition: channelutil.cpp:1508
channelutil.h
DTVModulationSystem::toString
QString toString() const
Definition: dtvconfparserhelpers.h:719
DTVModulation::kModulationQAM128
@ kModulationQAM128
Definition: dtvconfparserhelpers.h:362
CardUtil::IsCableCardPresent
static bool IsCableCardPresent(uint inputid, const QString &inputType)
Definition: cardutil.cpp:107
DTVModulationSystem
Definition: dtvconfparserhelpers.h:644
cardutil.h
ScanMonitor::ScanComplete
void ScanComplete(void)
Definition: scanmonitor.cpp:98
ChannelUtil::CreateIPTVTuningData
static bool CreateIPTVTuningData(uint channel_id, const IPTVTuningData &tuning)
Definition: channelutil.h:155
ChannelUtil::CreateMultiplex
static uint CreateMultiplex(int sourceid, const QString &sistandard, uint64_t frequency, const QString &modulation, int transport_id=-1, int network_id=-1)
Definition: channelutil.cpp:372
anonymous_namespace{hdhrchannelfetcher.cpp}::HDHRMod2Modulation
QString HDHRMod2Modulation(const QString &hdhrmod)
Definition: hdhrchannelfetcher.cpp:231
HDHRChannelFetcher::SetTotalNumChannels
void SetTotalNumChannels(uint val)
Definition: hdhrchannelfetcher.h:106
anonymous_namespace{hdhrchannelfetcher.cpp}::sendQuery
bool sendQuery(const QString &query, QDomDocument *xmlDoc)
Definition: hdhrchannelfetcher.cpp:65
HDHRChannelFetcher::SetNumChannelsInserted
void SetNumChannelsInserted(uint val)
Definition: hdhrchannelfetcher.cpp:500
DTVModulationSystem::kModulationSystem_DVBT2
@ kModulationSystem_DVBT2
Definition: dtvconfparserhelpers.h:672
mythcontext.h
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
DTVModulationSystem::kModulationSystem_DVBC_ANNEX_A
@ kModulationSystem_DVBC_ANNEX_A
Definition: dtvconfparserhelpers.h:657
kRequireNothing
@ kRequireNothing
Definition: channelscantypes.h:6
hdhrchannelfetcher.h
HDHRChannelFetcher::~HDHRChannelFetcher
~HDHRChannelFetcher() override
Definition: hdhrchannelfetcher.cpp:272
HDHRChannelFetcher::m_serviceType
ServiceRequirements m_serviceType
Definition: hdhrchannelfetcher.h:117
DTVModulation::kModulationQAMAuto
@ kModulationQAMAuto
Definition: dtvconfparserhelpers.h:364
anonymous_namespace{hdhrchannelfetcher.cpp}::getIntValue
int getIntValue(const QDomElement &element, const QString &name, int index=0)
Definition: hdhrchannelfetcher.cpp:59
DTVModulation::kModulationQAM64
@ kModulationQAM64
Definition: dtvconfparserhelpers.h:361
anonymous_namespace{hdhrchannelfetcher.cpp}::getFirstText
QString getFirstText(QDomElement &element)
Definition: hdhrchannelfetcher.cpp:34
anonymous_namespace{hdhrchannelfetcher.cpp}::HDHRMod2Bandwidth
signed char HDHRMod2Bandwidth(const QString &hdhrmod)
Definition: hdhrchannelfetcher.cpp:208
mythdownloadmanager.h
QUERY_CHANNELS
static constexpr const char * QUERY_CHANNELS
Definition: vboxutils.cpp:21
HDHRChannelFetcher::run
void run(void) override
Definition: hdhrchannelfetcher.cpp:318
HDHRChannelFetcher::m_channels
hdhr_chan_map_t * m_channels
Definition: hdhrchannelfetcher.h:118
DTVModulation::kModulationQPSK
@ kModulationQPSK
Definition: dtvconfparserhelpers.h:358
LOC
#define LOC
Definition: hdhrchannelfetcher.cpp:27
ScanMonitor
Definition: scanmonitor.h:44
HDHRChannelFetcher::m_lock
QMutex m_lock
Definition: hdhrchannelfetcher.h:123
DTVModulation
Definition: dtvconfparserhelpers.h:347
CardUtil::GetVideoDevice
static QString GetVideoDevice(uint inputid)
Definition: cardutil.h:294
uint
unsigned int uint
Definition: freesurround.h:24
ChannelUtil::UpdateIPTVTuningData
static bool UpdateIPTVTuningData(uint channel_id, const IPTVTuningData &tuning)
Definition: channelutil.cpp:1752
GetMythDownloadManager
MythDownloadManager * GetMythDownloadManager(void)
Gets the pointer to the MythDownloadManager singleton.
Definition: mythdownloadmanager.cpp:146