Go to the documentation of this file.
39 #ifdef USING_DVB // for bug in gcc 8.3
50 #define LOC QString("ChScan: ")
87 m_vboxScanner->
Stop();
89 m_vboxScanner =
nullptr;
93 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
94 if (m_externRecScanner)
96 m_externRecScanner->Stop();
97 delete m_externRecScanner;
98 m_externRecScanner =
nullptr;
112 const QString &inputname,
114 bool do_ignore_signal_timeout,
116 bool do_test_decryption,
119 bool do_complete_only,
120 bool do_full_channel_search,
121 bool do_remove_duplicates,
126 const QMap<QString,QString> &startChan,
127 const QString &freq_std,
130 const QString &tbl_start,
131 const QString &tbl_end)
143 sourceid, do_ignore_signal_timeout, do_test_decryption);
145 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
"Scan()");
149 LOG(VB_CHANSCAN, LOG_ERR,
LOC +
"Scan(): scanner does not exist...");
165 LOG(VB_CHANSCAN, LOG_INFO,
LOC + QString(
"ScanTransports(%1, %2, %3)")
166 .arg(freq_std, mod, tbl));
170 if ((mod.startsWith(
"qam", Qt::CaseInsensitive)) &&
180 sourceid, freq_std, mod, tbl, tbl_start, tbl_end);
189 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
"ScanTransports()");
196 LOG(VB_CHANSCAN, LOG_INFO,
LOC + QString(
"ScanExistingTransports of source %1")
214 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
215 QString(
"ScanForChannels for source %1").arg(sourceid));
218 QString sub_type = card_type;
219 if (card_type ==
"DVB")
223 ok = !device.isEmpty();
247 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
"IPTVImportMPTS: no channels");
251 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
252 QString(
"ScanIPTVChannels(%1) IPTV MPTS").arg(sourceid));
259 InformUser(tr(
"Error scanning MPTS in IPTV"));
266 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
267 QString(
"ScanTransport(%1)").arg(mplexid));
273 QString sistandard =
"mpeg";
274 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
275 "ScanCurrentTransport(" + sistandard +
")");
280 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
281 "Importing channels from External Recorder");
287 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to handle tune complete.");
289 "Failed to handle tune complete."));
339 msg = tr(
"Failed to parse '%1'").arg(
file);
341 msg = tr(
"Programmer Error : incorrect card type");
343 msg = tr(
"Failed to open '%1'").arg(
file);
352 [[maybe_unused]]
const QString &inputname,
376 [[maybe_unused]]
const QString &inputname,
378 [[maybe_unused]]
bool ftaOnly,
391 m_vboxScanner->Scan();
400 [[maybe_unused]]
const QString &inputname,
404 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
416 m_externRecScanner->Scan();
425 [[maybe_unused]]
const QString &inputname,
430 #ifdef USING_HDHOMERUN
450 const QString &inputname,
452 [[maybe_unused]]
bool do_ignore_signal_timeout,
453 bool do_test_decryption)
455 bool monitor_snr =
false;
456 std::chrono::milliseconds signal_timeout = 1s;
457 std::chrono::milliseconds channel_timeout = 40s;
461 if (device.isEmpty())
463 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No Device");
464 InformUser(tr(
"Programmer Error: No Device"));
474 if (
"DVB" == card_type)
477 bool need_nit = ((
"QAM" == sub_type) ||
478 (
"QPSK" == sub_type) ||
479 (
"OFDM" == sub_type) ||
480 (
"DVB_T2" == sub_type));
486 signal_timeout = (do_ignore_signal_timeout) ?
487 channel_timeout * 10 : signal_timeout;
491 signal_timeout = std::max(signal_timeout, 1000ms);
496 channel_timeout = std::max(channel_timeout,
static_cast<int>(need_nit) * 7 * 1000ms);
503 if ((
"V4L" == card_type) || (
"MPEG" == card_type))
507 #ifdef USING_HDHOMERUN
508 if (
"HDHOMERUN" == card_type)
513 #endif // USING_HDHOMERUN
516 if (
"SATIP" == card_type)
523 if (
"ASI" == card_type)
530 if (
"FREEBOX" == card_type)
537 if (
"VBOX" == card_type)
543 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
544 if (
"EXTERNAL" == card_type)
552 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Channel not created");
553 InformUser(tr(
"Programmer Error: Channel not created"));
563 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Channel could not be opened");
564 InformUser(tr(
"Channel could not be opened."));
571 sourceid, signal_timeout, channel_timeout,
572 inputname, do_test_decryption);
615 bool using_rotor =
false;
626 bool monitor_lock = mon !=
nullptr;
627 bool monitor_strength = mon !=
nullptr;
628 MonitorProgress(monitor_lock, monitor_strength, monitor_snr, using_rotor);
virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid, bool ftaOnly, ServiceRequirements serviceType)
static const int kTunerTypeDVBC
virtual ~ChannelScanner()
HDHRChannelFetcher * m_hdhrScanner
virtual bool Open(void)=0
Opens the channel changing hardware for use.
DTVChannelList m_channels
imported channels
static const int kTunerTypeDVBS1
void ScanPercentComplete(int pct)
fbox_chan_map_t m_iptvChannels
void SetAnalog(bool is_analog)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
virtual DTVConfParser::return_t ImportDVBUtils(uint sourceid, CardUtil::INPUT_TYPES cardtype, const QString &file)
bool m_removeDuplicates
Remove duplicate transports and channels?
void Scan(void)
Scans the given frequency list.
virtual void deleteLater(void)
bool ScanTransports(int SourceID, const QString &std, const QString &mod, const QString &country, const QString &table_start=QString(), const QString &table_end=QString())
Generates a list of frequencies to scan and adds it to the scanTransport list, and then sets the scan...
static QString ProbeDVBType(const QString &device)
void StartScanner(void)
Starts the ChannelScanSM event loop.
bool m_freeToAirOnly
Only fta channels desired post scan?
void Stop(void)
Stops the scanning thread running.
static const uint64_t kDVBSigMon_WaitForPos
Wait for rotor to complete turning the antenna.
ChannelScanSM * m_sigmonScanner
void Scan(int scantype, uint cardid, const QString &inputname, uint sourceid, bool do_ignore_signal_timeout, bool do_follow_nit, bool do_test_decryption, bool do_fta_only, bool do_lcn_only, bool do_complete_only, bool do_full_channel_search, bool do_remove_duplicates, bool do_add_full_ts, ServiceRequirements service_requirements, uint mplexid, const QMap< QString, QString > &startChan, const QString &freq_std, const QString &mod, const QString &tbl, const QString &tbl_start=QString(), const QString &tbl_end=QString())
Parses dvb-utils channel scanner output files.
@ CurrentTransportScan
Scans the transport when there is no tuner (for ASI)
virtual bool ImportHDHR(uint cardid, const QString &inputname, uint sourceid, ServiceRequirements serviceType)
bool m_fullSearch
Extended search for old channels post scan?
virtual void Teardown(void)
void SetSignalTimeout(std::chrono::milliseconds val)
std::chrono::milliseconds GetSignalTimeout(void) const
virtual void InformUser(const QString &)=0
Scanning class for cards that support a SignalMonitor class.
static bool GetTimeouts(uint inputid, std::chrono::milliseconds &signal_timeout, std::chrono::milliseconds &channel_timeout)
DVBSignalMonitor * GetDVBSignalMonitor(void)
bool m_channelNumbersOnly
Only channels with logical channel numbers desired post scan?
Signal monitoring base class.
IPTVChannelFetcher * m_iptvScanner
bool m_addFullTS
Add MPTS "full transport stream" channels.
static const int kTunerTypeDVBS2
bool ScanIPTVChannels(uint sourceid, const fbox_chan_map_t &iptv_channels)
static QString GetRawInputType(uint inputid)
Provides interface to the tuning hardware when using DVB drivers.
ServiceRequirements m_serviceRequirements
Services desired post scan.
bool HasFlags(uint64_t _flags) const
ScanMonitor * m_scanMonitor
void SetInputID(uint _inputid)
virtual void PreScanCommon(int scantype, uint cardid, const QString &inputname, uint sourceid, bool do_ignore_signal_timeout, bool do_test_decryption)
void AddListener(SignalMonitorListener *listener)
bool ScanCurrentTransport(const QString &sistandard)
static const int kTunerTypeATSC
fbox_chan_map_t GetChannels(void)
static const int kTunerTypeDVBT
INPUT_TYPES
all the different inputs
virtual void MonitorProgress(bool, bool, bool, bool)
bool ScanTransportsStartingOn(int sourceid, const QMap< QString, QString > &startChan)
Generates a list of frequencies to scan and adds it to the scanTransport list, and then sets the scan...
void ScanUpdateStatusText(const QString &status)
static const int kTunerTypeDVBT2
bool ScanTransport(uint mplexid, bool follow_nit)
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
void SetScanDTVTunerType(DTVTunerType t)
bool ScanExistingTransports(uint sourceid, bool follow_nit)
If we are not already scanning a frequency table, this creates a new frequency table from database an...
virtual bool ImportM3U(uint cardid, const QString &inputname, uint sourceid, bool is_mpts)
bool m_completeOnly
Only complete channels desired post scan?
static QString GetVideoDevice(uint inputid)
bool ScanForChannels(uint sourceid, const QString &std, const QString &cardtype, const DTVChannelList &channels)
SignalMonitor * GetSignalMonitor(void)
virtual bool ImportExternRecorder(uint cardid, const QString &inputname, uint sourceid)