MythTV  master
dtvsignalmonitor.cpp
Go to the documentation of this file.
1 #include <unistd.h>
2 
3 #include <algorithm> // for lower_bound
4 
5 #include "dtvchannel.h"
6 #include "dtvsignalmonitor.h"
7 #include "scanstreamdata.h"
8 #include "mpegtables.h"
9 #include "atsctables.h"
10 #include "dvbtables.h"
11 #include "compat.h"
12 
13 #undef DBG_SM
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  DBG_SM("HandlePAT()", QString("Received PAT for tsid %1 waiting for tsid %2")
314  .arg(tsid).arg(m_transportID));
315 
316  // Only one entry in the PAT, just use this program
317  int spts_program = 0;
318  if (pat->ProgramCount() == 1)
319  {
320  spts_program = pat->ProgramNumber(0);
321  pmt_pid = pat->ProgramPID(0);
322  }
323 
324  // Two entries in the PAT, but if one is a pointer to the NIT PID
325  // instead of a real program then the other is the single program.
326  if (pat->ProgramCount() == 2)
327  {
328  if (pat->ProgramNumber(0) == 0)
329  {
330  spts_program = pat->ProgramNumber(1);
331  pmt_pid = pat->ProgramPID(1);
332  }
333  else if (pat->ProgramNumber(1) == 0)
334  {
335  spts_program = pat->ProgramNumber(0);
336  pmt_pid = pat->ProgramPID(0);
337  }
338  }
339 
340  if (spts_program > 0)
341  {
342  LOG(VB_GENERAL, LOG_INFO, LOC +
343  QString("Program %1 found in PAT of SPTS").arg(spts_program));
344  SetProgramNumber(spts_program);
346  GetStreamData()->AddListeningPID(pmt_pid);
347  }
348 
349  if (insert_crc(m_seenTableCrc, *pat))
350  {
351  QString errStr = QString("Program #%1 not found in PAT!")
352  .arg(m_programNumber);
353  LOG(VB_GENERAL, LOG_ERR, LOC + errStr + "\n" + pat->toString());
354  }
355  }
356 }
357 
358 void DTVSignalMonitor::HandlePMT(uint /*program_num*/, const ProgramMapTable *pmt)
359 {
361 
362  if (m_programNumber < 0)
363  return; // don't print error messages during channel scan.
364 
365  if (pmt->ProgramNumber() != (uint)m_programNumber)
366  {
367  if (insert_crc(m_seenTableCrc, *pmt))
368  {
369  LOG(VB_CHANNEL, LOG_DEBUG, LOC +
370  QString("Wrong PMT; pmt->ProgramNumber(%1) desired(%2)")
371  .arg(pmt->ProgramNumber()).arg(m_programNumber));
372  }
373  return; // Not the PMT we are looking for...
374  }
375 
376  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) {
377  LOG(VB_GENERAL, LOG_NOTICE, LOC +
378  QString("PMT says program %1 is encrypted").arg(m_programNumber));
380  }
381 
382  // if PMT contains audio and/or video stream set as matching.
383  uint hasAudio = 0;
384  uint hasVideo = 0;
385 
386  for (uint i = 0; i < pmt->StreamCount(); i++)
387  {
388  if (pmt->IsVideo(i, GetDTVChannel()->GetSIStandard()))
389  hasVideo++;
390  if (pmt->IsAudio(i, GetDTVChannel()->GetSIStandard()))
391  hasAudio++;
392  }
393 
394  if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
395  (hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
396  {
397  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) &&
400 
402  }
403  else
404  {
405  LOG(VB_GENERAL, LOG_ERR, LOC +
406  QString("We want %1 audio and %2 video streams")
407  .arg(GetStreamData()->GetAudioStreamsRequired())
408  .arg(GetStreamData()->GetVideoStreamsRequired()) +
409  QString("\n\t\t\tBut have %1 audio and %2 video streams")
410  .arg(hasAudio).arg(hasVideo));
411  }
412 }
413 
415 {
416  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
417  .arg(GetStreamData()->TimeOffset()));
418 }
419 
421 {
423 
425  if (!atsc)
426  return;
427 
428  for (uint i=0; i<mgt->TableCount(); i++)
429  {
430  if ((TableClass::TVCTc == mgt->TableClass(i)) ||
431  (TableClass::CVCTc == mgt->TableClass(i)))
432  {
433  atsc->AddListeningPID(mgt->TablePID(i));
435  }
436  }
437 }
438 
440  uint /*pid*/, const TerrestrialVirtualChannelTable* tvct)
441 {
443  int idx = tvct->Find(m_majorChannel, m_minorChannel);
444 
445  if (m_minorChannel < 0)
446  return; // don't print error message during channel scan.
447 
448  if (idx < 0)
449  {
450  if (insert_crc(m_seenTableCrc, *tvct))
451  {
452  LOG(VB_GENERAL, LOG_ERR, LOC +
453  QString("Could not find channel %1_%2 in TVCT")
454  .arg(m_majorChannel).arg(m_minorChannel));
455  LOG(VB_GENERAL, LOG_DEBUG, LOC + tvct->toString());
456  }
458  if (atsc)
459  atsc->SetVersionTVCT(tvct->TransportStreamID(),-1);
460  return;
461  }
462 
463  DBG_SM("HandleTVCT()", QString("tvct->ProgramNumber(idx %1): prog num %2")
464  .arg(idx).arg(tvct->ProgramNumber(idx)));
465 
466  SetProgramNumber(tvct->ProgramNumber(idx));
468 }
469 
471 {
473  int idx = cvct->Find(m_majorChannel, m_minorChannel);
474 
475  if (idx < 0)
476  {
477  if (insert_crc(m_seenTableCrc, *cvct))
478  {
479  LOG(VB_GENERAL, LOG_ERR, LOC +
480  QString("Could not find channel %1_%2 in CVCT")
481  .arg(m_majorChannel).arg(m_minorChannel));
482  LOG(VB_GENERAL, LOG_DEBUG, LOC + cvct->toString());
483  }
485  if (atsc)
486  atsc->SetVersionCVCT(cvct->TransportStreamID(),-1);
487  return;
488  }
489 
490  DBG_SM("HandleCVCT()", QString("cvct->ProgramNumber(idx %1): prog num %2")
491  .arg(idx).arg(cvct->ProgramNumber(idx)));
492 
493  SetProgramNumber(cvct->ProgramNumber(idx));
495 }
496 
498 {
499  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
500  .arg(GetStreamData()->TimeOffset()));
501 }
502 
504 {
505  DBG_SM("HandleNIT()", QString("net_id = %1").arg(nit->NetworkID()));
507  if (!GetDVBStreamData())
508  return;
509 }
510 
512 {
514 
516  m_detectedTransportID = sdt->TSID();
517 
518  // if the multiplex is not properly configured with ONID and TSID then take
519  // whatever SDT we see first
520  if ((m_networkID == 0) && (m_transportID == 0))
521  {
524 
525  // FIXME assert if TableID == SDTo
526  }
527 
528  if (sdt->OriginalNetworkID() != m_networkID || sdt->TSID() != m_transportID)
529  {
531  if (dvb)
532  dvb->SetVersionSDT(sdt->TSID(), -1, 0);
533  }
534  else
535  {
536  DBG_SM("HandleSDT()", QString("tsid = %1 orig_net_id = %2")
537  .arg(sdt->TSID()).arg(sdt->OriginalNetworkID()));
540  }
541 }
542 
543 void DTVSignalMonitor::HandleEncryptionStatus(uint /*program_number*/, bool enc_status)
544 {
546  if (!enc_status)
548 }
549 
551 {
552  return dynamic_cast<ATSCStreamData*>(m_streamData);
553 }
554 
556 {
557  return dynamic_cast<DVBStreamData*>(m_streamData);
558 }
559 
561 {
562  return dynamic_cast<ScanStreamData*>(m_streamData);
563 }
564 
566 {
567  return dynamic_cast<const ATSCStreamData*>(m_streamData);
568 }
569 
571 {
572  return dynamic_cast<const DVBStreamData*>(m_streamData);
573 }
574 
576 {
577  return dynamic_cast<const ScanStreamData*>(m_streamData);
578 }
579 
581 {
582  QMutexLocker locker(&m_statusLock);
584  return false;
586  return false;
588  return false;
590  return false;
592  return false;
594  return false;
596  return false;
598  return false;
599 
600  return true;
601 }
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:208
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:66
TimeDateTable
This table gives the current DVB stream time.
Definition: dvbtables.h:383
SignalMonitor::IsAllGood
virtual bool IsAllGood(void) const
Definition: signalmonitor.h:85
DVBStreamData::SetVersionSDT
void SetVersionSDT(uint tsid, int version, uint last_section)
Definition: dvbstreamdata.h:67
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:175
DTVSignalMonitor::GetScanStreamData
ScanStreamData * GetScanStreamData()
Returns the scan stream data if it exists.
Definition: dtvsignalmonitor.cpp:560
SignalMonitor::kDTVSigMon_VCTMatch
static const uint64_t kDTVSigMon_VCTMatch
We've seen a VCT matching our requirements.
Definition: signalmonitor.h:169
DTVSignalMonitor::m_matchingPMT
SignalMonitorValue m_matchingPMT
Definition: dtvsignalmonitor.h:120
SignalMonitor::m_channel
ChannelBase * m_channel
Definition: signalmonitor.h:205
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:185
DBG_SM
#define DBG_SM(FUNC, MSG)
Definition: dtvsignalmonitor.cpp:14
DTVSignalMonitor::HandleSTT
void HandleSTT(const SystemTimeTable *stt) override
Definition: dtvsignalmonitor.cpp:414
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:150
MPEGStreamData::RemoveMPEGListener
void RemoveMPEGListener(MPEGStreamListener *val)
Definition: mpegstreamdata.cpp:1623
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:513
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:177
ProgramMapTable::ProgramNumber
uint ProgramNumber(void) const
Definition: mpegtables.h:729
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
DTVSignalMonitor::HandleTDT
void HandleTDT(const TimeDateTable *tdt) override
Definition: dtvsignalmonitor.cpp:497
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:10
SignalMonitorValue::GetName
QString GetName(void) const
Returns the long name of this value.
Definition: signalmonitorvalue.cpp:82
ProgramMapTable::IsEncrypted
bool IsEncrypted(const QString &sistandard) const
Returns true iff PMT contains CA descriptor for a vid/aud stream.
Definition: mpegtables.cpp:551
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:165
SignalMonitor::AddFlags
virtual void AddFlags(uint64_t _flags)
Definition: signalmonitor.cpp:265
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
SignalMonitor::m_error
QString m_error
Definition: signalmonitor.h:218
SignalMonitor::m_statusLock
QRecursiveMutex m_statusLock
Definition: signalmonitor.h:234
DTVSignalMonitor::HandlePMT
void HandlePMT(uint program_num, const ProgramMapTable *pmt) override
Definition: dtvsignalmonitor.cpp:358
DTVSignalMonitor::HandleCVCT
void HandleCVCT(uint pid, const CableVirtualChannelTable *cvct) override
Definition: dtvsignalmonitor.cpp:470
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:141
ATSCStreamData::SetDesiredChannel
void SetDesiredChannel(int major, int minor)
Definition: atscstreamdata.cpp:57
SignalMonitor::RemoveFlags
virtual void RemoveFlags(uint64_t _flags)
Definition: signalmonitor.cpp:271
SignalMonitor::kDVBSigMon_WaitForPos
static const uint64_t kDVBSigMon_WaitForPos
Wait for rotor to complete turning the antenna.
Definition: signalmonitor.h:202
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:161
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:28
SignalMonitor::kDTVSigMon_CVCTMatch
static const uint64_t kDTVSigMon_CVCTMatch
We've seen a CVCT matching our requirements.
Definition: signalmonitor.h:173
SignalMonitor::kDTVSigMon_WaitForPMT
static const uint64_t kDTVSigMon_WaitForPMT
Definition: signalmonitor.h:184
SignalMonitor::kDTVSigMon_WaitForPAT
static const uint64_t kDTVSigMon_WaitForPAT
Definition: signalmonitor.h:183
SignalMonitor::kDTVSigMon_WaitForNIT
static const uint64_t kDTVSigMon_WaitForNIT
Definition: signalmonitor.h:187
SignalMonitor::kDTVSigMon_WaitForSDT
static const uint64_t kDTVSigMon_WaitForSDT
Definition: signalmonitor.h:188
MPEGStreamData
Encapsulates data about MPEG stream and emits events for each table.
Definition: mpegstreamdata.h:84
DTVSignalMonitor::GetDVBStreamData
DVBStreamData * GetDVBStreamData()
Returns the DVB stream data if it exists.
Definition: dtvsignalmonitor.cpp:555
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:156
PID::DVB_SDT_PID
@ DVB_SDT_PID
Definition: mpegtables.h:216
ProgramAssociationTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:814
DVBStreamData
Definition: dvbstreamdata.h:32
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:153
DTVSignalMonitor::HandleMGT
void HandleMGT(const MasterGuideTable *mgt) override
Definition: dtvsignalmonitor.cpp:420
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:148
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:137
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:140
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:144
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:550
SignalMonitor
Signal monitoring base class.
Definition: signalmonitor.h:34
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:535
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:146
MPEGStreamData::AddMPEGListener
void AddMPEGListener(MPEGStreamListener *val)
Definition: mpegstreamdata.cpp:1612
DTVSignalMonitor::SetProgramNumber
void SetProgramNumber(int progNum)
Definition: dtvsignalmonitor.cpp:214
TimeOffset
Definition: channelsettings.cpp:174
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:160
SignalMonitor::kDTVSigMon_MGTMatch
static const uint64_t kDTVSigMon_MGTMatch
We've seen an MGT matching our requirements.
Definition: signalmonitor.h:167
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:190
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:143
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:543
SignalMonitor::kDTVSigMon_PATMatch
static const uint64_t kDTVSigMon_PATMatch
We've seen a PAT matching our requirements.
Definition: signalmonitor.h:163
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:171
DTVSignalMonitor::HandleNIT
void HandleNIT(const NetworkInformationTable *nit) override
Definition: dtvsignalmonitor.cpp:503
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:119
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:330
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:60
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:181
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:580
VirtualChannelTable::TransportStreamID
uint TransportStreamID() const
Definition: atsctables.h:221
DTVSignalMonitor::HandleTVCT
void HandleTVCT(uint pid, const TerrestrialVirtualChannelTable *tvct) override
Definition: dtvsignalmonitor.cpp:439
DTVSignalMonitor::HandleSDT
void HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) override
Definition: dtvsignalmonitor.cpp:511
dtvsignalmonitor.h
MPEGStreamData::TestDecryption
void TestDecryption(const ProgramMapTable *pmt)
Definition: mpegstreamdata.cpp:1807
DTVSignalMonitor::m_seenNIT
SignalMonitorValue m_seenNIT
Definition: dtvsignalmonitor.h:116
MPEGStreamData::RemoveListeningPID
virtual void RemoveListeningPID(uint pid)
Definition: mpegstreamdata.h:134
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:191
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:356
DTVSignalMonitor::m_detectedTransportID
uint m_detectedTransportID
Definition: dtvsignalmonitor.h:135
SignalMonitor::kDTVSigMon_WaitForVCT
static const uint64_t kDTVSigMon_WaitForVCT
Definition: signalmonitor.h:186
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:58