Go to the documentation of this file.
26 #define LOC QString("EITScanner: ")
27 #define LOC_ID QString("EITScanner[%1]: ").arg(m_cardnum)
37 m_eventThread(new
MThread(
"EIT", this)),
44 LOG(VB_EIT, LOG_INFO,
LOC_ID +
"Start EIT scanner thread");
100 LOG(VB_EIT, LOG_INFO,
101 LOC_ID + QString(
"Added %1 EIT events in passive scan").arg(eitCount));
112 LOG(VB_EIT, LOG_INFO,
113 LOC_ID + QString(
"Added %1 EIT events in active scan").arg(eitCount));
124 if (!(*m_activeScanNextChan).isEmpty())
132 QString(
"Next looking for EIT data on multiplex of channel %1 of source %2")
186 QMutexLocker locker(&
m_lock);
199 QString(
"Start processing EIT events in %1 scan for channel %2 chanid %3")
202 QString::number(chanid)));
207 QString(
"Failed to start processing EIT events, invalid chanid:%1")
217 QMutexLocker locker(&
m_lock);
230 QString(
"Stop processing EIT events in %1 scan")
243 "SELECT channum, MIN(chanid) "
244 "FROM channel, capturecard, videosource "
245 "WHERE deleted IS NULL AND "
246 " capturecard.sourceid = channel.sourceid AND "
247 " videosource.sourceid = channel.sourceid AND "
248 " channel.mplexid IS NOT NULL AND "
250 " useonairguide = 1 AND "
252 " channum != '' AND "
253 " capturecard.cardid = :CARDID "
255 "ORDER BY capturecard.sourceid, mplexid, "
256 " atsc_major_chan, atsc_minor_chan ");
272 QString(
"StartActiveScan called with %1 multiplexes")
302 QMutexLocker locker(&
m_lock);
bool isActive(void) const
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static void WriteEITCache(void)
void RescheduleRecordings(void)
Tells scheduler about programming changes.
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void StopEITEventProcessing(void)
Stops inserting Event Information Tables into DB.
volatile bool m_exitThread
A QElapsedTimer based timer to replace use of QTime as a timer.
void SetSourceID(uint sourceid)
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
void StartEITEventProcessing(ChannelBase *channel, EITSource *eitSource)
Start inserting Event Information Tables from the multiplex we happen to be tuned to into the databas...
QDateTime m_activeScanNextTrig
QWaitCondition m_activeScanCond
uint GetSourceID(void) const
Returns current source id.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
virtual QString GetChannelName(void) const
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
virtual void SetEITRate(float rate)=0
uint m_activeScanNextChanIndex
void StopActiveScan(void)
void RescheduleRecordings(void)
Tells scheduler about programming changes.
uint GetInputId(void) const
Returns the inputid.
static int GetChanID(int db_mplexid, int service_transport_id, int major_channel, int minor_channel, int program_number)
Abstract class providing a generic interface to tuning hardware.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
void SetChannelID(uint channelid)
virtual void SetEITHelper(EITHelper *)=0
QWaitCondition m_exitThreadCond
std::chrono::seconds m_activeScanTrigTime
bool QueueEITChannelChange(const QString &name)
Queues up a channel change for the EITScanner.
volatile bool m_activeScan
void SetLanguagePreferences(const QStringList &langPref)
QStringList::iterator m_activeScanNextChan
uint ProcessEvents(void)
Get events from queue and insert into DB after processing.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
static uint GetSourceIDForChannel(uint chanid)
QStringList iso639_get_language_list(void)
Returns list of three character ISO-639 language descriptors, starting with the most preferred.
void run(void) override
This runs the event loop for EITScanner until 'exitThread' is true.
This is the coordinating class of the Recorder Subsystem.
This is a wrapper around QThread that does several additional things.
ISO 639-1 and ISO 639-2 support functions.
uint GetListSize(void) const
static void PruneEITCache(uint timestamp)
QStringList m_activeScanChannels
volatile bool m_activeScanStopped
uint32_t MythRandom()
generate 32 random bits
void StartActiveScan(TVRec *rec, std::chrono::seconds max_seconds_per_source)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
virtual int GetChanID(void) const