Go to the documentation of this file.
18 #include "libavcodec/avcodec.h"
35 #ifdef USING_HDHOMERUN
69 #define DBG_SM(FUNC, MSG) LOG(VB_CHANNEL, LOG_DEBUG, \
70 QString("SigMon[%1](%2)::%3: %4").arg(m_inputid) \
71 .arg(m_channel->GetDevice()).arg(FUNC).arg(MSG))
100 if (cardtype ==
"GuaranteedToFail")
116 else if ((cardtype.toUpper() ==
"HDPVR"))
123 else if (cardtype.toUpper() ==
"V4L2ENC")
132 #ifdef USING_HDHOMERUN
133 else if (cardtype.toUpper() ==
"HDHOMERUN")
143 else if (cardtype.toUpper() ==
"SATIP")
152 else if (cardtype.toUpper() ==
"CETON")
162 else if (cardtype.toUpper() ==
"FREEBOX")
172 else if (cardtype.toUpper() ==
"VBOX")
181 #ifdef USING_FIREWIRE
182 else if (cardtype.toUpper() ==
"FIREWIRE")
192 else if (cardtype.toUpper() ==
"ASI")
201 else if (cardtype.toUpper() ==
"EXTERNAL")
217 LOG(VB_GENERAL, LOG_ERR,
218 QString(
"Failed to create signal monitor in Init(%1, %2, 0x%3)")
222 return signalMonitor;
238 bool _release_stream, uint64_t wait_for_mask)
241 m_inputid(_inputid), m_flags(wait_for_mask),
242 m_releaseStream(_release_stream),
243 m_signalLock (QCoreApplication::translate(
"(Common)",
"Signal Lock"),
244 "slock", 1,
true, 0, 1, 0ms),
245 m_signalStrength(QCoreApplication::translate(
"(Common)",
"Signal Power"),
246 "signal", 0,
true, 0, 100, 0ms),
247 m_scriptStatus (QCoreApplication::translate(
"(Common)",
"Script Status"),
248 "script", 3,
true, 0, 3, 0ms)
279 return (
m_flags & _flags) == _flags;
284 return (
m_flags & _flags) != 0U;
392 if (entry == listener)
402 std::vector<SignalMonitorListener*> new_listeners;
405 if (entry != listener)
406 new_listeners.push_back(entry);
427 listener->StatusSignalLock(val);
433 listener->StatusSignalStrength(val);
436 listener->StatusChannelTuned(val);
440 dvblistener->StatusSignalToNoise(val);
444 dvblistener->StatusBitErrorRate(val);
448 dvblistener->StatusUncorrectedBlocks(val);
452 dvblistener->StatusRotorPosition(val);
volatile uint64_t m_flags
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void SetValue(int _value)
QString GetStatus() const
Returns a signal monitor value as one long string.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
This class is used as a container for messages.
void SendMessage(SignalMonitorMessageType type, const SignalMonitorValue &val)
arg(title).arg(filename).arg(doDelete))
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
QString GetName(void) const
Returns the long name of this value.
bool HasAnyFlag(uint64_t _flags) const
virtual void AddFlags(uint64_t _flags)
VERBOSE_PREAMBLE Most true
static const uint64_t kSigMon_WaitForSig
SignalMonitorValue m_scriptStatus
int GetValue() const
Returns the value.
virtual void RemoveFlags(uint64_t _flags)
SignalMonitorValue m_signalStrength
Abstract class providing a generic interface to tuning hardware.
QString sm_flags_to_string(uint64_t flags)
SignalMonitorValue m_signalLock
std::chrono::milliseconds m_updateRate
void run(void) override
Basic signal monitoring loop.
void SendMessageAllGood(void)
FirewireChannel Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV un...
~SignalMonitor() override
Stops monitoring thread.
virtual void EmitStatus(void)
virtual void UpdateValues(void)
This should be overridden to actually do signal monitoring.
virtual bool IsExternalChannelChangeInUse(void)
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
static bool IsDVBInputType(const QString &inputType)
Returns true iff the input_type is one of the DVB types.
QWaitCondition m_startStopWait
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Signal monitoring base class.
static SignalMonitor * Init(const QString &cardtype, int db_cardnum, ChannelBase *channel, bool release_stream)
uint GetScriptStatus(bool holding_lock=false)
Provides interface to the tuning hardware when using DVB drivers.
bool HasFlags(uint64_t _flags) const
void AddListener(SignalMonitorListener *listener)
void RemoveListener(SignalMonitorListener *listener)
@ kStatusUncorrectedBlocks
This is a wrapper around QThread that does several additional things.
virtual void Start()
Start signal monitoring thread.
std::vector< SignalMonitorListener * > m_listeners
virtual QStringList GetStatusList(void) const
Returns QStringList containing all signals and their current values.
#define DBG_SM(FUNC, MSG)
virtual void Stop()
Stop signal monitoring thread.
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
void dispatch(const MythEvent &event)
SignalMonitor(int, ChannelBase *, uint64_t, bool)=delete