12#define LOC QString("SatIPSigMon[%1]: ").arg(m_inputid)
20 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"ctor");
23 std::chrono::milliseconds
wait = 3s;
24 std::chrono::milliseconds signal_timeout = 0ms;
25 std::chrono::milliseconds tuning_timeout = 0ms;
27 if (tuning_timeout <
wait)
29 LOG(VB_CHANNEL, LOG_INFO,
LOC +
30 QString(
"Tuning timeout from database: %1 ms is too small, using %2 ms")
31 .arg(tuning_timeout.count()).arg(
wait.count()));
35 wait = tuning_timeout;
36 LOG(VB_CHANNEL, LOG_INFO,
LOC +
37 QString(
"Tuning timeout: %1 ms").arg(
wait.count()));
51 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"dtor");
58 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Stop() -- begin");
66 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Stop() -- end");
83 m_error = tr(
"Error: stream handler died");
103 bool wasLocked =
false;
104 bool isLocked =
false;
116 if (wasLocked != isLocked)
118 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"UpdateValues -- Signal " +
119 (isLocked ?
"Locked" :
"Lost"));
static bool GetTimeouts(uint inputid, std::chrono::milliseconds &signal_timeout, std::chrono::milliseconds &channel_timeout)
This class is intended to detect the presence of needed tables.
bool IsAllGood(void) const override
void AddFlags(uint64_t _flags) override
MPEGStreamData * GetStreamData()
Returns the MPEG stream data if it exists.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
SatIPChannel * GetSatIPChannel(void)
bool m_streamHandlerStarted
SatIPSignalMonitor(int db_cardnum, SatIPChannel *channel, bool release_stream, uint64_t flags=0)
~SatIPSignalMonitor() override
void UpdateValues(void) override
This should be overridden to actually do signal monitoring.
void Stop(void) override
Stop signal monitoring thread.
SatIPStreamHandler * m_streamHandler
void AddListener(MPEGStreamData *data, bool=false, bool=false, const QString &output_file=QString()) override
static SatIPStreamHandler * Get(const QString &devname, int inputid)
static void Return(SatIPStreamHandler *&ref, int inputid)
void SetTimeout(std::chrono::milliseconds _timeout)
void SetThreshold(int _threshold)
void SetRange(int _min, int _max)
Sets the minimum and maximum values.
bool IsGood() const
Returns true if the value is equal to the threshold, or on the right side of the threshold (depends o...
void SetValue(int _value)
static const uint64_t kDTVSigMon_WaitForVCT
QRecursiveMutex m_statusLock
void SendMessageAllGood(void)
SignalMonitorValue m_signalLock
static const uint64_t kDTVSigMon_WaitForNIT
static const uint64_t kDTVSigMon_WaitForSDT
virtual void Stop()
Stop signal monitoring thread.
static const uint64_t kDTVSigMon_WaitForPMT
virtual void EmitStatus(void)
static const uint64_t kSigMon_WaitForSig
static const uint64_t kDTVSigMon_WaitForPAT
static const uint64_t kDTVSigMon_WaitForMGT
SignalMonitorValue m_signalStrength
bool HasAnyFlag(uint64_t _flags) const
bool IsRunning(void) const
virtual void RemoveListener(MPEGStreamData *data)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)