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).arg(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  if (insert_crc(m_seenTableCrc, *pat))
314  {
315  QString errStr = QString("Program #%1 not found in PAT!")
316  .arg(m_programNumber);
317  LOG(VB_GENERAL, LOG_ERR, LOC + errStr + "\n" + pat->toString());
318  }
319  // only one entry in the PAT, just use it
320  if (pat->ProgramCount() == 1)
321  {
322  LOG(VB_GENERAL, LOG_ERR, LOC + "But there is only one program "
323  "in the PAT, so we'll just use it");
327  }
328  // two entries, but one is a pointer to the NIT PID instead
329  // of a real program, use the other
330  if ((pat->ProgramCount() == 2) && ((pat->ProgramNumber(0) == 0) || (pat->ProgramNumber(1) == 0)))
331  {
332  LOG(VB_GENERAL, LOG_ERR, LOC + "But there is only one program "
333  "in the PAT, so we'll just use it");
334  uint pid = pat->FindAnyPID();
335  SetProgramNumber(pat->FindProgram(pid));
338  }
339  }
340 }
341 
342 void DTVSignalMonitor::HandlePMT(uint /*program_num*/, const ProgramMapTable *pmt)
343 {
345 
346  if (m_programNumber < 0)
347  return; // don't print error messages during channel scan.
348 
349  if (pmt->ProgramNumber() != (uint)m_programNumber)
350  {
351  if (insert_crc(m_seenTableCrc, *pmt))
352  {
353  LOG(VB_CHANNEL, LOG_DEBUG, LOC +
354  QString("Wrong PMT; pmt->ProgramNumber(%1) desired(%2)")
355  .arg(pmt->ProgramNumber()).arg(m_programNumber));
356  }
357  return; // Not the PMT we are looking for...
358  }
359 
360  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) {
361  LOG(VB_GENERAL, LOG_NOTICE, LOC +
362  QString("PMT says program %1 is encrypted").arg(m_programNumber));
364  }
365 
366  // if PMT contains audio and/or video stream set as matching.
367  uint hasAudio = 0;
368  uint hasVideo = 0;
369 
370  for (uint i = 0; i < pmt->StreamCount(); i++)
371  {
372  if (pmt->IsVideo(i, GetDTVChannel()->GetSIStandard()))
373  hasVideo++;
374  if (pmt->IsAudio(i, GetDTVChannel()->GetSIStandard()))
375  hasAudio++;
376  }
377 
378  if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
379  (hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
380  {
381  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) &&
384 
386  }
387  else
388  {
389  LOG(VB_GENERAL, LOG_ERR, LOC +
390  QString("We want %1 audio and %2 video streams")
391  .arg(GetStreamData()->GetAudioStreamsRequired())
392  .arg(GetStreamData()->GetVideoStreamsRequired()) +
393  QString("\n\t\t\tBut have %1 audio and %2 video streams")
394  .arg(hasAudio).arg(hasVideo));
395  }
396 }
397 
399 {
400  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
401  .arg(GetStreamData()->TimeOffset()));
402 }
403 
405 {
407 
409  if (!atsc)
410  return;
411 
412  for (uint i=0; i<mgt->TableCount(); i++)
413  {
414  if ((TableClass::TVCTc == mgt->TableClass(i)) ||
415  (TableClass::CVCTc == mgt->TableClass(i)))
416  {
417  atsc->AddListeningPID(mgt->TablePID(i));
419  }
420  }
421 }
422 
424  uint /*pid*/, const TerrestrialVirtualChannelTable* tvct)
425 {
427  int idx = tvct->Find(m_majorChannel, m_minorChannel);
428 
429  if (m_minorChannel < 0)
430  return; // don't print error message during channel scan.
431 
432  if (idx < 0)
433  {
434  if (insert_crc(m_seenTableCrc, *tvct))
435  {
436  LOG(VB_GENERAL, LOG_ERR, LOC +
437  QString("Could not find channel %1_%2 in TVCT")
438  .arg(m_majorChannel).arg(m_minorChannel));
439  LOG(VB_GENERAL, LOG_DEBUG, LOC + tvct->toString());
440  }
442  if (atsc)
443  atsc->SetVersionTVCT(tvct->TransportStreamID(),-1);
444  return;
445  }
446 
447  DBG_SM("HandleTVCT()", QString("tvct->ProgramNumber(idx %1): prog num %2")
448  .arg(idx).arg(tvct->ProgramNumber(idx)));
449 
450  SetProgramNumber(tvct->ProgramNumber(idx));
452 }
453 
455 {
457  int idx = cvct->Find(m_majorChannel, m_minorChannel);
458 
459  if (idx < 0)
460  {
461  if (insert_crc(m_seenTableCrc, *cvct))
462  {
463  LOG(VB_GENERAL, LOG_ERR, LOC +
464  QString("Could not find channel %1_%2 in CVCT")
465  .arg(m_majorChannel).arg(m_minorChannel));
466  LOG(VB_GENERAL, LOG_DEBUG, LOC + cvct->toString());
467  }
469  if (atsc)
470  atsc->SetVersionCVCT(cvct->TransportStreamID(),-1);
471  return;
472  }
473 
474  DBG_SM("HandleCVCT()", QString("cvct->ProgramNumber(idx %1): prog num %2")
475  .arg(idx).arg(cvct->ProgramNumber(idx)));
476 
477  SetProgramNumber(cvct->ProgramNumber(idx));
479 }
480 
482 {
483  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
484  .arg(GetStreamData()->TimeOffset()));
485 }
486 
488 {
489  DBG_SM("HandleNIT()", QString("net_id = %1").arg(nit->NetworkID()));
491  if (!GetDVBStreamData())
492  return;
493 }
494 
496 {
498 
500  m_detectedTransportID = sdt->TSID();
501 
502  // if the multiplex is not properly configured with ONID and TSID then take
503  // whatever SDT we see first
504  if ((m_networkID == 0) && (m_transportID == 0))
505  {
508 
509  // FIXME assert if TableID == SDTo
510  }
511 
512  if (sdt->OriginalNetworkID() != m_networkID || sdt->TSID() != m_transportID)
513  {
515  if (dvb)
516  dvb->SetVersionSDT(sdt->TSID(), -1, 0);
517  }
518  else
519  {
520  DBG_SM("HandleSDT()", QString("tsid = %1 orig_net_id = %2")
521  .arg(sdt->TSID()).arg(sdt->OriginalNetworkID()));
524  }
525 }
526 
527 void DTVSignalMonitor::HandleEncryptionStatus(uint /*program_number*/, bool enc_status)
528 {
530  if (!enc_status)
532 }
533 
535 {
536  return dynamic_cast<ATSCStreamData*>(m_streamData);
537 }
538 
540 {
541  return dynamic_cast<DVBStreamData*>(m_streamData);
542 }
543 
545 {
546  return dynamic_cast<ScanStreamData*>(m_streamData);
547 }
548 
550 {
551  return dynamic_cast<const ATSCStreamData*>(m_streamData);
552 }
553 
555 {
556  return dynamic_cast<const DVBStreamData*>(m_streamData);
557 }
558 
560 {
561  return dynamic_cast<const ScanStreamData*>(m_streamData);
562 }
563 
565 {
566  QMutexLocker locker(&m_statusLock);
568  return false;
570  return false;
572  return false;
574  return false;
576  return false;
578  return false;
580  return false;
582  return false;
583 
584  return true;
585 }
MasterGuideTable::TableClass
int TableClass(uint i) const
Definition: atsctables.cpp:25
ProgramAssociationTable::FindAnyPID
uint FindAnyPID(void) const
Definition: mpegtables.h:662
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:544
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
ProgramAssociationTable::FindProgram
uint FindProgram(uint pid) const
Definition: mpegtables.h:669
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:398
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:481
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:266
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:114
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:342
DTVSignalMonitor::HandleCVCT
void HandleCVCT(uint pid, const CableVirtualChannelTable *cvct) override
Definition: dtvsignalmonitor.cpp:454
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:138
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:128
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:539
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:404
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:140
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:534
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:57
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:74
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:527
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:345
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:487
atsctables.h
CableVirtualChannelTable
This table contains information about the cable channels transmitted on this multiplex.
Definition: atsctables.h:414
SystemTimeTable
This table contains the GPS time at the time of transmission.
Definition: atsctables.h:678
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:564
VirtualChannelTable::TransportStreamID
uint TransportStreamID() const
Definition: atsctables.h:218
DTVSignalMonitor::HandleTVCT
void HandleTVCT(uint pid, const TerrestrialVirtualChannelTable *tvct) override
Definition: dtvsignalmonitor.cpp:423
DTVSignalMonitor::HandleSDT
void HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) override
Definition: dtvsignalmonitor.cpp:495
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:59
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