24#define LOC QString("V4L2SigMon[%1](%2): ").arg(m_inputid).arg(m_channel->GetDevice())
45 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"ctor");
50 LOG(VB_GENERAL, LOG_ERR,
LOC +
"ctor -- Open failed");
58 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"%1 stream.")
59 .arg(
m_isTS ?
"Transport" :
"Program"));
67 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"dtor");
78 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Stop() -- begin");
84 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Stop() -- end");
125 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"isLocked: %1").arg(isLocked));
146 chn->GetAudioDevice().toInt(),
m_inputid);
149 LOG(VB_GENERAL, LOG_ERR,
LOC +
150 "V4L2encSignalMonitor -- failed to start StreamHandler.");
166 LOG(VB_CHANNEL, LOG_INFO,
LOC +
167 "GetSignalStrengthPercent() -- v4l2 device not open");
198 LOG(VB_CHANNEL, LOG_INFO,
LOC +
199 QString(
"Resolution already stable at %1 x %2")
200 .arg(width).arg(height));
203 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Device wedged?");
211 LOG(VB_CHANNEL, LOG_INFO, QString(
"Resolution %1 x %2")
212 .arg(width).arg(height));
219 LOG(VB_CHANNEL, LOG_INFO, QString(
"Resolution stable at %1 x %2")
220 .arg(width).arg(height));
234 LOG(VB_CHANNEL, LOG_WARNING,
"Waiting for valid resolution");
virtual QString GetDevice(void) const
Returns String representing device, useful for debugging.
This class is intended to detect the presence of needed tables.
bool IsAllGood(void) const override
void RemoveFlags(uint64_t _flags) override
MPEGStreamData * GetStreamData()
Returns the MPEG stream data if it exists.
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
bool isRunning(void) const
Returns true if start() or restart() has been called at least once since construction and since any c...
void stop(void)
Stops timer, next call to isRunning() will return false and any calls to elapsed() or restart() will ...
void start(void)
starts measuring elapsed time.
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
SignalMonitorValue m_scriptStatus
static const uint64_t kDVBSigMon_WaitForPos
Wait for rotor to complete turning the antenna.
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 kDTVSigMon_WaitForPAT
static const uint64_t kDTVSigMon_WaitForMGT
virtual void UpdateValues(void)
This should be overridden to actually do signal monitoring.
SignalMonitorValue m_signalStrength
bool HasAnyFlag(uint64_t _flags) const
bool HasError(void) const
virtual void RemoveListener(MPEGStreamData *data)
virtual void AddListener(MPEGStreamData *data, bool allow_section_reader=false, bool needs_buffering=false, const QString &output_file=QString())
void UpdateValues(void) override
Fills in frontend stats and emits status Qt signals.
V4L2encSignalMonitor(void)
~V4L2encSignalMonitor() override
Stops signal monitoring and table monitoring threads.
std::chrono::milliseconds m_stableTime
int StableResolution(void)
Wait for a stable signal.
void Stop(void) override
Stop signal monitoring and table monitoring threads.
V4L2encStreamHandler * m_streamHandler
static void Return(V4L2encStreamHandler *&ref, int inputid)
static V4L2encStreamHandler * Get(const QString &devname, int audioinput, int inputid)
bool Open(const QString &dev_name, const QString &vbi_dev_name="")
bool GetResolution(int &width, int &height) const
int GetStreamType(void) const
int GetSignalStrength(void) const
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.