本文整理汇总了C++中DTVMultiplex类的典型用法代码示例。如果您正苦于以下问题:C++ DTVMultiplex类的具体用法?C++ DTVMultiplex怎么用?C++ DTVMultiplex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DTVMultiplex类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddChannel
void DTVConfParser::AddChannel(const DTVMultiplex &mux, DTVChannelInfo &chan)
{
for (uint i = 0; i < channels.size(); i++)
{
if (channels[i] == mux)
{
channels[i].channels.push_back(chan);
VERBOSE(VB_IMPORTANT, "Imported channel: "<<chan.toString()
<<" on "<<mux.toString());
return;
}
}
channels.push_back(mux);
channels.back().channels.push_back(chan);
VERBOSE(VB_IMPORTANT, "Imported channel: "<<chan.toString()
<<" on "<<mux.toString());
}
示例2: lock
/**
* \brief Tunes the card to a frequency but does not deal with PIDs.
*
* This is used by DVB Channel Scanner, the EIT Parser, and by TVRec.
*
* \param tuning Info on transport to tune to
* \param inputid Optional, forces specific input (for DiSEqC)
* \param force_reset If true, frequency tuning is done
* even if it should not be needed.
* \param same_input Optional, doesn't change input (for retuning).
* \return true on success, false on failure
*/
bool DVBChannel::Tune(const DTVMultiplex &tuning,
uint inputid,
bool force_reset,
bool same_input)
{
QMutexLocker lock(&tune_lock);
QMutexLocker locker(&hw_lock);
DVBChannel *master = GetMasterLock();
if (master != this)
{
LOG(VB_CHANNEL, LOG_INFO, LOC + "tuning on slave channel");
SetSIStandard(tuning.sistandard);
bool ok = master->Tune(tuning, inputid, force_reset, false);
ReturnMasterLock(master);
return ok;
}
ReturnMasterLock(master); // if we're the master we don't need this lock..
int intermediate_freq = 0;
bool can_fec_auto = false;
bool reset = (force_reset || first_tune);
if (tunerType.IsDiSEqCSupported() && !diseqc_tree)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"DVB-S needs device tree for LNB handling");
return false;
}
desired_tuning = tuning;
if (fd_frontend < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Tune(): Card not open!");
return false;
}
// Remove any events in queue before tuning.
drain_dvb_events(fd_frontend);
// send DVB-S setup
if (diseqc_tree)
{
// configure for new input
if (!same_input)
diseqc_settings.Load(inputid);
// execute diseqc commands
if (!diseqc_tree->Execute(diseqc_settings, tuning))
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Tune(): Failed to setup DiSEqC devices");
return false;
}
// retrieve actual intermediate frequency
DiSEqCDevLNB *lnb = diseqc_tree->FindLNB(diseqc_settings);
if (!lnb)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Tune(): No LNB for this configuration");
return false;
}
if (lnb->GetDeviceID() != last_lnb_dev_id)
{
last_lnb_dev_id = lnb->GetDeviceID();
// make sure we tune to frequency, if the lnb has changed
reset = first_tune = true;
}
intermediate_freq = lnb->GetIntermediateFrequency(
diseqc_settings, tuning);
// if card can auto-FEC, use it -- sometimes NITs are inaccurate
if (capabilities & FE_CAN_FEC_AUTO)
can_fec_auto = true;
// Check DVB-S intermediate frequency here since it requires a fully
// initialized diseqc tree
CheckFrequency(intermediate_freq);
}
LOG(VB_CHANNEL, LOG_INFO, LOC + "Old Params: " + prev_tuning.toString() +
"\n\t\t\t" + LOC + "New Params: " + tuning.toString());
//.........这里部分代码省略.........
示例3: CheckOptions
void DVBChannel::CheckOptions(DTVMultiplex &tuning) const
{
if ((tuning.inversion == DTVInversion::kInversionAuto) &&
!(capabilities & FE_CAN_INVERSION_AUTO))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"'Auto' inversion parameter unsupported by this driver, "
"falling back to 'off'.");
tuning.inversion = DTVInversion::kInversionOff;
}
// DVB-S needs a fully initialized diseqc tree and is checked later in Tune
if (!diseqc_tree)
CheckFrequency(tuning.frequency);
if (tunerType.IsFECVariable() &&
symbol_rate_minimum && symbol_rate_maximum &&
(symbol_rate_minimum <= symbol_rate_maximum) &&
(tuning.symbolrate < symbol_rate_minimum ||
tuning.symbolrate > symbol_rate_maximum))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
QString("Symbol Rate setting (%1) is out of range (min/max:%2/%3)")
.arg(tuning.symbolrate)
.arg(symbol_rate_minimum).arg(symbol_rate_maximum));
}
if (tunerType.IsFECVariable() && !CheckCodeRate(tuning.fec))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Selected fec_inner parameter unsupported by this driver.");
}
if (tunerType.IsModulationVariable() && !CheckModulation(tuning.modulation))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Selected modulation parameter unsupported by this driver.");
}
if (DTVTunerType::kTunerTypeDVBT != tunerType)
{
LOG(VB_CHANNEL, LOG_INFO, LOC + tuning.toString());
return;
}
// Check OFDM Tuning params
if (!CheckCodeRate(tuning.hp_code_rate))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Selected code_rate_hp parameter unsupported by this driver.");
}
if (!CheckCodeRate(tuning.lp_code_rate))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Selected code_rate_lp parameter unsupported by this driver.");
}
if ((tuning.bandwidth == DTVBandwidth::kBandwidthAuto) &&
!(capabilities & FE_CAN_BANDWIDTH_AUTO))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"'Auto' bandwidth parameter unsupported by this driver.");
}
if ((tuning.trans_mode == DTVTransmitMode::kTransmissionModeAuto) &&
!(capabilities & FE_CAN_TRANSMISSION_MODE_AUTO))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"'Auto' transmission_mode parameter unsupported by this driver.");
}
if ((tuning.guard_interval == DTVGuardInterval::kGuardIntervalAuto) &&
!(capabilities & FE_CAN_GUARD_INTERVAL_AUTO))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"'Auto' guard_interval parameter unsupported by this driver.");
}
if ((tuning.hierarchy == DTVHierarchy::kHierarchyAuto) &&
!(capabilities & FE_CAN_HIERARCHY_AUTO))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"'Auto' hierarchy parameter unsupported by this driver. ");
}
if (!CheckModulation(tuning.modulation))
{
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Selected modulation parameter unsupported by this driver.");
}
LOG(VB_CHANNEL, LOG_INFO, LOC + tuning.toString());
}
示例4: QString
bool DVBChannel::SetChannelByString(const QString &channum)
{
QString tmp = QString("SetChannelByString(%1): ").arg(channum);
QString loc = LOC + tmp;
QString loc_err = LOC_ERR + tmp;
VERBOSE(VB_CHANNEL, loc);
if (!IsOpen())
{
VERBOSE(VB_IMPORTANT, loc_err + "Channel object "
"will not open, cannot change channels.");
ClearDTVInfo();
return false;
}
ClearDTVInfo();
QString inputName;
if (!CheckChannel(channum, inputName))
{
VERBOSE(VB_IMPORTANT, loc_err +
"CheckChannel failed.\n\t\t\tPlease verify the channel "
"in the 'mythtv-setup' Channel Editor.");
return false;
}
// If CheckChannel filled in the inputName we need to change inputs.
if (!inputName.isEmpty() && (nextInputID == m_currentInputID))
nextInputID = GetInputByName(inputName);
// Get the input data for the channel
int inputid = (nextInputID >= 0) ? nextInputID : m_currentInputID;
InputMap::const_iterator it = m_inputs.find(inputid);
if (it == m_inputs.end())
return false;
uint mplexid_restriction;
if (!IsInputAvailable(inputid, mplexid_restriction))
{
VERBOSE(VB_IMPORTANT, loc_err + "Input is not available");
return false;
}
// Get the input data for the channel
QString tvformat, modulation, freqtable, freqid, si_std;
int finetune;
uint64_t frequency;
int mpeg_prog_num;
uint atsc_major, atsc_minor, mplexid, tsid, netid;
if (!ChannelUtil::GetChannelData(
(*it)->sourceid, channum,
tvformat, modulation, freqtable, freqid,
finetune, frequency,
si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid,
mplexid, m_commfree))
{
VERBOSE(VB_IMPORTANT, loc_err +
"Unable to find channel in database.");
return false;
}
if (mplexid_restriction && (mplexid != mplexid_restriction))
{
VERBOSE(VB_IMPORTANT, loc_err + "Multiplex is not available");
return false;
}
// Initialize basic the tuning parameters
DTVMultiplex tuning;
if (!mplexid || !tuning.FillFromDB(tunerType, mplexid))
{
VERBOSE(VB_IMPORTANT, loc_err +
"Failed to initialize multiplex options");
return false;
}
SetDTVInfo(atsc_major, atsc_minor, netid, tsid, mpeg_prog_num);
// Try to fix any problems with the multiplex
CheckOptions(tuning);
if (!Tune(tuning, inputid))
{
VERBOSE(VB_IMPORTANT, loc_err + "Tuning to frequency.");
ClearDTVInfo();
return false;
}
QString tmpX = channum; tmpX.detach();
m_curchannelname = tmpX;
VERBOSE(VB_CHANNEL, loc + "Tuned to frequency.");
//.........这里部分代码省略.........
示例5: LOG
void ScanWizard::SetPage(const QString &pageTitle)
{
LOG(VB_CHANSCAN, LOG_INFO, QString("SetPage(%1)").arg(pageTitle));
if (pageTitle != ChannelScannerGUI::kTitle)
{
scannerPane->quitScanning();
return;
}
QMap<QString,QString> start_chan;
DTVTunerType parse_type = DTVTunerType::kTunerTypeUnknown;
uint cardid = configPane->GetCardID();
QString inputname = configPane->GetInputName();
uint sourceid = configPane->GetSourceID();
int scantype = configPane->GetScanType();
bool do_scan = true;
LOG(VB_CHANSCAN, LOG_INFO, LOC + "SetPage(): " +
QString("type(%1) cardid(%2) inputname(%3)")
.arg(scantype).arg(cardid).arg(inputname));
if (scantype == ScanTypeSetting::DVBUtilsImport)
{
scannerPane->ImportDVBUtils(sourceid, lastHWCardType,
configPane->GetFilename());
}
else if (scantype == ScanTypeSetting::NITAddScan_DVBT)
{
start_chan = configPane->GetStartChan();
parse_type = DTVTunerType::kTunerTypeDVBT;
}
else if (scantype == ScanTypeSetting::NITAddScan_DVBS)
{
start_chan = configPane->GetStartChan();
parse_type = DTVTunerType::kTunerTypeDVBS1;
}
else if (scantype == ScanTypeSetting::NITAddScan_DVBS2)
{
start_chan = configPane->GetStartChan();
parse_type = DTVTunerType::kTunerTypeDVBS2;
}
else if (scantype == ScanTypeSetting::NITAddScan_DVBC)
{
start_chan = configPane->GetStartChan();
parse_type = DTVTunerType::kTunerTypeDVBC;
}
else if (scantype == ScanTypeSetting::IPTVImport)
{
do_scan = false;
scannerPane->ImportM3U(cardid, inputname, sourceid);
}
else if ((scantype == ScanTypeSetting::FullScan_ATSC) ||
(scantype == ScanTypeSetting::FullTransportScan) ||
(scantype == ScanTypeSetting::TransportScan) ||
(scantype == ScanTypeSetting::CurrentTransportScan) ||
(scantype == ScanTypeSetting::FullScan_DVBC) ||
(scantype == ScanTypeSetting::FullScan_DVBT) ||
(scantype == ScanTypeSetting::FullScan_Analog))
{
;
}
else if (scantype == ScanTypeSetting::ExistingScanImport)
{
do_scan = false;
uint scanid = configPane->GetScanID();
ScanDTVTransportList transports = LoadScan(scanid);
ChannelImporter ci(true, true, true, true, false,
configPane->DoFreeToAirOnly(),
configPane->GetServiceRequirements());
ci.Process(transports);
}
else
{
do_scan = false;
LOG(VB_CHANSCAN, LOG_ERR, LOC + "SetPage(): " +
QString("type(%1) src(%2) cardid(%3) not handled")
.arg(scantype).arg(sourceid).arg(cardid));
MythPopupBox::showOkPopup(
GetMythMainWindow(), tr("ScanWizard"),
tr("Programmer Error, see console"));
}
// Just verify what we get from the UI...
DTVMultiplex tuning;
if ((parse_type != DTVTunerType::kTunerTypeUnknown) &&
!tuning.ParseTuningParams(
parse_type,
start_chan["frequency"], start_chan["inversion"],
start_chan["symbolrate"], start_chan["fec"],
start_chan["polarity"],
start_chan["coderate_hp"], start_chan["coderate_lp"],
start_chan["constellation"], start_chan["trans_mode"],
start_chan["guard_interval"], start_chan["hierarchy"],
start_chan["modulation"], start_chan["bandwidth"],
start_chan["mod_sys"], start_chan["rolloff"]))
{
MythPopupBox::showOkPopup(
GetMythMainWindow(), tr("ScanWizard"),
//.........这里部分代码省略.........