MythTV  master
dtvsignalmonitor.cpp
Go to the documentation of this file.
1 #include <unistd.h>
2 
3 #include <algorithm> // for lower_bound
4 using namespace std;
5 
6 #include "dtvchannel.h"
7 #include "dtvsignalmonitor.h"
8 #include "scanstreamdata.h"
9 #include "mpegtables.h"
10 #include "atsctables.h"
11 #include "dvbtables.h"
12 #include "compat.h"
13 
14 #undef DBG_SM
15 #define DBG_SM(FUNC, MSG) LOG(VB_CHANNEL, LOG_INFO, \
16  QString("DTVSigMon[%1](%2): %3 %4").arg(m_inputid) \
17  .arg(m_channel->GetDevice()).arg(FUNC).arg(MSG))
18 
19 #define LOC QString("DTVSigMon[%1](%2): ") \
20  .arg(m_inputid).arg(m_channel->GetDevice())
21 
22 // inserts tid&crc value into an ordered list
23 // returns true if item is inserted
24 static bool insert_crc(QList<uint64_t> &seen_crc, const PSIPTable &psip)
25 {
26  uint64_t key = (((uint64_t)psip.TableID()) << 32) | psip.CRC();
27 
28  QList<uint64_t>::iterator it =
29  lower_bound(seen_crc.begin(), seen_crc.end(), key);
30 
31  if ((it == seen_crc.end()) || (*it != key))
32  {
33  seen_crc.insert(it, key);
34  return true;
35  }
36 
37  return false;
38 }
39 
45  DTVChannel *_channel,
46  bool _release_stream,
47  uint64_t wait_for_mask)
48  : SignalMonitor(db_cardnum, _channel, _release_stream, wait_for_mask),
49  m_seenPAT(QObject::tr("Seen")+" PAT", "seen_pat", 1, true, 0, 1, 0),
50  m_seenPMT(QObject::tr("Seen")+" PMT", "seen_pmt", 1, true, 0, 1, 0),
51  m_seenMGT(QObject::tr("Seen")+" MGT", "seen_mgt", 1, true, 0, 1, 0),
52  m_seenVCT(QObject::tr("Seen")+" VCT", "seen_vct", 1, true, 0, 1, 0),
53  m_seenNIT(QObject::tr("Seen")+" NIT", "seen_nit", 1, true, 0, 1, 0),
54  m_seenSDT(QObject::tr("Seen")+" SDT", "seen_sdt", 1, true, 0, 1, 0),
55  m_seenCrypt(QObject::tr("Seen")+" Crypt", "seen_crypt", 1, true, 0, 1, 0),
56  m_matchingPAT(QObject::tr("Matching")+" PAT", "matching_pat", 1, true, 0, 1, 0),
57  m_matchingPMT(QObject::tr("Matching")+" PMT", "matching_pmt", 1, true, 0, 1, 0),
58  m_matchingMGT(QObject::tr("Matching")+" MGT", "matching_mgt", 1, true, 0, 1, 0),
59  m_matchingVCT(QObject::tr("Matching")+" VCT", "matching_vct", 1, true, 0, 1, 0),
60  m_matchingNIT(QObject::tr("Matching")+" NIT", "matching_nit", 1, true, 0, 1, 0),
61  m_matchingSDT(QObject::tr("Matching")+" SDT", "matching_sdt", 1, true, 0, 1, 0),
62  m_matchingCrypt(QObject::tr("Matching")+" Crypt", "matching_crypt",
63  1, true, 0, 1, 0)
64 {
65 }
66 
68 {
70 }
71 
73 {
74  return dynamic_cast<DTVChannel*>(m_channel);
75 }
76 
77 QStringList DTVSignalMonitor::GetStatusList(void) const
78 {
79  QStringList list = SignalMonitor::GetStatusList();
80  QMutexLocker locker(&m_statusLock);
81 
82  // mpeg tables
84  {
87  }
89  {
90 #define DEBUG_PMT 0
91 #if DEBUG_PMT
92  static int seenGood = -1;
93  static int matchingGood = -1;
94 #endif
97 #if DEBUG_PMT
98  if ((seenGood != (int)m_seenPMT.IsGood()) ||
99  (matchingGood != (int)m_matchingPMT.IsGood()))
100  {
101  DBG_SM("GetStatusList", QString("WaitForPMT seen(%1) matching(%2)")
102  .arg(m_seenPMT.IsGood())
103  .arg(m_matchingPMT.IsGood()));
104  seenGood = (int)m_seenPMT.IsGood();
105  matchingGood = (int)m_matchingPMT.IsGood();
106  }
107 #endif
108  }
109  // atsc tables
111  {
114  }
116  {
119  }
120  // dvb tables
122  {
125  }
127  {
130  }
132  {
135  }
136  if (!m_error.isEmpty())
137  {
138  list<<"error"<<m_error;
139  }
140  return list;
141 }
142 
143 void DTVSignalMonitor::AddFlags(uint64_t _flags)
144 {
145  SignalMonitor::AddFlags(_flags);
147 }
148 
149 void DTVSignalMonitor::RemoveFlags(uint64_t _flags)
150 {
153 }
154 
156 {
157  QMutexLocker locker(&m_statusLock);
172 }
173 
175 {
176  vector<uint> add_eit;
177  vector<uint> del_eit;
178 
179  if (GetStreamData()->HasEITPIDChanges(m_eitPids) &&
180  GetStreamData()->GetEITPIDChanges(m_eitPids, add_eit, del_eit))
181  {
182  for (uint eit : del_eit)
183  {
184  uint_vec_t::iterator it;
185  it = find(m_eitPids.begin(), m_eitPids.end(), eit);
186  if (it != m_eitPids.end())
187  m_eitPids.erase(it);
189  }
190 
191  for (uint eit : add_eit)
192  {
193  m_eitPids.push_back(eit);
195  }
196  }
197 }
198 
200 {
201  DBG_SM(QString("SetChannel(%1, %2)").arg(major).arg(minor), "");
202  m_seenTableCrc.clear();
204  if (atsc && (m_majorChannel != major || m_minorChannel != minor))
205  {
210  m_majorChannel = major;
212  atsc->SetDesiredChannel(major, minor);
214  }
215 }
216 
218 {
219  DBG_SM(QString("SetProgramNumber(%1)").arg(progNum), "");
220  m_seenTableCrc.clear();
221  if (m_programNumber != progNum)
222  {
225  m_programNumber = progNum;
226  if (GetStreamData())
229  }
230 }
231 
232 void DTVSignalMonitor::SetDVBService(uint network_id, uint transport_id, int service_id)
233 {
234  DBG_SM(QString("SetDVBService(transport_id: %1, network_id: %2, "
235  "service_id: %3)").arg(transport_id).arg(network_id).arg(service_id), "");
236  m_seenTableCrc.clear();
237 
238  if (network_id == m_networkID && transport_id == m_transportID &&
239  service_id == m_programNumber)
240  {
241  return;
242  }
243 
247 
248  m_transportID = transport_id;
249  m_networkID = network_id;
250  m_programNumber = service_id;
251 
253  if (dvb != nullptr)
254  {
255  dvb->SetDesiredService(network_id, transport_id, m_programNumber);
258  }
259 }
260 
262 {
263  if (m_streamData)
265 
268  if (atsc)
269  {
270  atsc->RemoveATSCMainListener(this);
271  atsc->RemoveATSCAuxListener(this);
272  }
273  if (dvb)
274  dvb->RemoveDVBMainListener(this);
275 
276  m_streamData = data;
277  if (!data)
278  return;
279 
280  data->AddMPEGListener(this);
281 
282  atsc = GetATSCStreamData();
283  dvb = GetDVBStreamData();
284  if (atsc)
285  {
286  atsc->AddATSCMainListener(this);
287  atsc->AddATSCAuxListener(this);
288  }
289  if (dvb)
290  dvb->AddDVBMainListener(this);
291 }
292 
293 
295 {
297  int pmt_pid = pat->FindPID(m_programNumber);
298  if (GetStreamData() && pmt_pid)
299  {
301  GetStreamData()->AddListeningPID(pmt_pid);
302  insert_crc(m_seenTableCrc, *pat);
303  return;
304  }
305 
306  if (m_programNumber >= 0)
307  {
308  // BEGIN HACK HACK HACK
309  // Reset version in case we're physically on the wrong transport
310  // due to tuning hardware being in a transitional state or we
311  // are in the middle of something like a DiSEqC rotor turn.
312  uint tsid = pat->TransportStreamID();
313  GetStreamData()->SetVersionPAT(tsid, -1,0);
314  // END HACK HACK HACK
315 
316  if (insert_crc(m_seenTableCrc, *pat))
317  {
318  QString errStr = QString("Program #%1 not found in PAT!")
319  .arg(m_programNumber);
320  LOG(VB_GENERAL, LOG_ERR, LOC + errStr + "\n" + pat->toString());
321  }
322  // only one entry in the PAT, just use it
323  if (pat->ProgramCount() == 1)
324  {
325  LOG(VB_GENERAL, LOG_ERR, LOC + "But there is only one program "
326  "in the PAT, so we'll just use it");
330  }
331  // two entries, but one is a pointer to the NIT PID instead
332  // of a real program, use the other
333  if ((pat->ProgramCount() == 2) && ((pat->ProgramNumber(0) == 0) || (pat->ProgramNumber(1) == 0)))
334  {
335  LOG(VB_GENERAL, LOG_ERR, LOC + "But there is only one program "
336  "in the PAT, so we'll just use it");
337  uint pid = pat->FindAnyPID();
338  SetProgramNumber(pat->FindProgram(pid));
341  }
342  }
343 }
344 
345 void DTVSignalMonitor::HandlePMT(uint /*program_num*/, const ProgramMapTable *pmt)
346 {
348 
349  if (m_programNumber < 0)
350  return; // don't print error messages during channel scan.
351 
352  if (pmt->ProgramNumber() != (uint)m_programNumber)
353  {
354  if (insert_crc(m_seenTableCrc, *pmt))
355  {
356  LOG(VB_CHANNEL, LOG_DEBUG, LOC +
357  QString("Wrong PMT; pmt->ProgramNumber(%1) desired(%2)")
358  .arg(pmt->ProgramNumber()).arg(m_programNumber));
359  }
360  return; // Not the PMT we are looking for...
361  }
362 
363  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) {
364  LOG(VB_GENERAL, LOG_NOTICE, LOC +
365  QString("PMT says program %1 is encrypted").arg(m_programNumber));
367  }
368 
369  // if PMT contains audio and/or video stream set as matching.
370  uint hasAudio = 0;
371  uint hasVideo = 0;
372 
373  for (uint i = 0; i < pmt->StreamCount(); i++)
374  {
375  if (pmt->IsVideo(i, GetDTVChannel()->GetSIStandard()))
376  hasVideo++;
377  if (pmt->IsAudio(i, GetDTVChannel()->GetSIStandard()))
378  hasAudio++;
379  }
380 
381  if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
382  (hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
383  {
384  if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) &&
387 
389  }
390  else
391  {
392  LOG(VB_GENERAL, LOG_ERR, LOC +
393  QString("We want %1 audio and %2 video streams")
394  .arg(GetStreamData()->GetAudioStreamsRequired())
395  .arg(GetStreamData()->GetVideoStreamsRequired()) +
396  QString("\n\t\t\tBut have %1 audio and %2 video streams")
397  .arg(hasAudio).arg(hasVideo));
398  }
399 }
400 
402 {
403  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
404  .arg(GetStreamData()->TimeOffset()));
405 }
406 
408 {
410 
412  if (!atsc)
413  return;
414 
415  for (uint i=0; i<mgt->TableCount(); i++)
416  {
417  if ((TableClass::TVCTc == mgt->TableClass(i)) ||
418  (TableClass::CVCTc == mgt->TableClass(i)))
419  {
420  atsc->AddListeningPID(mgt->TablePID(i));
422  }
423  }
424 }
425 
427  uint /*pid*/, const TerrestrialVirtualChannelTable* tvct)
428 {
430  int idx = tvct->Find(m_majorChannel, m_minorChannel);
431 
432  if (m_minorChannel < 0)
433  return; // don't print error message during channel scan.
434 
435  if (idx < 0)
436  {
437  if (insert_crc(m_seenTableCrc, *tvct))
438  {
439  LOG(VB_GENERAL, LOG_ERR, LOC +
440  QString("Could not find channel %1_%2 in TVCT")
442  LOG(VB_GENERAL, LOG_DEBUG, LOC + tvct->toString());
443  }
445  if (atsc)
446  atsc->SetVersionTVCT(tvct->TransportStreamID(),-1);
447  return;
448  }
449 
450  DBG_SM("HandleTVCT()", QString("tvct->ProgramNumber(idx %1): prog num %2")
451  .arg(idx).arg(tvct->ProgramNumber(idx)));
452 
453  SetProgramNumber(tvct->ProgramNumber(idx));
455 }
456 
458 {
460  int idx = cvct->Find(m_majorChannel, m_minorChannel);
461 
462  if (idx < 0)
463  {
464  if (insert_crc(m_seenTableCrc, *cvct))
465  {
466  LOG(VB_GENERAL, LOG_ERR, LOC +
467  QString("Could not find channel %1_%2 in CVCT")
469  LOG(VB_GENERAL, LOG_DEBUG, LOC + cvct->toString());
470  }
472  if (atsc)
473  atsc->SetVersionCVCT(cvct->TransportStreamID(),-1);
474  return;
475  }
476 
477  DBG_SM("HandleCVCT()", QString("cvct->ProgramNumber(idx %1): prog num %2")
478  .arg(idx).arg(cvct->ProgramNumber(idx)));
479 
480  SetProgramNumber(cvct->ProgramNumber(idx));
482 }
483 
485 {
486  LOG(VB_CHANNEL, LOG_DEBUG, LOC + QString("Time Offset: %1")
487  .arg(GetStreamData()->TimeOffset()));
488 }
489 
491 {
492  DBG_SM("HandleNIT()", QString("net_id = %1").arg(nit->NetworkID()));
494  if (!GetDVBStreamData())
495  return;
496 }
497 
499 {
501 
503  m_detectedTransportID = sdt->TSID();
504 
505  // if the multiplex is not properly configured with ONID and TSID then take
506  // whatever SDT we see first
507  if ((m_networkID == 0) && (m_transportID == 0))
508  {
511 
512  // FIXME assert if TableID == SDTo
513  }
514 
515  if (sdt->OriginalNetworkID() != m_networkID || sdt->TSID() != m_transportID)
516  {
518  if (dvb)
519  dvb->SetVersionSDT(sdt->TSID(), -1, 0);
520  }
521  else
522  {
523  DBG_SM("HandleSDT()", QString("tsid = %1 orig_net_id = %2")
524  .arg(sdt->TSID()).arg(sdt->OriginalNetworkID()));
527  }
528 }
529 
530 void DTVSignalMonitor::HandleEncryptionStatus(uint /*program_number*/, bool enc_status)
531 {
533  if (!enc_status)
535 }
536 
538 {
539  return dynamic_cast<ATSCStreamData*>(m_streamData);
540 }
541 
543 {
544  return dynamic_cast<DVBStreamData*>(m_streamData);
545 }
546 
548 {
549  return dynamic_cast<ScanStreamData*>(m_streamData);
550 }
551 
553 {
554  return dynamic_cast<const ATSCStreamData*>(m_streamData);
555 }
556 
558 {
559  return dynamic_cast<const DVBStreamData*>(m_streamData);
560 }
561 
563 {
564  return dynamic_cast<const ScanStreamData*>(m_streamData);
565 }
566 
568 {
569  QMutexLocker locker(&m_statusLock);
571  return false;
573  return false;
575  return false;
577  return false;
579  return false;
581  return false;
583  return false;
585  return false;
586 
587  return true;
588 }
MasterGuideTable::TableClass
int TableClass(uint i) const
Definition: atsctables.cpp:25
ProgramAssociationTable::FindAnyPID
uint FindAnyPID(void) const
Definition: mpegtables.h:654
DVBStreamData::RemoveDVBMainListener
void RemoveDVBMainListener(DVBMainStreamListener *val)
Definition: dvbstreamdata.cpp:1031
ProgramAssociationTable::ProgramPID
uint ProgramPID(uint i) const
Definition: mpegtables.h:638
DTVSignalMonitor::m_majorChannel
int m_majorChannel
Definition: dtvsignalmonitor.h:129
DTVSignalMonitor::AddFlags
void AddFlags(uint64_t _flags) override
Definition: dtvsignalmonitor.cpp:143
dtvchannel.h
SignalMonitor::m_flags
volatile uint64_t m_flags
Definition: signalmonitor.h:206
ATSCStreamData::AddATSCAuxListener
void AddATSCAuxListener(ATSCAuxStreamListener *val)
Definition: atscstreamdata.cpp:989
DTVSignalMonitor::RemoveFlags
void RemoveFlags(uint64_t _flags) override
Definition: dtvsignalmonitor.cpp:149
DTVSignalMonitor::m_matchingMGT
SignalMonitorValue m_matchingMGT
Definition: dtvsignalmonitor.h:122
DTVSignalMonitor::SetDVBService
void SetDVBService(uint network_id, uint transport_id, int service_id)
Definition: dtvsignalmonitor.cpp:232
SignalMonitorValue::SetValue
void SetValue(int _value)
Definition: signalmonitorvalue.h:75
ProgramMapTable::StreamCount
uint StreamCount(void) const
Definition: mpegtables.h:742
MPEGStreamData::SetDesiredProgram
void SetDesiredProgram(int p)
Definition: mpegstreamdata.cpp:67
TimeDateTable
This table gives the current DVB stream time.
Definition: dvbtables.h:384
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:67
SignalMonitorValue::GetStatus
QString GetStatus() const
Returns a signal monitor value as one long string.
Definition: signalmonitorvalue.h:33
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
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:121
SignalMonitor::m_channel
ChannelBase * m_channel
Definition: signalmonitor.h:203
DTVSignalMonitor::m_seenVCT
SignalMonitorValue m_seenVCT
Definition: dtvsignalmonitor.h:116
ProgramAssociationTable::FindProgram
uint FindProgram(uint pid) const
Definition: mpegtables.h:661
ProgramMapTable
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:685
DTVSignalMonitor::m_seenMGT
SignalMonitorValue m_seenMGT
Definition: dtvsignalmonitor.h:115
SignalMonitor::kDTVSigMon_WaitForMGT
static const uint64_t kDTVSigMon_WaitForMGT
Definition: signalmonitor.h:183
DBG_SM
#define DBG_SM(FUNC, MSG)
Definition: dtvsignalmonitor.cpp:15
DTVSignalMonitor::HandleSTT
void HandleSTT(const SystemTimeTable *stt) override
Definition: dtvsignalmonitor.cpp:401
DTVSignalMonitor::m_networkID
uint m_networkID
Definition: dtvsignalmonitor.h:132
arg
arg(title).arg(filename).arg(doDelete))
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:1619
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:60
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:721
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
DTVSignalMonitor::HandleTDT
void HandleTDT(const TimeDateTable *tdt) override
Definition: dtvsignalmonitor.cpp:484
DTVSignalMonitor::GetDVBStreamData
DVBStreamData * GetDVBStreamData()
Returns the DVB stream data if it exists.
Definition: dtvsignalmonitor.cpp:542
DTVSignalMonitor::m_transportID
uint m_transportID
Definition: dtvsignalmonitor.h:133
ProgramAssociationTable::ProgramCount
uint ProgramCount(void) const
Definition: mpegtables.h:628
DTVSignalMonitor::m_matchingSDT
SignalMonitorValue m_matchingSDT
Definition: dtvsignalmonitor.h:125
VirtualChannelTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: atsctables.h:266
ScanStreamData
Definition: scanstreamdata.h:14
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: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:174
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:265
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
SignalMonitor::m_error
QString m_error
Definition: signalmonitor.h:216
DTVSignalMonitor::HandlePMT
void HandlePMT(uint program_num, const ProgramMapTable *pmt) override
Definition: dtvsignalmonitor.cpp:345
DTVSignalMonitor::HandleCVCT
void HandleCVCT(uint pid, const CableVirtualChannelTable *cvct) override
Definition: dtvsignalmonitor.cpp:457
DTVSignalMonitor::GetDTVChannel
DTVChannel * GetDTVChannel(void)
Definition: dtvsignalmonitor.cpp:72
PSIPTable
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
Definition: mpegtables.h:399
insert_crc
static bool insert_crc(QList< uint64_t > &seen_crc, const PSIPTable &psip)
Definition: dtvsignalmonitor.cpp:24
DTVSignalMonitor::UpdateMonitorValues
void UpdateMonitorValues(void)
Definition: dtvsignalmonitor.cpp:155
DTVSignalMonitor::m_detectedNetworkID
uint m_detectedNetworkID
Definition: dtvsignalmonitor.h:135
DTVSignalMonitor::m_seenSDT
SignalMonitorValue m_seenSDT
Definition: dtvsignalmonitor.h:118
minor
#define minor(X)
Definition: compat.h:138
ATSCStreamData::SetDesiredChannel
void SetDesiredChannel(int major, int minor)
Definition: atscstreamdata.cpp:58
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:200
ProgramAssociationTable::TransportStreamID
uint TransportStreamID(void) const
Definition: mpegtables.h:626
VirtualChannelTable::Find
int Find(int major, int minor) const
Definition: atsctables.cpp:484
ProgramAssociationTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: mpegtables.h:635
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:119
DTVSignalMonitor::m_seenTableCrc
QList< uint64_t > m_seenTableCrc
Definition: dtvsignalmonitor.h:140
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:113
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:86
DTVSignalMonitor::GetStatusList
QStringList GetStatusList(void) const override
Returns QStringList containing all signals and their current values.
Definition: dtvsignalmonitor.cpp:77
ServiceDescriptionTable
This table tells the decoder on which PIDs to find A/V data.
Definition: dvbtables.h:111
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
ProgramAssociationTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:814
DVBStreamData
Definition: dvbstreamdata.h:33
DTVSignalMonitor::m_matchingVCT
SignalMonitorValue m_matchingVCT
Definition: dtvsignalmonitor.h:123
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:407
DTVSignalMonitor::GetScanStreamData
ScanStreamData * GetScanStreamData()
Returns the scan stream data if it exists.
Definition: dtvsignalmonitor.cpp:547
DTVSignalMonitor::m_matchingCrypt
SignalMonitorValue m_matchingCrypt
Definition: dtvsignalmonitor.h:126
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:111
DTVSignalMonitor::~DTVSignalMonitor
~DTVSignalMonitor() override
Definition: dtvsignalmonitor.cpp:67
uint
unsigned int uint
Definition: compat.h:140
ATSCStreamData::AddATSCMainListener
void AddATSCMainListener(ATSCMainStreamListener *val)
Definition: atscstreamdata.cpp:939
LOC
#define LOC
Definition: dtvsignalmonitor.cpp:19
ProgramAssociationTable
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:608
ATSCStreamData::RemoveATSCAuxListener
void RemoveATSCAuxListener(ATSCAuxStreamListener *val)
Definition: atscstreamdata.cpp:1000
SignalMonitor
Signal monitoring base class.
Definition: signalmonitor.h:33
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:57
TableClass::TVCTc
@ TVCTc
Definition: atsctables.h:57
DVBStreamData::SetDesiredService
void SetDesiredService(uint netid, uint tsid, int serviceid)
Definition: dvbstreamdata.cpp:44
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:1608
DTVSignalMonitor::SetProgramNumber
void SetProgramNumber(int progNum)
Definition: dtvsignalmonitor.cpp:217
TimeOffset
Definition: channelsettings.cpp:175
ATSCStreamData::RemoveATSCMainListener
void RemoveATSCMainListener(ATSCMainStreamListener *val)
Definition: atscstreamdata.cpp:950
MasterGuideTable
This table tells the decoder on which PIDs to find other tables, and their sizes and each table's cur...
Definition: atsctables.h:75
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:1020
DTVSignalMonitor::m_matchingNIT
SignalMonitorValue m_matchingNIT
Definition: dtvsignalmonitor.h:124
DTVSignalMonitor::SetChannel
void SetChannel(int major, int minor)
Definition: dtvsignalmonitor.cpp:199
DTVSignalMonitor::m_eitPids
vector< uint > m_eitPids
Definition: dtvsignalmonitor.h:112
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:142
DTVSignalMonitor::DTVSignalMonitor
DTVSignalMonitor(int db_cardnum, DTVChannel *_channel, bool _release_stream, uint64_t wait_for_mask)
Definition: dtvsignalmonitor.cpp:44
PSIPTable::TableID
uint TableID(void) const
Definition: mpegtables.h:507
DTVSignalMonitor::HandleEncryptionStatus
void HandleEncryptionStatus(uint pnum, bool enc_status) override
Definition: dtvsignalmonitor.cpp:530
SignalMonitor::m_statusLock
QMutex m_statusLock
Definition: signalmonitor.h:229
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:346
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:261
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:490
atsctables.h
Overall structure.
CableVirtualChannelTable
This table contains information about the cable channels transmitted on this multiplex.
Definition: atsctables.h:415
SystemTimeTable
This table contains the GPS time at the time of transmission.
Definition: atsctables.h:679
MPEGStreamData::AddListeningPID
virtual void AddListeningPID(uint pid, PIDPriority priority=kPIDPriorityNormal)
Definition: mpegstreamdata.h:120
ProgramAssociationTable::FindPID
uint FindPID(uint progNum) const
Definition: mpegtables.h:647
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:35
ATSCStreamData::SetVersionCVCT
void SetVersionCVCT(uint tsid, int version)
Definition: atscstreamdata.h:60
DVB_SDT_PID
@ DVB_SDT_PID
Definition: mpegtables.h:210
DTVSignalMonitor::m_minorChannel
int m_minorChannel
Definition: dtvsignalmonitor.h:130
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:120
DTVSignalMonitor::HandlePAT
void HandlePAT(const ProgramAssociationTable *pat) override
Definition: dtvsignalmonitor.cpp:294
DTVSignalMonitor::IsAllGood
bool IsAllGood(void) const override
Definition: dtvsignalmonitor.cpp:567
VirtualChannelTable::TransportStreamID
uint TransportStreamID() const
Definition: atsctables.h:218
DTVSignalMonitor::HandleTVCT
void HandleTVCT(uint pid, const TerrestrialVirtualChannelTable *tvct) override
Definition: dtvsignalmonitor.cpp:426
DTVSignalMonitor::HandleSDT
void HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) override
Definition: dtvsignalmonitor.cpp:498
dtvsignalmonitor.h
MPEGStreamData::TestDecryption
void TestDecryption(const ProgramMapTable *pmt)
Definition: mpegstreamdata.cpp:1803
DTVSignalMonitor::m_seenNIT
SignalMonitorValue m_seenNIT
Definition: dtvsignalmonitor.h:117
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:138
DTVSignalMonitor::GetATSCStreamData
ATSCStreamData * GetATSCStreamData()
Returns the ATSC stream data if it exists.
Definition: dtvsignalmonitor.cpp:537
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:356
DTVSignalMonitor::m_detectedTransportID
uint m_detectedTransportID
Definition: dtvsignalmonitor.h:136
SignalMonitor::kDTVSigMon_WaitForVCT
static const uint64_t kDTVSigMon_WaitForVCT
Definition: signalmonitor.h:184
DTVSignalMonitor::m_seenPMT
SignalMonitorValue m_seenPMT
Definition: dtvsignalmonitor.h:114
TableClass::CVCTc
@ CVCTc
Definition: atsctables.h:59
NetworkInformationTable
This table tells the decoder on which PIDs to find other tables.
Definition: dvbtables.h:31
ATSCStreamData::SetVersionTVCT
void SetVersionTVCT(uint tsid, int version)
Definition: atscstreamdata.h:58