MythTV  master
dtvsignalmonitor.cpp
Go to the documentation of this file.
1 #include <algorithm> // for lower_bound
2 #include <unistd.h>
3 
4 #include "libmythbase/compat.h"
5 
6 #include "dtvchannel.h"
7 #include "dtvsignalmonitor.h"
8 #include "mpeg/atsctables.h"
9 #include "mpeg/dvbtables.h"
10 #include "mpeg/mpegtables.h"
11 #include "mpeg/scanstreamdata.h"
12 
13 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
14 #define DBG_SM(FUNC, MSG) LOG(VB_CHANNEL, LOG_INFO, \
15  QString("DTVSigMon[%1]: %2 %3").arg(m_inputid).arg(FUNC, MSG))
16 
17 #define LOC QString("DTVSigMon[%1]: ").arg(m_inputid)
18 
19 // inserts tid&crc value into an ordered list
20 // returns true if item is inserted
21 static bool insert_crc(QList<uint64_t> &seen_crc, const PSIPTable &psip)
22 {
23  uint64_t key = (((uint64_t)psip.TableID()) << 32) | psip.CRC();
24 
25  QList<uint64_t>::iterator it =
26  std::lower_bound(seen_crc.begin(), seen_crc.end(), key);
27 
28  if ((it == seen_crc.end()) || (*it != key))
29  {
30  seen_crc.insert(it, key);
31  return true;
32  }
33 
34  return false;
35 }
36 
42  DTVChannel *_channel,
43  bool _release_stream,
44  uint64_t wait_for_mask)
45  : SignalMonitor(db_cardnum, _channel, _release_stream, wait_for_mask),
46  m_seenPAT(QObject::tr("Seen")+" PAT", "seen_pat", 1, true, 0, 1, 0ms),
47  m_seenPMT(QObject::tr("Seen")+" PMT", "seen_pmt", 1, true, 0, 1, 0ms),
48  m_seenMGT(QObject::tr("Seen")+" MGT", "seen_mgt", 1, true, 0, 1, 0ms),
49  m_seenVCT(QObject::tr("Seen")+" VCT", "seen_vct", 1, true, 0, 1, 0ms),
50  m_seenNIT(QObject::tr("Seen")+" NIT", "seen_nit", 1, true, 0, 1, 0ms),
51  m_seenSDT(QObject::tr("Seen")+" SDT", "seen_sdt", 1, true, 0, 1, 0ms),
52  m_seenCrypt(QObject::tr("Seen")+" Crypt", "seen_crypt", 1, true, 0, 1, 0ms),
53  m_matchingPAT(QObject::tr("Matching")+" PAT", "matching_pat", 1, true, 0, 1, 0ms),
54  m_matchingPMT(QObject::tr("Matching")+" PMT", "matching_pmt", 1, true, 0, 1, 0ms),
55  m_matchingMGT(QObject::tr("Matching")+" MGT", "matching_mgt", 1, true, 0, 1, 0ms),
56  m_matchingVCT(QObject::tr("Matching")+" VCT", "matching_vct", 1, true, 0, 1, 0ms),
57  m_matchingNIT(QObject::tr("Matching")+" NIT", "matching_nit", 1, true, 0, 1, 0ms),
58  m_matchingSDT(QObject::tr("Matching")+" SDT", "matching_sdt", 1, true, 0, 1, 0ms),
59  m_matchingCrypt(QObject::tr("Matching")+" Crypt", "matching_crypt",
60  1, true, 0, 1, 0ms)
61 {
62 }
63 
65 {
67 }
68 
70 {
71  return dynamic_cast<DTVChannel*>(m_channel);
72 }
73 
74 QStringList DTVSignalMonitor::GetStatusList(void) const
75 {
76  QStringList list = SignalMonitor::GetStatusList();
77  QMutexLocker locker(&m_statusLock);
78 
79  // mpeg tables
81  {
84  }
86  {
87 #define DEBUG_PMT 0
88 #if DEBUG_PMT
89  static int seenGood = -1;
90  static int matchingGood = -1;
91 #endif
94 #if DEBUG_PMT
95  if ((seenGood != (int)m_seenPMT.IsGood()) ||
96  (matchingGood != (int)m_matchingPMT.IsGood()))
97  {
98  DBG_SM("GetStatusList", QString("WaitForPMT seen(%1) matching(%2)")
99  .arg(m_seenPMT.IsGood())
100  .arg(m_matchingPMT.IsGood()));
101  seenGood = (int)m_seenPMT.IsGood();
102  matchingGood = (int)m_matchingPMT.IsGood();
103  }
104 #endif
105  }
106  // atsc tables
108  {
111  }
113  {
116  }
117  // dvb tables
119  {
122  }
124  {
127  }
129  {
132  }
133  if (!m_error.isEmpty())
134  {
135  list<<"error"<<m_error;
136  }
137  return list;
138 }
139 
140 void DTVSignalMonitor::AddFlags(uint64_t _flags)
141 {
142  SignalMonitor::AddFlags(_flags);
144 }
145 
146 void DTVSignalMonitor::RemoveFlags(uint64_t _flags)
147 {
150 }
151 
153 {
154  QMutexLocker locker(&m_statusLock);
169 }
170 
172 {
173  std::vector<uint> add_eit;
174  std::vector<uint> del_eit;
175 
176  if (GetStreamData()->HasEITPIDChanges(m_eitPids) &&
177  GetStreamData()->GetEITPIDChanges(m_eitPids, add_eit, del_eit))
178  {
179  for (uint eit : del_eit)
180  {
181  uint_vec_t::iterator it;
182  it = find(m_eitPids.begin(), m_eitPids.end(), eit);
183  if (it != m_eitPids.end())
184  m_eitPids.erase(it);
186  }
187 
188  for (uint eit : add_eit)
189  {
190  m_eitPids.push_back(eit);
192  }
193  }
194 }
195 
197 {
198  DBG_SM(QString("SetChannel(%1, %2)").arg(major).arg(minor), "");
199  m_seenTableCrc.clear();
201  if (atsc && (m_majorChannel != major || m_minorChannel != minor))
202  {
207  m_majorChannel = major;
209  atsc->SetDesiredChannel(major, minor);
211  }
212 }
213 
215 {
216  DBG_SM(QString("SetProgramNumber(%1)").arg(progNum), "");
217  m_seenTableCrc.clear();
218  if (m_programNumber != progNum)
219  {
222  m_programNumber = progNum;
223  if (GetStreamData())
226  }
227 }
228 
229 void DTVSignalMonitor::SetDVBService(uint network_id, uint transport_id, int service_id)
230 {
231  DBG_SM(QString("SetDVBService(transport_id: %1, network_id: %2, "
232  "service_id: %3)").arg(transport_id).arg(network_id).arg(service_id), "");
233  m_seenTableCrc.clear();
234 
235  if (network_id == m_networkID && transport_id == m_transportID &&
236  service_id == m_programNumber)
237  {
238  return;
239  }
240 
244 
245  m_transportID = transport_id;
246  m_networkID = network_id;
247  m_programNumber = service_id;
248 
250  if (dvb != nullptr)
251  {
252  dvb->SetDesiredService(network_id, transport_id, m_programNumber);
255  }
256 }
257 
259 {
260  if (m_streamData)
262 
265  if (atsc)
266  {
267  atsc->RemoveATSCMainListener(this);
268  atsc->RemoveATSCAuxListener(this);
269  }
270  if (dvb)
271  dvb->RemoveDVBMainListener(this);
272 
273  m_streamData = data;
274  if (!data)
275  return;
276 
277  data->AddMPEGListener(this);
278 
279  atsc = GetATSCStreamData();
280  dvb = GetDVBStreamData();
281  if (atsc)
282  {
283  atsc->AddATSCMainListener(this);
284  atsc->AddATSCAuxListener(this);
285  }
286  if (dvb)
287  dvb->AddDVBMainListener(this);
288 }
289 
290 
292 {
294  int pmt_pid = pat->FindPID(m_programNumber);
295  if (GetStreamData() && pmt_pid)
296  {
298  GetStreamData()->AddListeningPID(pmt_pid);
299  insert_crc(m_seenTableCrc, *pat);
300  return;
301  }
302 
303  if (m_programNumber >= 0)
304  {
305  // BEGIN HACK HACK HACK
306  // Reset version in case we're physically on the wrong transport
307  // due to tuning hardware being in a transitional state or we
308  // are in the middle of something like a DiSEqC rotor turn.
309  uint tsid = pat->TransportStreamID();
310  GetStreamData()->SetVersionPAT(tsid, -1,0);
311  // END HACK HACK HACK
312 
313  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("HandlePAT() ") +
314  QString("Received PAT for tsid %1 waiting for tsid %2")
315  .arg(tsid).arg(m_transportID));
316 
317  // Only one entry in the PAT, just use this program
318  int spts_program = 0;
319  if (pat->ProgramCount() == 1)
320  {
321  spts_program = pat->ProgramNumber(0);
322  pmt_pid = pat->ProgramPID(0);
323  }
324 
325  // Two entries in the PAT, but if one is a pointer to the NIT PID
326  // instead of a real program then the other is the single program.
327  if (pat->ProgramCount() == 2)
328  {
329  if (pat->ProgramNumber(0) == 0)
330  {
331  spts_program = pat->ProgramNumber(1);
332  pmt_pid = pat->ProgramPID(1);
333  }
334  else if (pat->ProgramNumber(1) == 0)
335  {
336  spts_program = pat->ProgramNumber(0);
337  pmt_pid = pat->ProgramPID(0);
338  }
339  }
340 
341  if (spts_program > 0)
342  {
343  LOG(VB_GENERAL, LOG_INFO, LOC +
344  QString("Program %1 found in PAT of SPTS").arg(spts_program));
345  SetProgramNumber(spts_program);
347  GetStreamData()->AddListeningPID(pmt_pid);
348  }
349 
350  if (insert_crc(m_seenTableCrc, *pat))
351  {
352  QString errStr = QString("Program #%1 not found in PAT!")
353  .arg(m_programNumber);
354  LOG(VB_GENERAL, LOG_ERR, LOC + errStr + "\n" + pat->toString());
355  }
356  }
357 }
358 
359 void DTVSignalMonitor::HandlePMT(uint /*program_num*/, const ProgramMapTable *pmt)
360 {
362 
363  if (m_programNumber < 0)
364  return; // don't print error messages during channel scan.
365 
366  if (pmt->ProgramNumber() != (uint)m_programNumber)
367  {
368  if (insert_crc(m_seenTableCrc, *pmt))
369  {
370  LOG(VB_CHANNEL, LOG_DEBUG, LOC +
371  QString("Wrong PMT; pmt->ProgramNumber(%1) desired(%2)")
372  .arg(pmt->ProgramNumber()).arg(m_programNumber));
373  }
374  return; // Not the PMT we are looking for...
375  }
376 
377  LOG(VB_CHANNEL, LOG_DEBUG, LOC +
378  QString("Found PMT; pmt->ProgramNumber(%1)")
379  .arg(pmt->ProgramNumber()));
380 
381  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) {
382  LOG(VB_GENERAL, LOG_NOTICE, LOC +
383  QString("PMT says program %1 is encrypted").arg(m_programNumber));
385  }
386 
387  // if PMT contains audio and/or video stream set as matching.
388  uint hasAudio = 0;
389  uint hasVideo = 0;
390 
391  for (uint i = 0; i < pmt->StreamCount(); i++)
392  {
393  if (pmt->IsVideo(i, GetDTVChannel()->GetSIStandard()))
394  hasVideo++;
395  if (pmt->IsAudio(i, GetDTVChannel()->GetSIStandard()))
396  hasAudio++;
397  }
398 
399  if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
400  (hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
401  {
402  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) &&
405 
407  }
408  else
409  {
410  LOG(VB_GENERAL, LOG_ERR, LOC +
411  QString("We want %1 audio and %2 video streams")
412  .arg(GetStreamData()->GetAudioStreamsRequired())
413  .arg(GetStreamData()->GetVideoStreamsRequired()) +
414  QString("\n\t\t\tBut have %1 audio and %2 video streams")
415  .arg(hasAudio).arg(hasVideo));
416  }
417 }
418 
420 {
421  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
422  .arg(GetStreamData()->TimeOffset()));
423 }
424 
426 {
428 
430  if (!atsc)
431  return;
432 
433  for (uint i=0; i<mgt->TableCount(); i++)
434  {
435  if ((TableClass::TVCTc == mgt->TableClass(i)) ||
436  (TableClass::CVCTc == mgt->TableClass(i)))
437  {
438  atsc->AddListeningPID(mgt->TablePID(i));
440  }
441  }
442 }
443 
445  uint /*pid*/, const TerrestrialVirtualChannelTable* tvct)
446 {
448  int idx = tvct->Find(m_majorChannel, m_minorChannel);
449 
450  if (m_minorChannel < 0)
451  return; // don't print error message during channel scan.
452 
453  if (idx < 0)
454  {
455  if (insert_crc(m_seenTableCrc, *tvct))
456  {
457  LOG(VB_GENERAL, LOG_ERR, LOC +
458  QString("Could not find channel %1_%2 in TVCT")
459  .arg(m_majorChannel).arg(m_minorChannel));
460  LOG(VB_GENERAL, LOG_DEBUG, LOC + tvct->toString());
461  }
463  if (atsc)
464  atsc->SetVersionTVCT(tvct->TransportStreamID(),-1);
465  return;
466  }
467 
468  DBG_SM("HandleTVCT()", QString("tvct->ProgramNumber(idx %1): prog num %2")
469  .arg(idx).arg(tvct->ProgramNumber(idx)));
470 
471  SetProgramNumber(tvct->ProgramNumber(idx));
473 }
474 
476 {
478  int idx = cvct->Find(m_majorChannel, m_minorChannel);
479 
480  if (idx < 0)
481  {
482  if (insert_crc(m_seenTableCrc, *cvct))
483  {
484  LOG(VB_GENERAL, LOG_ERR, LOC +
485  QString("Could not find channel %1_%2 in CVCT")
486  .arg(m_majorChannel).arg(m_minorChannel));
487  LOG(VB_GENERAL, LOG_DEBUG, LOC + cvct->toString());
488  }
490  if (atsc)
491  atsc->SetVersionCVCT(cvct->TransportStreamID(),-1);
492  return;
493  }
494 
495  DBG_SM("HandleCVCT()", QString("cvct->ProgramNumber(idx %1): prog num %2")
496  .arg(idx).arg(cvct->ProgramNumber(idx)));
497 
498  SetProgramNumber(cvct->ProgramNumber(idx));
500 }
501 
503 {
504  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
505  .arg(GetStreamData()->TimeOffset()));
506 }
507 
509 {
510  DBG_SM("HandleNIT()", QString("net_id = %1").arg(nit->NetworkID()));
512  if (!GetDVBStreamData())
513  return;
514 }
515 
517 {
519 
521  m_detectedTransportID = sdt->TSID();
522 
523  // if the multiplex is not properly configured with ONID and TSID then take
524  // whatever SDT we see first
525  if ((m_networkID == 0) && (m_transportID == 0))
526  {
529 
530  // FIXME assert if TableID == SDTo
531  }
532 
533  if (sdt->OriginalNetworkID() != m_networkID || sdt->TSID() != m_transportID)
534  {
536  if (dvb)
537  dvb->SetVersionSDT(sdt->TSID(), -1, 0);
538  }
539  else
540  {
541  DBG_SM("HandleSDT()", QString("tsid = %1 orig_net_id = %2")
542  .arg(sdt->TSID()).arg(sdt->OriginalNetworkID()));
545  }
546 }
547 
548 void DTVSignalMonitor::HandleEncryptionStatus(uint /*program_number*/, bool enc_status)
549 {
551  if (!enc_status)
553 }
554 
556 {
557  return dynamic_cast<ATSCStreamData*>(m_streamData);
558 }
559 
561 {
562  return dynamic_cast<DVBStreamData*>(m_streamData);
563 }
564 
566 {
567  return dynamic_cast<ScanStreamData*>(m_streamData);
568 }
569 
571 {
572  return dynamic_cast<const ATSCStreamData*>(m_streamData);
573 }
574 
576 {
577  return dynamic_cast<const DVBStreamData*>(m_streamData);
578 }
579 
581 {
582  return dynamic_cast<const ScanStreamData*>(m_streamData);
583 }
584 
586 {
587  QMutexLocker locker(&m_statusLock);
589  return false;
591  return false;
593  return false;
595  return false;
597  return false;
599  return false;
601  return false;
603  return false;
604 
605  return true;
606 }
MasterGuideTable::TableClass
int TableClass(uint i) const
Definition: atsctables.cpp:25
DVBStreamData::RemoveDVBMainListener
void RemoveDVBMainListener(DVBMainStreamListener *val)
Definition: dvbstreamdata.cpp:1028
ProgramAssociationTable::ProgramPID
uint ProgramPID(uint i) const
Definition: mpegtables.h:646
DTVSignalMonitor::m_majorChannel
int m_majorChannel
Definition: dtvsignalmonitor.h:128
DTVSignalMonitor::AddFlags
void AddFlags(uint64_t _flags) override
Definition: dtvsignalmonitor.cpp:140
dtvchannel.h
SignalMonitor::m_flags
volatile uint64_t m_flags
Definition: signalmonitor.h:206
ATSCStreamData::AddATSCAuxListener
void AddATSCAuxListener(ATSCAuxStreamListener *val)
Definition: atscstreamdata.cpp:987
DTVSignalMonitor::RemoveFlags
void RemoveFlags(uint64_t _flags) override
Definition: dtvsignalmonitor.cpp:146
DTVSignalMonitor::m_matchingMGT
SignalMonitorValue m_matchingMGT
Definition: dtvsignalmonitor.h:121
DTVSignalMonitor::SetDVBService
void SetDVBService(uint network_id, uint transport_id, int service_id)
Definition: dtvsignalmonitor.cpp:229
SignalMonitorValue::SetValue
void SetValue(int _value)
Definition: signalmonitorvalue.h:74
ProgramMapTable::StreamCount
uint StreamCount(void) const
Definition: mpegtables.h:750
MPEGStreamData::SetDesiredProgram
void SetDesiredProgram(int p)
Definition: mpegstreamdata.cpp:65
TimeDateTable
This table gives the current DVB stream time.
Definition: dvbtables.h:383
SignalMonitor::IsAllGood
virtual bool IsAllGood(void) const
Definition: signalmonitor.h:83
DVBStreamData::SetVersionSDT
void SetVersionSDT(uint tsid, int version, uint last_section)
Definition: dvbstreamdata.h:68
SignalMonitorValue::GetStatus
QString GetStatus() const
Returns a signal monitor value as one long string.
Definition: signalmonitorvalue.h:32
NetworkInformationTable::NetworkID
uint NetworkID(void) const
network_id 16 3.0 0x0000
Definition: dvbtables.h:59
SignalMonitor::kDTVSigMon_NITMatch
static const uint64_t kDTVSigMon_NITMatch
We've seen an NIT matching our requirements.
Definition: signalmonitor.h:173
DTVSignalMonitor::GetScanStreamData
ScanStreamData * GetScanStreamData()
Returns the scan stream data if it exists.
Definition: dtvsignalmonitor.cpp:565
SignalMonitor::kDTVSigMon_VCTMatch
static const uint64_t kDTVSigMon_VCTMatch
We've seen a VCT matching our requirements.
Definition: signalmonitor.h:167
DTVSignalMonitor::m_matchingPMT
SignalMonitorValue m_matchingPMT
Definition: dtvsignalmonitor.h:120
SignalMonitor::m_channel
ChannelBase * m_channel
Definition: signalmonitor.h:203
DTVSignalMonitor::m_seenVCT
SignalMonitorValue m_seenVCT
Definition: dtvsignalmonitor.h:115
ProgramMapTable
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:692
DTVSignalMonitor::m_seenMGT
SignalMonitorValue m_seenMGT
Definition: dtvsignalmonitor.h:114
SignalMonitor::kDTVSigMon_WaitForMGT
static const uint64_t kDTVSigMon_WaitForMGT
Definition: signalmonitor.h:183
DBG_SM
#define DBG_SM(FUNC, MSG)
Definition: dtvsignalmonitor.cpp:14
DTVSignalMonitor::HandleSTT
void HandleSTT(const SystemTimeTable *stt) override
Definition: dtvsignalmonitor.cpp:419
DTVSignalMonitor::m_networkID
uint m_networkID
Definition: dtvsignalmonitor.h:131
SignalMonitor::kDTVSigMon_CVCTSeen
static const uint64_t kDTVSigMon_CVCTSeen
We've seen a CVCT, the cable version of the VCT.
Definition: signalmonitor.h:148
MPEGStreamData::RemoveMPEGListener
void RemoveMPEGListener(MPEGStreamListener *val)
Definition: mpegstreamdata.cpp:1635
ProgramMapTable::IsVideo
bool IsVideo(uint i, const QString &sistandard) const
Returns true iff the stream at index i is a video stream.
Definition: mpegtables.cpp:514
DTVSignalMonitor::GetStreamData
MPEGStreamData * GetStreamData()
Returns the MPEG stream data if it exists.
Definition: dtvsignalmonitor.h:59
SignalMonitor::kDTVSigMon_SDTMatch
static const uint64_t kDTVSigMon_SDTMatch
We've seen an SDT matching our requirements.
Definition: signalmonitor.h:175
ProgramMapTable::ProgramNumber
uint ProgramNumber(void) const
Definition: mpegtables.h:729
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
DTVSignalMonitor::HandleTDT
void HandleTDT(const TimeDateTable *tdt) override
Definition: dtvsignalmonitor.cpp:502
DTVSignalMonitor::m_transportID
uint m_transportID
Definition: dtvsignalmonitor.h:132
ProgramAssociationTable::ProgramCount
uint ProgramCount(void) const
Definition: mpegtables.h:636
DTVSignalMonitor::m_matchingSDT
SignalMonitorValue m_matchingSDT
Definition: dtvsignalmonitor.h:124
VirtualChannelTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: atsctables.h:269
ScanStreamData
Definition: scanstreamdata.h:11
SignalMonitorValue::GetName
QString GetName(void) const
Returns the long name of this value.
Definition: signalmonitorvalue.cpp:83
ProgramMapTable::IsEncrypted
bool IsEncrypted(const QString &sistandard) const
Returns true iff PMT contains CA descriptor for a vid/aud stream.
Definition: mpegtables.cpp:552
MasterGuideTable::TableCount
uint TableCount() const
Definition: atsctables.h:117
VirtualChannelTable::toString
QString toString(void) const override
Definition: atsctables.cpp:200
DTVSignalMonitor::UpdateListeningForEIT
void UpdateListeningForEIT(void)
Definition: dtvsignalmonitor.cpp:171
SignalMonitor::kDTVSigMon_PMTMatch
static const uint64_t kDTVSigMon_PMTMatch
We've seen a PMT matching our requirements.
Definition: signalmonitor.h:163
SignalMonitor::AddFlags
virtual void AddFlags(uint64_t _flags)
Definition: signalmonitor.cpp:266
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
SignalMonitor::m_error
QString m_error
Definition: signalmonitor.h:216
SignalMonitor::m_statusLock
QRecursiveMutex m_statusLock
Definition: signalmonitor.h:232
DTVSignalMonitor::HandlePMT
void HandlePMT(uint program_num, const ProgramMapTable *pmt) override
Definition: dtvsignalmonitor.cpp:359
DTVSignalMonitor::HandleCVCT
void HandleCVCT(uint pid, const CableVirtualChannelTable *cvct) override
Definition: dtvsignalmonitor.cpp:475
DTVSignalMonitor::GetDTVChannel
DTVChannel * GetDTVChannel(void)
Definition: dtvsignalmonitor.cpp:69
PSIPTable
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
Definition: mpegtables.h:409
insert_crc
static bool insert_crc(QList< uint64_t > &seen_crc, const PSIPTable &psip)
Definition: dtvsignalmonitor.cpp:21
DTVSignalMonitor::UpdateMonitorValues
void UpdateMonitorValues(void)
Definition: dtvsignalmonitor.cpp:152
DTVSignalMonitor::m_detectedNetworkID
uint m_detectedNetworkID
Definition: dtvsignalmonitor.h:134
DTVSignalMonitor::m_seenSDT
SignalMonitorValue m_seenSDT
Definition: dtvsignalmonitor.h:117
minor
#define minor(X)
Definition: compat.h:76
ATSCStreamData::SetDesiredChannel
void SetDesiredChannel(int major, int minor)
Definition: atscstreamdata.cpp:57
SignalMonitor::RemoveFlags
virtual void RemoveFlags(uint64_t _flags)
Definition: signalmonitor.cpp:272
SignalMonitor::kDVBSigMon_WaitForPos
static const uint64_t kDVBSigMon_WaitForPos
Wait for rotor to complete turning the antenna.
Definition: signalmonitor.h:200
ProgramAssociationTable::TransportStreamID
uint TransportStreamID(void) const
Definition: mpegtables.h:634
VirtualChannelTable::Find
int Find(int major, int minor) const
Definition: atsctables.cpp:484
ProgramAssociationTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: mpegtables.h:643
MasterGuideTable::TablePID
uint TablePID(uint i) const
Definition: atsctables.h:131
ServiceDescriptionTable::OriginalNetworkID
uint OriginalNetworkID() const
original_network_id 16 8.0
Definition: dvbtables.h:141
DTVSignalMonitor::m_seenCrypt
SignalMonitorValue m_seenCrypt
Definition: dtvsignalmonitor.h:118
DTVSignalMonitor::m_seenTableCrc
QList< uint64_t > m_seenTableCrc
Definition: dtvsignalmonitor.h:139
scanstreamdata.h
compat.h
MPEGStreamData::SetVersionPAT
void SetVersionPAT(uint tsid, int version, uint last_section)
Definition: mpegstreamdata.h:162
DTVSignalMonitor::m_seenPAT
SignalMonitorValue m_seenPAT
Definition: dtvsignalmonitor.h:112
ATSCStreamData
Encapsulates data about ATSC stream and emits events for most tables.
Definition: atscstreamdata.h:29
SignalMonitor::kDTVSigMon_CVCTMatch
static const uint64_t kDTVSigMon_CVCTMatch
We've seen a CVCT matching our requirements.
Definition: signalmonitor.h:171
SignalMonitor::kDTVSigMon_WaitForPMT
static const uint64_t kDTVSigMon_WaitForPMT
Definition: signalmonitor.h:182
SignalMonitor::kDTVSigMon_WaitForPAT
static const uint64_t kDTVSigMon_WaitForPAT
Definition: signalmonitor.h:181
SignalMonitor::kDTVSigMon_WaitForNIT
static const uint64_t kDTVSigMon_WaitForNIT
Definition: signalmonitor.h:185
SignalMonitor::kDTVSigMon_WaitForSDT
static const uint64_t kDTVSigMon_WaitForSDT
Definition: signalmonitor.h:186
MPEGStreamData
Encapsulates data about MPEG stream and emits events for each table.
Definition: mpegstreamdata.h:85
DTVSignalMonitor::GetDVBStreamData
DVBStreamData * GetDVBStreamData()
Returns the DVB stream data if it exists.
Definition: dtvsignalmonitor.cpp:560
DTVSignalMonitor::GetStatusList
QStringList GetStatusList(void) const override
Returns QStringList containing all signals and their current values.
Definition: dtvsignalmonitor.cpp:74
ServiceDescriptionTable
This table tells the decoder on which PIDs to find A/V data.
Definition: dvbtables.h:110
SignalMonitor::kDTVSigMon_SDTSeen
static const uint64_t kDTVSigMon_SDTSeen
We've seen a SDT, which maps DVB Channels to MPEG program numbers, and provides additional data.
Definition: signalmonitor.h:154
PID::DVB_SDT_PID
@ DVB_SDT_PID
Definition: mpegtables.h:216
ProgramAssociationTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:815
DVBStreamData
Definition: dvbstreamdata.h:33
DTVSignalMonitor::m_matchingVCT
SignalMonitorValue m_matchingVCT
Definition: dtvsignalmonitor.h:122
dvbtables.h
mpegtables.h
SignalMonitor::kDTVSigMon_NITSeen
static const uint64_t kDTVSigMon_NITSeen
We've seen a NIT, which tells us where to find SDT and other DVB tables.
Definition: signalmonitor.h:151
DTVSignalMonitor::HandleMGT
void HandleMGT(const MasterGuideTable *mgt) override
Definition: dtvsignalmonitor.cpp:425
DTVSignalMonitor::m_matchingCrypt
SignalMonitorValue m_matchingCrypt
Definition: dtvsignalmonitor.h:125
SignalMonitor::kDTVSigMon_TVCTSeen
static const uint64_t kDTVSigMon_TVCTSeen
We've seen a TVCT, the terrestrial version of the VCT.
Definition: signalmonitor.h:146
SignalMonitor::kDTVSigMon_PATSeen
static const uint64_t kDTVSigMon_PATSeen
We've seen a PAT, which maps MPEG program numbers to pids where we find PMTs.
Definition: signalmonitor.h:135
SignalMonitor::kDTVSigMon_PMTSeen
static const uint64_t kDTVSigMon_PMTSeen
We've seen a PMT, which maps program to audio, video and other stream PIDs.
Definition: signalmonitor.h:138
DTVSignalMonitor::m_streamData
MPEGStreamData * m_streamData
Definition: dtvsignalmonitor.h:110
DTVSignalMonitor::~DTVSignalMonitor
~DTVSignalMonitor() override
Definition: dtvsignalmonitor.cpp:64
uint
unsigned int uint
Definition: compat.h:79
ATSCStreamData::AddATSCMainListener
void AddATSCMainListener(ATSCMainStreamListener *val)
Definition: atscstreamdata.cpp:938
LOC
#define LOC
Definition: dtvsignalmonitor.cpp:17
ProgramAssociationTable
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:615
ATSCStreamData::RemoveATSCAuxListener
void RemoveATSCAuxListener(ATSCAuxStreamListener *val)
Definition: atscstreamdata.cpp:998
DTVSignalMonitor::GetATSCStreamData
ATSCStreamData * GetATSCStreamData()
Returns the ATSC stream data if it exists.
Definition: dtvsignalmonitor.cpp:555
SignalMonitor
Signal monitoring base class.
Definition: signalmonitor.h:32
ProgramMapTable::IsAudio
bool IsAudio(uint i, const QString &sistandard) const
Returns true iff the stream at index i is an audio stream.
Definition: mpegtables.cpp:536
SignalMonitorValue::IsGood
bool IsGood() const
Returns true if the value is equal to the threshold, or on the right side of the threshold (depends o...
Definition: signalmonitorvalue.h:56
TableClass::TVCTc
@ TVCTc
Definition: atsctables.h:60
DVBStreamData::SetDesiredService
void SetDesiredService(uint netid, uint tsid, int serviceid)
Definition: dvbstreamdata.cpp:41
SignalMonitor::kDTVSigMon_VCTSeen
static const uint64_t kDTVSigMon_VCTSeen
We've seen a VCT, which maps ATSC Channels to MPEG program numbers, and provides additional data.
Definition: signalmonitor.h:144
MPEGStreamData::AddMPEGListener
void AddMPEGListener(MPEGStreamListener *val)
Definition: mpegstreamdata.cpp:1624
DTVSignalMonitor::SetProgramNumber
void SetProgramNumber(int progNum)
Definition: dtvsignalmonitor.cpp:214
TimeOffset
Definition: channelsettings.cpp:175
ATSCStreamData::RemoveATSCMainListener
void RemoveATSCMainListener(ATSCMainStreamListener *val)
Definition: atscstreamdata.cpp:948
MasterGuideTable
This table tells the decoder on which PIDs to find other tables, and their sizes and each table's cur...
Definition: atsctables.h:77
SignalMonitor::kDTVSigMon_CryptSeen
static const uint64_t kDTVSigMon_CryptSeen
We've seen something indicating whether the data stream is encrypted.
Definition: signalmonitor.h:158
SignalMonitor::kDTVSigMon_MGTMatch
static const uint64_t kDTVSigMon_MGTMatch
We've seen an MGT matching our requirements.
Definition: signalmonitor.h:165
DVBStreamData::AddDVBMainListener
void AddDVBMainListener(DVBMainStreamListener *val)
Definition: dvbstreamdata.cpp:1017
DTVSignalMonitor::m_matchingNIT
SignalMonitorValue m_matchingNIT
Definition: dtvsignalmonitor.h:123
DTVSignalMonitor::SetChannel
void SetChannel(int major, int minor)
Definition: dtvsignalmonitor.cpp:196
DTVSignalMonitor::m_eitPids
std::vector< uint > m_eitPids
Definition: dtvsignalmonitor.h:111
PESPacket::CRC
uint CRC(void) const
Definition: pespacket.h:191
SignalMonitor::kDTVSigMon_MGTSeen
static const uint64_t kDTVSigMon_MGTSeen
We've seen a MGT, which tells us on which PIDs to find VCT and other ATSC tables.
Definition: signalmonitor.h:141
DTVSignalMonitor::m_ignoreEncrypted
bool m_ignoreEncrypted
Definition: dtvsignalmonitor.h:141
DTVSignalMonitor::DTVSignalMonitor
DTVSignalMonitor(int db_cardnum, DTVChannel *_channel, bool _release_stream, uint64_t wait_for_mask)
Definition: dtvsignalmonitor.cpp:41
PSIPTable::TableID
uint TableID(void) const
Definition: mpegtables.h:515
DTVSignalMonitor::HandleEncryptionStatus
void HandleEncryptionStatus(uint pnum, bool enc_status) override
Definition: dtvsignalmonitor.cpp:548
SignalMonitor::kDTVSigMon_PATMatch
static const uint64_t kDTVSigMon_PATMatch
We've seen a PAT matching our requirements.
Definition: signalmonitor.h:161
TerrestrialVirtualChannelTable
This table contains information about the terrestrial channels transmitted on this multiplex.
Definition: atsctables.h:348
DTVSignalMonitor::SetStreamData
virtual void SetStreamData(MPEGStreamData *data)
Sets the MPEG stream data for DTVSignalMonitor to use, and connects the table signals to the monitor.
Definition: dtvsignalmonitor.cpp:258
SignalMonitor::kDTVSigMon_TVCTMatch
static const uint64_t kDTVSigMon_TVCTMatch
We've seen a TVCT matching our requirements.
Definition: signalmonitor.h:169
DTVSignalMonitor::HandleNIT
void HandleNIT(const NetworkInformationTable *nit) override
Definition: dtvsignalmonitor.cpp:508
atsctables.h
CableVirtualChannelTable
This table contains information about the cable channels transmitted on this multiplex.
Definition: atsctables.h:417
SystemTimeTable
This table contains the GPS time at the time of transmission.
Definition: atsctables.h:681
MPEGStreamData::AddListeningPID
virtual void AddListeningPID(uint pid, PIDPriority priority=kPIDPriorityNormal)
Definition: mpegstreamdata.h:120
ProgramAssociationTable::FindPID
uint FindPID(uint progNum) const
Definition: mpegtables.h:655
SignalMonitor::GetStatusList
virtual QStringList GetStatusList(void) const
Returns QStringList containing all signals and their current values.
Definition: signalmonitor.cpp:331
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:33
ATSCStreamData::SetVersionCVCT
void SetVersionCVCT(uint tsid, int version)
Definition: atscstreamdata.h:61
DTVSignalMonitor::m_minorChannel
int m_minorChannel
Definition: dtvsignalmonitor.h:129
SignalMonitor::kDTVSigMon_CryptMatch
static const uint64_t kDTVSigMon_CryptMatch
We've seen unencrypted data in data stream.
Definition: signalmonitor.h:179
DTVSignalMonitor::m_matchingPAT
SignalMonitorValue m_matchingPAT
Definition: dtvsignalmonitor.h:119
DTVSignalMonitor::HandlePAT
void HandlePAT(const ProgramAssociationTable *pat) override
Definition: dtvsignalmonitor.cpp:291
DTVSignalMonitor::IsAllGood
bool IsAllGood(void) const override
Definition: dtvsignalmonitor.cpp:585
VirtualChannelTable::TransportStreamID
uint TransportStreamID() const
Definition: atsctables.h:221
DTVSignalMonitor::HandleTVCT
void HandleTVCT(uint pid, const TerrestrialVirtualChannelTable *tvct) override
Definition: dtvsignalmonitor.cpp:444
DTVSignalMonitor::HandleSDT
void HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) override
Definition: dtvsignalmonitor.cpp:516
dtvsignalmonitor.h
MPEGStreamData::TestDecryption
void TestDecryption(const ProgramMapTable *pmt)
Definition: mpegstreamdata.cpp:1836
DTVSignalMonitor::m_seenNIT
SignalMonitorValue m_seenNIT
Definition: dtvsignalmonitor.h:116
MPEGStreamData::RemoveListeningPID
virtual void RemoveListeningPID(uint pid)
Definition: mpegstreamdata.h:135
ServiceDescriptionTable::TSID
uint TSID() const
transport_stream_id 16 3.0 0x0000
Definition: dvbtables.h:138
DTVSignalMonitor::m_programNumber
int m_programNumber
Definition: dtvsignalmonitor.h:137
SignalMonitor::kDTVSigMon_WaitForCrypt
static const uint64_t kDTVSigMon_WaitForCrypt
Definition: signalmonitor.h:189
find
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
Definition: dvbstreamhandler.cpp:363
DTVSignalMonitor::m_detectedTransportID
uint m_detectedTransportID
Definition: dtvsignalmonitor.h:135
SignalMonitor::kDTVSigMon_WaitForVCT
static const uint64_t kDTVSigMon_WaitForVCT
Definition: signalmonitor.h:184
DTVSignalMonitor::m_seenPMT
SignalMonitorValue m_seenPMT
Definition: dtvsignalmonitor.h:113
TableClass::CVCTc
@ CVCTc
Definition: atsctables.h:62
NetworkInformationTable
This table tells the decoder on which PIDs to find other tables.
Definition: dvbtables.h:30
ATSCStreamData::SetVersionTVCT
void SetVersionTVCT(uint tsid, int version)
Definition: atscstreamdata.h:59