Go to the documentation of this file.
20 #define LOC QString("VBoxChanFetch: ")
25 m_scanMonitor(monitor),
26 m_cardId(cardid), m_inputName(std::move(inputname)),
27 m_sourceId(sourceid), m_ftaOnly(ftaOnly),
28 m_serviceType(serviceType),
29 m_thread(new
MThread(
"VBoxChannelFetcher", this))
31 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Has ScanMonitor %1")
32 .arg(monitor?
"true":
"false"));
36 QStringList list = videoDev.split(
'-');
37 if (list.count() == 3)
39 const QString& tunerType = list.at(2);
40 if (tunerType ==
"DVBT")
42 else if (tunerType ==
"DVBT/T2")
44 else if (tunerType ==
"DVBS")
46 else if (tunerType ==
"DVBS/S2")
48 else if (tunerType ==
"DVBC")
50 else if (tunerType ==
"ATSC")
54 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"VideoDevice is: %1, tunerType is: %2")
92 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Found %1 channels")
116 LOG(VB_CHANNEL, LOG_INFO,
LOC +
117 QString(
"Failed to get IP address from videodev (%1)").arg(dev));
118 QMutexLocker locker(&
m_lock);
124 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"VBox IP: %1").arg(ip));
147 QMutexLocker locker(&
m_lock);
162 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Found %1 channels")
166 vbox_chan_map_t::const_iterator it =
m_channels->cbegin();
169 const QString& channum = it.key();
170 QString name = (*it).m_name;
171 QString xmltvid = (*it).m_xmltvid.isEmpty() ?
"" : (*it).m_xmltvid;
172 uint serviceID = (*it).m_serviceID;
173 bool fta = (*it).m_fta;
174 QString chanType = (*it).m_channelType;
175 QString transType = (*it).m_transType;
176 uint networkID = (*it).m_networkID;
177 uint transportID = (*it).m_transportID;
180 QString msg = tr(
"Channel #%1 : %2").arg(channum, name);
182 LOG(VB_CHANNEL, LOG_INFO, QString(
"Handling channel %1 %2")
183 .arg(channum, name));
227 'a',
'v',
'a',
'a', QString(), QString(),
'a', QString(),
228 QString(), QString(),
"UNDEFINED",
"0.35");
231 channum, serviceID, 0, 0,
233 QString(),
"Default", xmltvid);
246 'a',
'v',
'a',
'a', QString(), QString(),
'a', QString(),
247 QString(), QString(),
"UNDEFINED",
"0.35");
251 channum, serviceID, 0, 0,
253 QString(),
"Default", QString());
270 QMutexLocker locker(&
m_lock);
278 uint range = 100 - minval;
286 if (transType ==
"UNKNOWN")
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
QMap< QString, VBoxChannelInfo > vbox_chan_map_t
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
~VBoxChannelFetcher() override
void ScanPercentComplete(int pct)
void Stop(void)
Stops the scanning thread running.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
ScanMonitor * m_scanMonitor
bool SupportedTransmission(const QString &transType)
void ScanErrored(const QString &error)
vbox_chan_map_t * m_channels
static int GetChanID(int db_mplexid, int service_transport_id, int major_channel, int minor_channel, int program_number)
static bool UpdateChannel(uint db_mplexid, uint source_id, uint channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, ChannelVisibleType visible, const QString &freqid=QString(), const QString &icon=QString(), QString format=QString(), const QString &xmltvid=QString(), const QString &default_authority=QString(), uint service_type=0, int recpriority=INT_MIN, int tmOffset=INT_MIN, int commMethod=INT_MIN)
static int CreateChanID(uint sourceid, const QString &chan_num)
Creates a unique channel ID for database use.
bool isFinished(void) const
vbox_chan_map_t GetChannels(void)
void ScanAppendTextToLog(const QString &status)
static bool CreateChannel(uint db_mplexid, uint db_sourceid, uint new_channel_id, const QString &callsign, const QString &service_name, const QString &chan_num, uint service_id, uint atsc_major_channel, uint atsc_minor_channel, bool use_on_air_guide, ChannelVisibleType visible, const QString &freqid, const QString &icon=QString(), QString format="Default", const QString &xmltvid=QString(), const QString &default_authority=QString(), uint service_type=0, int recpriority=0, int tmOffset=0, int commMethod=-1)
vbox_chan_map_t * getChannels(void)
static bool CreateIPTVTuningData(uint channel_id, const IPTVTuningData &tuning)
static uint CreateMultiplex(int sourceid, const QString &sistandard, uint64_t frequency, const QString &modulation, int transport_id=-1, int network_id=-1)
This is a wrapper around QThread that does several additional things.
ServiceRequirements m_serviceType
VBoxChannelFetcher(uint cardid, QString inputname, uint sourceid, bool ftaOnly, ServiceRequirements serviceType, ScanMonitor *monitor=nullptr)
void SetNumChannelsInserted(uint val)
void SetTotalNumChannels(uint val)
static QString getIPFromVideoDevice(const QString &dev)
static QString GetVideoDevice(uint inputid)
static bool UpdateIPTVTuningData(uint channel_id, const IPTVTuningData &tuning)