Go to the documentation of this file.
41 #ifdef USING_DVB // for bug in gcc 8.3
52 #define LOC QString("ChScan: ")
89 m_vboxScanner->
Stop();
91 m_vboxScanner =
nullptr;
95 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
96 if (m_externRecScanner)
98 m_externRecScanner->Stop();
99 delete m_externRecScanner;
100 m_externRecScanner =
nullptr;
114 const QString &inputname,
116 bool do_ignore_signal_timeout,
118 bool do_test_decryption,
121 bool do_complete_only,
122 bool do_full_channel_search,
123 bool do_remove_duplicates,
128 const QMap<QString,QString> &startChan,
129 const QString &freq_std,
132 const QString &tbl_start,
133 const QString &tbl_end)
145 sourceid, do_ignore_signal_timeout, do_test_decryption);
147 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
"Scan()");
151 LOG(VB_CHANSCAN, LOG_ERR,
LOC +
"Scan(): scanner does not exist...");
167 LOG(VB_CHANSCAN, LOG_INFO,
LOC + QString(
"ScanTransports(%1, %2, %3)")
168 .arg(freq_std, mod, tbl));
172 if ((mod.startsWith(
"qam", Qt::CaseInsensitive)) &&
182 sourceid, freq_std, mod, tbl, tbl_start, tbl_end);
191 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
"ScanTransports()");
198 LOG(VB_CHANSCAN, LOG_INFO,
LOC + QString(
"ScanExistingTransports of source %1")
216 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
217 QString(
"ScanForChannels for source %1").arg(sourceid));
220 QString sub_type = card_type;
221 if (card_type ==
"DVB")
225 ok = !device.isEmpty();
249 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
"IPTVImportMPTS: no channels");
253 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
254 QString(
"ScanIPTVChannels(%1) IPTV MPTS").arg(sourceid));
261 InformUser(tr(
"Error scanning MPTS in IPTV"));
268 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
269 QString(
"ScanTransport(%1)").arg(mplexid));
275 QString sistandard =
"mpeg";
276 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
277 "ScanCurrentTransport(" + sistandard +
")");
282 LOG(VB_CHANSCAN, LOG_INFO,
LOC +
283 "Importing channels from External Recorder");
289 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to handle tune complete.");
291 "Failed to handle tune complete."));
341 msg = tr(
"Failed to parse '%1'").arg(
file);
343 msg = tr(
"Programmer Error : incorrect card type");
345 msg = tr(
"Failed to open '%1'").arg(
file);
354 [[maybe_unused]]
const QString &inputname,
378 [[maybe_unused]]
const QString &inputname,
380 [[maybe_unused]]
bool ftaOnly,
393 m_vboxScanner->Scan();
402 [[maybe_unused]]
const QString &inputname,
406 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
418 m_externRecScanner->Scan();
427 [[maybe_unused]]
const QString &inputname,
432 #ifdef USING_HDHOMERUN
452 const QString &inputname,
454 [[maybe_unused]]
bool do_ignore_signal_timeout,
455 bool do_test_decryption)
457 bool monitor_snr =
false;
458 std::chrono::milliseconds signal_timeout = 1s;
459 std::chrono::milliseconds channel_timeout = 40s;
463 if (device.isEmpty())
465 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No Device");
466 InformUser(tr(
"Programmer Error: No Device"));
476 if (
"DVB" == card_type)
479 bool need_nit = ((
"QAM" == sub_type) ||
480 (
"QPSK" == sub_type) ||
481 (
"OFDM" == sub_type) ||
482 (
"DVB_T2" == sub_type));
488 signal_timeout = (do_ignore_signal_timeout) ?
489 channel_timeout * 10 : signal_timeout;
493 signal_timeout = std::max(signal_timeout, 1000ms);
498 channel_timeout = std::max(channel_timeout,
static_cast<int>(need_nit) * 7 * 1000ms);
505 if ((
"V4L" == card_type) || (
"MPEG" == card_type))
509 #ifdef USING_HDHOMERUN
510 if (
"HDHOMERUN" == card_type)
515 #endif // USING_HDHOMERUN
518 if (
"SATIP" == card_type)
525 if (
"ASI" == card_type)
532 if (
"FREEBOX" == card_type)
539 if (
"VBOX" == card_type)
545 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
546 if (
"EXTERNAL" == card_type)
554 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Channel not created");
555 InformUser(tr(
"Programmer Error: Channel not created"));
565 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Channel could not be opened");
566 InformUser(tr(
"Channel could not be opened."));
573 sourceid, signal_timeout, channel_timeout,
574 inputname, do_test_decryption);
617 bool using_rotor =
false;
628 bool monitor_lock = mon !=
nullptr;
629 bool monitor_strength = mon !=
nullptr;
630 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)