diff --git a/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp b/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp index b8fbfa9c0be..584d4212078 100644 --- a/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp +++ b/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp @@ -24,62 +24,62 @@ void ScanWizard::SetupConfig( uint default_sourceid, uint default_cardid, QString default_inputname) { - videoSource = new VideoSourceSelector( + m_videoSource = new VideoSourceSelector( default_sourceid, CardUtil::GetScanableInputTypes(), false); - input = new InputSelector(default_cardid, default_inputname); - scanType = new ScanTypeSetting(), - scanConfig = new ScanOptionalConfig(scanType); - services = new DesiredServices(); - ftaOnly = new FreeToAirOnly(); - addFullTS = new AddFullTS(); - trustEncSI = new TrustEncSISetting(); - - addChild(services); - addChild(ftaOnly); - addChild(addFullTS); - addChild(trustEncSI); - - addChild(videoSource); - addChild(input); - addChild(scanType); - addChild(scanConfig); - - connect(videoSource, SIGNAL(valueChanged(const QString&)), - scanConfig, SLOT( SetSourceID( const QString&))); - - connect(videoSource, SIGNAL(valueChanged(const QString&)), - input, SLOT( SetSourceID( const QString&))); - - connect(input, SIGNAL(valueChanged(const QString&)), - scanType, SLOT( SetInput( const QString&))); - - connect(input, SIGNAL(valueChanged(const QString&)), - this, SLOT( SetInput( const QString&))); + m_input = new InputSelector(default_cardid, default_inputname); + m_scanType = new ScanTypeSetting(), + m_scanConfig = new ScanOptionalConfig(m_scanType); + m_services = new DesiredServices(); + m_ftaOnly = new FreeToAirOnly(); + m_addFullTS = new AddFullTS(); + m_trustEncSI = new TrustEncSISetting(); + + addChild(m_services); + addChild(m_ftaOnly); + addChild(m_addFullTS); + addChild(m_trustEncSI); + + addChild(m_videoSource); + addChild(m_input); + addChild(m_scanType); + addChild(m_scanConfig); + + connect(m_videoSource, SIGNAL(valueChanged(const QString&)), + m_scanConfig, SLOT( SetSourceID( const QString&))); + + connect(m_videoSource, SIGNAL(valueChanged(const QString&)), + m_input, SLOT( SetSourceID( const QString&))); + + connect(m_input, SIGNAL(valueChanged(const QString&)), + m_scanType, SLOT( SetInput( const QString&))); + + connect(m_input, SIGNAL(valueChanged(const QString&)), + this, SLOT( SetInput( const QString&))); } uint ScanWizard::GetSourceID(void) const { - return videoSource->getValue().toUInt(); + return m_videoSource->getValue().toUInt(); } ServiceRequirements ScanWizard::GetServiceRequirements(void) const { - return services->GetServiceRequirements(); + return m_services->GetServiceRequirements(); } bool ScanWizard::DoFreeToAirOnly(void) const { - return ftaOnly->getValue().toInt(); + return m_ftaOnly->getValue().toInt(); } bool ScanWizard::DoAddFullTS(void) const { - return addFullTS->getValue().toInt(); + return m_addFullTS->getValue().toInt(); } bool ScanWizard::DoTestDecryption(void) const { - return trustEncSI->getValue().toInt(); + return m_trustEncSI->getValue().toInt(); } //////////////////////////////////////////////////////////////////////////// diff --git a/mythtv/libs/libmythtv/mythccextractorplayer.cpp b/mythtv/libs/libmythtv/mythccextractorplayer.cpp index 529701cc010..7d197ab11f9 100644 --- a/mythtv/libs/libmythtv/mythccextractorplayer.cpp +++ b/mythtv/libs/libmythtv/mythccextractorplayer.cpp @@ -658,12 +658,12 @@ void MythCCExtractorPlayer::IngestDVBSubtitles(void) AVSubtitles *avsubtitles = (*subit).reader->GetAVSubtitles(); - QMutexLocker locker(&(avsubtitles->lock)); + QMutexLocker locker(&(avsubtitles->m_lock)); - while (!avsubtitles->buffers.empty()) + while (!avsubtitles->m_buffers.empty()) { - const AVSubtitle subtitle = avsubtitles->buffers.front(); - avsubtitles->buffers.pop_front(); + const AVSubtitle subtitle = avsubtitles->m_buffers.front(); + avsubtitles->m_buffers.pop_front(); const QSize v_size = QSize(GetVideoSize().width()*4, GetVideoSize().height()*4); diff --git a/mythtv/libs/libmythtv/scanwizard.cpp b/mythtv/libs/libmythtv/scanwizard.cpp index d678f9a388d..832be92b824 100644 --- a/mythtv/libs/libmythtv/scanwizard.cpp +++ b/mythtv/libs/libmythtv/scanwizard.cpp @@ -33,7 +33,6 @@ #include "channelscanner_gui.h" #include "scanwizard.h" #include "sourceutil.h" -#include "cardutil.h" #include "videosource.h" #include "scaninfo.h" #include "channelimporter.h" @@ -44,9 +43,7 @@ ScanWizard::ScanWizard(uint default_sourceid, uint default_cardid, QString default_inputname) : - lastHWCardID(0), - lastHWCardType(CardUtil::ERROR_PROBE), - scannerPane(new ChannelScannerGUI()) + m_scannerPane(new ChannelScannerGUI()) { SetupConfig(default_sourceid, default_cardid, default_inputname); ButtonStandardSetting *scanButton = new ButtonStandardSetting(tr("Scan")); @@ -71,7 +68,7 @@ void ScanWizard::Scan() if (scantype == ScanTypeSetting::DVBUtilsImport) { - scannerPane->ImportDVBUtils(sourceid, lastHWCardType, + m_scannerPane->ImportDVBUtils(sourceid, m_lastHWCardType, GetFilename()); } else if (scantype == ScanTypeSetting::NITAddScan_DVBT) @@ -102,23 +99,23 @@ void ScanWizard::Scan() else if (scantype == ScanTypeSetting::IPTVImport) { do_scan = false; - scannerPane->ImportM3U(cardid, inputname, sourceid, false); + m_scannerPane->ImportM3U(cardid, inputname, sourceid, false); } else if (scantype == ScanTypeSetting::VBoxImport) { do_scan = false; - scannerPane->ImportVBox(cardid, inputname, sourceid, + m_scannerPane->ImportVBox(cardid, inputname, sourceid, DoFreeToAirOnly(), GetServiceRequirements()); } else if (scantype == ScanTypeSetting::ExternRecImport) { do_scan = false; - scannerPane->ImportExternRecorder(cardid, inputname, sourceid); + m_scannerPane->ImportExternRecorder(cardid, inputname, sourceid); } else if (scantype == ScanTypeSetting::IPTVImportMPTS) { - scannerPane->ImportM3U(cardid, inputname, sourceid, true); + m_scannerPane->ImportM3U(cardid, inputname, sourceid, true); } else if ((scantype == ScanTypeSetting::FullScan_ATSC) || (scantype == ScanTypeSetting::FullTransportScan) || @@ -175,7 +172,7 @@ void ScanWizard::Scan() QString table_start, table_end; GetFrequencyTableRange(table_start, table_end); - scannerPane->Scan( + m_scannerPane->Scan( GetScanType(), GetCardID(), GetInputName(), GetSourceID(), DoIgnoreSignalTimeout(), DoFollowNIT(), @@ -199,11 +196,11 @@ void ScanWizard::SetInput(const QString &cardids_inputname) // Work out what kind of card we've got // We need to check against the last capture card so that we don't // try and probe a card which is already open by scan() - if ((lastHWCardID != cardid) || - (lastHWCardType == CardUtil::ERROR_OPEN)) + if ((m_lastHWCardID != cardid) || + (m_lastHWCardType == CardUtil::ERROR_OPEN)) { - lastHWCardID = cardid; + m_lastHWCardID = cardid; QString subtype = CardUtil::ProbeSubTypeName(cardid); - lastHWCardType = CardUtil::toInputType(subtype); + m_lastHWCardType = CardUtil::toInputType(subtype); } } diff --git a/mythtv/libs/libmythtv/scanwizard.h b/mythtv/libs/libmythtv/scanwizard.h index ee3807c2000..ed69793cd98 100644 --- a/mythtv/libs/libmythtv/scanwizard.h +++ b/mythtv/libs/libmythtv/scanwizard.h @@ -35,6 +35,7 @@ // MythTV headers #include "mythtvexp.h" #include "mythdbcon.h" +#include "cardutil.h" #include "standardsettings.h" #include "scanwizardconfig.h" @@ -56,9 +57,9 @@ class MTV_PUBLIC ScanWizard : public GroupSetting void SetInput(const QString &cardid_inputname); protected: - uint lastHWCardID; - uint lastHWCardType; - ChannelScannerGUI *scannerPane; + uint m_lastHWCardID {0}; + uint m_lastHWCardType {CardUtil::ERROR_PROBE}; + ChannelScannerGUI *m_scannerPane {nullptr}; // The following are moved from deleted class ScanWizardConfig public: @@ -66,39 +67,39 @@ class MTV_PUBLIC ScanWizard : public GroupSetting QString default_inputname); uint GetSourceID(void) const; - uint GetScanID(void) const { return scanConfig->GetScanID(); } - QString GetModulation(void) const { return scanConfig->GetModulation(); } - int GetScanType(void) const { return scanType->getValue().toInt();} - uint GetCardID(void) const { return input->GetCardID(); } - QString GetInputName(void) const { return input->GetInputName(); } - QString GetFilename(void) const { return scanConfig->GetFilename(); } - uint GetMultiplex(void) const { return scanConfig->GetMultiplex(); } + uint GetScanID(void) const { return m_scanConfig->GetScanID(); } + QString GetModulation(void) const { return m_scanConfig->GetModulation(); } + int GetScanType(void) const { return m_scanType->getValue().toInt();} + uint GetCardID(void) const { return m_input->GetCardID(); } + QString GetInputName(void) const { return m_input->GetInputName(); } + QString GetFilename(void) const { return m_scanConfig->GetFilename(); } + uint GetMultiplex(void) const { return m_scanConfig->GetMultiplex(); } bool GetFrequencyTableRange(QString &start, QString &end) const - { return scanConfig->GetFrequencyTableRange(start, end); } + { return m_scanConfig->GetFrequencyTableRange(start, end); } QString GetFrequencyStandard(void) const - { return scanConfig->GetFrequencyStandard(); } + { return m_scanConfig->GetFrequencyStandard(); } QString GetFrequencyTable(void) const - { return scanConfig->GetFrequencyTable(); } + { return m_scanConfig->GetFrequencyTable(); } QMap GetStartChan(void) const - { return scanConfig->GetStartChan(); } + { return m_scanConfig->GetStartChan(); } ServiceRequirements GetServiceRequirements(void) const; bool DoIgnoreSignalTimeout(void) const - { return scanConfig->DoIgnoreSignalTimeout(); } + { return m_scanConfig->DoIgnoreSignalTimeout(); } bool DoFollowNIT(void) const - { return scanConfig->DoFollowNIT(); } + { return m_scanConfig->DoFollowNIT(); } bool DoFreeToAirOnly(void) const; bool DoAddFullTS(void) const; bool DoTestDecryption(void) const; protected: - VideoSourceSelector *videoSource; - InputSelector *input; - ScanTypeSetting *scanType; - ScanOptionalConfig *scanConfig; - DesiredServices *services; - FreeToAirOnly *ftaOnly; - AddFullTS *addFullTS; - TrustEncSISetting *trustEncSI; + VideoSourceSelector *m_videoSource {nullptr}; + InputSelector *m_input {nullptr}; + ScanTypeSetting *m_scanType {nullptr}; + ScanOptionalConfig *m_scanConfig {nullptr}; + DesiredServices *m_services {nullptr}; + FreeToAirOnly *m_ftaOnly {nullptr}; + AddFullTS *m_addFullTS {nullptr}; + TrustEncSISetting *m_trustEncSI {nullptr}; // End of members moved from ScanWizardConfig }; diff --git a/mythtv/libs/libmythtv/signalmonitorvalue.cpp b/mythtv/libs/libmythtv/signalmonitorvalue.cpp index 69b6ceb8532..5de7e42d253 100644 --- a/mythtv/libs/libmythtv/signalmonitorvalue.cpp +++ b/mythtv/libs/libmythtv/signalmonitorvalue.cpp @@ -9,7 +9,7 @@ QStringList SignalMonitorValue::ERROR_NO_CHANNEL; QStringList SignalMonitorValue::ERROR_NO_LINK; QStringList SignalMonitorValue::SIGNAL_LOCK; -#define DEBUG_SIGNAL_MONITOR_VALUE 0 +#define DEBUG_SIGNAL_MONITOR_VALUE 1 /** \fn SignalMonitorValue::Init() * \brief Initializes the some static constants needed by SignalMonitorValue. @@ -38,20 +38,20 @@ SignalMonitorValue::SignalMonitorValue(const QString& _name, bool _high_threshold, int _min, int _max, int _timeout) : - name(_name), - noSpaceName(_noSpaceName), - value(0), - threshold(_threshold), - minval(_min), maxval(_max), timeout(_timeout), - high_threshold(_high_threshold), set(false) + m_name(_name), + m_noSpaceName(_noSpaceName), + m_value(0), + m_threshold(_threshold), + m_minVal(_min), m_maxVal(_max), m_timeout(_timeout), + m_highThreshold(_high_threshold) { Init(); #if DEBUG_SIGNAL_MONITOR_VALUE LOG(VB_GENERAL, LOG_DEBUG, QString("SignalMonitorValue(%1, %2, %3, %4, %5, %6, %7, %8, %9)") - .arg(name) .arg(noSpaceName) .arg(value) .arg(threshold) - .arg(minval) .arg(maxval) .arg(timeout) .arg(high_threshold) - .arg((set ? "true" : "false"))); + .arg(m_name) .arg(m_noSpaceName) .arg(m_value) .arg(m_threshold) + .arg(m_minVal) .arg(m_maxVal) .arg(m_timeout) .arg(m_highThreshold) + .arg((m_set ? "true" : "false"))); #endif } @@ -61,55 +61,55 @@ SignalMonitorValue::SignalMonitorValue(const QString& _name, bool _high_threshold, int _min, int _max, int _timeout, bool _set) : - name(_name), - noSpaceName(_noSpaceName), - value(_value), - threshold(_threshold), - minval(_min), maxval(_max), timeout(_timeout), - high_threshold(_high_threshold), set(_set) + m_name(_name), + m_noSpaceName(_noSpaceName), + m_value(_value), + m_threshold(_threshold), + m_minVal(_min), m_maxVal(_max), m_timeout(_timeout), + m_highThreshold(_high_threshold), m_set(_set) { Init(); #if DEBUG_SIGNAL_MONITOR_VALUE LOG(VB_GENERAL, LOG_DEBUG, QString("SignalMonitorValue(%1, %2, %3, %4, %5, %6, %7, %8, %9)") - .arg(name) .arg(noSpaceName) .arg(value) .arg(threshold) - .arg(minval) .arg(maxval) .arg(timeout) .arg(high_threshold) - .arg((set ? "true" : "false"))); + .arg(m_name) .arg(m_noSpaceName) .arg(m_value) .arg(m_threshold) + .arg(m_minVal) .arg(m_maxVal) .arg(m_timeout) .arg(m_highThreshold) + .arg((m_set ? "true" : "false"))); #endif } QString SignalMonitorValue::GetName(void) const { - if (name.isNull()) + if (m_name.isNull()) return QString(); - return name; + return m_name; } QString SignalMonitorValue::GetShortName(void) const { - if (noSpaceName.isNull()) + if (m_noSpaceName.isNull()) return QString(); - return noSpaceName; + return m_noSpaceName; } bool SignalMonitorValue::Set(const QString& _name, const QString& _longString) { - name = _name; + m_name = _name; QString longString = _longString; - if (name.isEmpty() || longString.isEmpty()) + if (m_name.isEmpty() || longString.isEmpty()) return false; - if (("message" == name) || ("error" == name)) + if (("message" == m_name) || ("error" == m_name)) { SetRange(0, 1); SetValue(0); - SetThreshold( ("message" == name) ? 0 : 1, true ); - SetTimeout( ("message" == name) ? 0 : -1 ); - noSpaceName = name; - name = longString; + SetThreshold( ("message" == m_name) ? 0 : 1, true ); + SetTimeout( ("message" == m_name) ? 0 : -1 ); + m_noSpaceName = m_name; + m_name = longString; return true; } @@ -119,13 +119,13 @@ bool SignalMonitorValue::Set(const QString& _name, const QString& _longString) if (8 != vals.size() || "(null)" == vals[0]) return false; - noSpaceName = vals[0]; + m_noSpaceName = vals[0]; SetRange(vals[3].toInt(), vals[4].toInt()); SetValue(vals[1].toInt()); SetThreshold(vals[2].toInt(), (bool) vals[6].toInt()); SetTimeout(vals[5].toInt()); - set = (bool) vals[7].toInt(); + m_set = (bool) vals[7].toInt(); return true; } @@ -182,14 +182,14 @@ bool SignalMonitorValue::AllGood(const SignalMonitorList& slist) if (!good) { QString msg("AllGood failed on "); - SignalMonitorList::const_iterator it = slist.begin(); + it = slist.begin(); for (; it != slist.end(); ++it) if (!it->IsGood()) { - msg += it->noSpaceName; + msg += it->m_noSpaceName; msg += QString("(%1%2%3) ") .arg(it->GetValue()) - .arg(it->high_threshold ? "<" : ">") + .arg(it->m_highThreshold ? "<" : ">") .arg(it->GetThreshold()); } LOG(VB_GENERAL, LOG_DEBUG, msg); diff --git a/mythtv/libs/libmythtv/signalmonitorvalue.h b/mythtv/libs/libmythtv/signalmonitorvalue.h index 28f150e5d0a..bb57c3e4f9e 100644 --- a/mythtv/libs/libmythtv/signalmonitorvalue.h +++ b/mythtv/libs/libmythtv/signalmonitorvalue.h @@ -32,31 +32,31 @@ class SignalMonitorValue /// \brief Returns a signal monitor value as one long string. QString GetStatus() const { - QString str = noSpaceName.isNull() ? "(null)" : noSpaceName; + QString str = m_noSpaceName.isNull() ? "(null)" : m_noSpaceName; return QString("%1 %2 %3 %4 %5 %6 %7 %8") - .arg(str).arg(value).arg(threshold).arg(minval).arg(maxval) - .arg(timeout).arg((int)high_threshold).arg((int)set); + .arg(str).arg(m_value).arg(m_threshold).arg(m_minVal).arg(m_maxVal) + .arg(m_timeout).arg((int)m_highThreshold).arg((int)m_set); } /// \brief Returns the value. - int GetValue() const { return value; } + int GetValue() const { return m_value; } /// \brief Returns smallest value possible, used for signal monitor bars. - int GetMin() const { return minval; } + int GetMin() const { return m_minVal; } /// \brief Returns greatest value possible, used for signal monitor bars. - int GetMax() const { return maxval; } + int GetMax() const { return m_maxVal; } /// \brief Returns the threshold at which the value is considered "good". /// \sa IsHighThreshold(), IsGood() - int GetThreshold() const { return threshold; } + int GetThreshold() const { return m_threshold; } /// \brief Returns true if values greater than the threshold are /// considered good, false otherwise. - bool IsHighThreshold() const { return high_threshold; } + bool IsHighThreshold() const { return m_highThreshold; } /// \brief Returns how long to wait for a good value in milliseconds. - int GetTimeout() const { return timeout; } + int GetTimeout() const { return m_timeout; } /// \brief Returns true if the value is equal to the threshold, or on the /// right side of the threshold (depends on IsHighThreashold()). bool IsGood() const { - return (high_threshold) ? value >= threshold : value <= threshold; + return (m_highThreshold) ? m_value >= m_threshold : m_value <= m_threshold; } /// \brief Returns the value normalized to the [newmin, newmax] range. /// \param newmin New minimum value. @@ -74,29 +74,29 @@ class SignalMonitorValue void SetValue(int _value) { - set = true; - value = min(max(_value,minval),maxval); + m_set = true; + m_value = min(max(_value,m_minVal),m_maxVal); } - void SetMin(int _min) { minval = _min; } + void SetMin(int _min) { m_minVal = _min; } - void SetMax(int _max) { maxval = _max; } + void SetMax(int _max) { m_maxVal = _max; } - void SetThreshold(int _threshold) { threshold = _threshold; } + void SetThreshold(int _threshold) { m_threshold = _threshold; } void SetThreshold(int _threshold, bool _high_threshold) { - threshold = _threshold; - high_threshold = _high_threshold; + m_threshold = _threshold; + m_highThreshold = _high_threshold; } /// \brief Sets the minimum and maximum values. /// \sa SetMin(int), SetMax(int) void SetRange(int _min, int _max) { - minval = _min; - maxval = _max; + m_minVal = _min; + m_maxVal = _max; } - void SetTimeout(int _timeout) { timeout = _timeout; } + void SetTimeout(int _timeout) { m_timeout = _timeout; } // // // // // // // // // // // // // // // // // // // // // // // // // Static Methods // // // // // // // // // // // // // // // // // // @@ -120,32 +120,30 @@ class SignalMonitorValue QString toString() const { - QString str = noSpaceName.isNull() ? "(null)" : noSpaceName; + QString str = m_noSpaceName.isNull() ? "(null)" : m_noSpaceName; return QString("Name(%1) Val(%2) thr(%3%4) range(%5,%6) " "timeout(%7 ms) %8 set. %9 good.") - .arg(str).arg(value).arg( (high_threshold) ? ">=" : "<=" ) - .arg(threshold).arg(minval).arg(maxval) - .arg(timeout).arg( (set) ? "is" : "is NOT" ) + .arg(str).arg(m_value).arg( (m_highThreshold) ? ">=" : "<=" ) + .arg(m_threshold).arg(m_minVal).arg(m_maxVal) + .arg(m_timeout).arg( (m_set) ? "is" : "is NOT" ) .arg( (IsGood()) ? "Is" : "Is NOT" ); } private: - SignalMonitorValue() : - value(-1), threshold(-1), minval(-1), maxval(-1), timeout(-1), - high_threshold(true), set(false) { } + SignalMonitorValue() = default; SignalMonitorValue(const QString& _name, const QString& _noSpaceName, int _value, int _threshold, bool _high_threshold, int _min, int _max, int _timeout, bool _set); bool Set(const QString& _name, const QString& _longString); - QString name; - QString noSpaceName; - int value; - int threshold; - int minval; - int maxval; - int timeout; - bool high_threshold; // false when we must be below threshold - bool set; // false until value initially set + QString m_name; + QString m_noSpaceName; + int m_value {-1}; + int m_threshold {-1}; + int m_minVal {-1}; + int m_maxVal {-1}; + int m_timeout {-1}; + bool m_highThreshold {true}; // false when we must be below threshold + bool m_set {false}; // false until value initially set }; typedef vector SignalMonitorList; diff --git a/mythtv/libs/libmythtv/subtitlereader.cpp b/mythtv/libs/libmythtv/subtitlereader.cpp index 491b5f8e3c3..c5b181bf4c7 100644 --- a/mythtv/libs/libmythtv/subtitlereader.cpp +++ b/mythtv/libs/libmythtv/subtitlereader.cpp @@ -1,12 +1,6 @@ #include "mythlogging.h" #include "subtitlereader.h" -SubtitleReader::SubtitleReader() - : m_AVSubtitlesEnabled(false), m_TextSubtitlesEnabled(false), - m_RawTextSubtitlesEnabled(false) -{ -} - SubtitleReader::~SubtitleReader() { ClearAVSubtitles(); @@ -55,18 +49,18 @@ bool SubtitleReader::AddAVSubtitle(const AVSubtitle &subtitle, } bool clearsubs = false; - m_AVSubtitles.lock.lock(); - m_AVSubtitles.fixPosition = fix_position; - m_AVSubtitles.buffers.push_back(subtitle); + m_AVSubtitles.m_lock.lock(); + m_AVSubtitles.m_fixPosition = fix_position; + m_AVSubtitles.m_buffers.push_back(subtitle); // in case forced subtitles aren't displayed, avoid leaking by // manually clearing the subtitles - if (m_AVSubtitles.buffers.size() > 40) + if (m_AVSubtitles.m_buffers.size() > 40) { LOG(VB_GENERAL, LOG_ERR, "SubtitleReader: >40 AVSubtitles queued - clearing."); clearsubs = true; } - m_AVSubtitles.lock.unlock(); + m_AVSubtitles.m_lock.unlock(); if (clearsubs) ClearAVSubtitles(); @@ -76,13 +70,13 @@ bool SubtitleReader::AddAVSubtitle(const AVSubtitle &subtitle, void SubtitleReader::ClearAVSubtitles(void) { - m_AVSubtitles.lock.lock(); - while (!m_AVSubtitles.buffers.empty()) + m_AVSubtitles.m_lock.lock(); + while (!m_AVSubtitles.m_buffers.empty()) { - FreeAVSubtitle(m_AVSubtitles.buffers.front()); - m_AVSubtitles.buffers.pop_front(); + FreeAVSubtitle(m_AVSubtitles.m_buffers.front()); + m_AVSubtitles.m_buffers.pop_front(); } - m_AVSubtitles.lock.unlock(); + m_AVSubtitles.m_lock.unlock(); } void SubtitleReader::FreeAVSubtitle(const AVSubtitle &subtitle) @@ -106,13 +100,13 @@ bool SubtitleReader::HasTextSubtitles(void) QStringList SubtitleReader::GetRawTextSubtitles(uint64_t &duration) { - QMutexLocker lock(&m_RawTextSubtitles.lock); - if (m_RawTextSubtitles.buffers.empty()) + QMutexLocker lock(&m_RawTextSubtitles.m_lock); + if (m_RawTextSubtitles.m_buffers.empty()) return QStringList(); - duration = m_RawTextSubtitles.duration; - QStringList result = m_RawTextSubtitles.buffers; - m_RawTextSubtitles.buffers.clear(); + duration = m_RawTextSubtitles.m_duration; + QStringList result = m_RawTextSubtitles.m_buffers; + m_RawTextSubtitles.m_buffers.clear(); return result; } @@ -121,14 +115,14 @@ void SubtitleReader::AddRawTextSubtitle(QStringList list, uint64_t duration) if (!m_RawTextSubtitlesEnabled || list.empty()) return; - QMutexLocker lock(&m_RawTextSubtitles.lock); - m_RawTextSubtitles.buffers.clear(); - m_RawTextSubtitles.buffers = list; - m_RawTextSubtitles.duration = duration; + QMutexLocker lock(&m_RawTextSubtitles.m_lock); + m_RawTextSubtitles.m_buffers.clear(); + m_RawTextSubtitles.m_buffers = list; + m_RawTextSubtitles.m_duration = duration; } void SubtitleReader::ClearRawTextSubtitles(void) { - QMutexLocker lock(&m_RawTextSubtitles.lock); - m_RawTextSubtitles.buffers.clear(); + QMutexLocker lock(&m_RawTextSubtitles.m_lock); + m_RawTextSubtitles.m_buffers.clear(); } diff --git a/mythtv/libs/libmythtv/subtitlereader.h b/mythtv/libs/libmythtv/subtitlereader.h index f7a022218ec..8e38ed9673b 100644 --- a/mythtv/libs/libmythtv/subtitlereader.h +++ b/mythtv/libs/libmythtv/subtitlereader.h @@ -13,26 +13,26 @@ extern "C" { class AVSubtitles { public: - AVSubtitles() : fixPosition(false) { } - MythDeque buffers; - QMutex lock; - bool fixPosition; + AVSubtitles() = default; + MythDeque m_buffers; + QMutex m_lock; + bool m_fixPosition {false}; }; class RawTextSubs { public: - RawTextSubs(void) { duration = 0; } + RawTextSubs(void) = default; - QStringList buffers; - uint64_t duration; - QMutex lock; + QStringList m_buffers; + uint64_t m_duration {0}; + QMutex m_lock; }; class SubtitleReader { public: - SubtitleReader(); + SubtitleReader() = default; ~SubtitleReader(); void EnableAVSubtitles(bool enable); @@ -55,11 +55,11 @@ class SubtitleReader private: AVSubtitles m_AVSubtitles; - bool m_AVSubtitlesEnabled; + bool m_AVSubtitlesEnabled {false}; TextSubtitles m_TextSubtitles; - bool m_TextSubtitlesEnabled; + bool m_TextSubtitlesEnabled {false}; RawTextSubs m_RawTextSubtitles; - bool m_RawTextSubtitlesEnabled; + bool m_RawTextSubtitlesEnabled {false}; }; #endif // SUBTITLEREADER_H diff --git a/mythtv/libs/libmythtv/subtitlescreen.cpp b/mythtv/libs/libmythtv/subtitlescreen.cpp index c6c8be7f356..5ed07bea67c 100644 --- a/mythtv/libs/libmythtv/subtitlescreen.cpp +++ b/mythtv/libs/libmythtv/subtitlescreen.cpp @@ -639,32 +639,32 @@ int SubtitleFormat::GetBackgroundAlpha(const QString &family) QSize FormattedTextChunk::CalcSize(float layoutSpacing) const { - return parent->CalcTextSize(text, m_format, layoutSpacing); + return m_parent->CalcTextSize(m_text, m_format, layoutSpacing); } void FormattedTextChunk::CalcPadding(bool isFirst, bool isLast, int &left, int &right) const { - parent->CalcPadding(m_format, isFirst, isLast, left, right); + m_parent->CalcPadding(m_format, isFirst, isLast, left, right); } bool FormattedTextChunk::Split(FormattedTextChunk &newChunk) { LOG(VB_VBI, LOG_INFO, - QString("Attempting to split chunk '%1'").arg(text)); - int lastSpace = text.lastIndexOf(' ', -2); // -2 to ignore trailing space + QString("Attempting to split chunk '%1'").arg(m_text)); + int lastSpace = m_text.lastIndexOf(' ', -2); // -2 to ignore trailing space if (lastSpace < 0) { LOG(VB_VBI, LOG_INFO, - QString("Failed to split chunk '%1'").arg(text)); + QString("Failed to split chunk '%1'").arg(m_text)); return false; } - newChunk.parent = parent; + newChunk.m_parent = m_parent; newChunk.m_format = m_format; - newChunk.text = text.mid(lastSpace + 1).trimmed() + ' '; - text = text.left(lastSpace).trimmed(); + newChunk.m_text = m_text.mid(lastSpace + 1).trimmed() + ' '; + m_text = m_text.left(lastSpace).trimmed(); LOG(VB_VBI, LOG_INFO, - QString("Split chunk into '%1' + '%2'").arg(text).arg(newChunk.text)); + QString("Split chunk into '%1' + '%2'").arg(m_text).arg(newChunk.m_text)); return true; } @@ -688,23 +688,23 @@ QString FormattedTextChunk::ToLogString(void) const .arg(m_format.m_underline) .arg(m_format.m_boldface); str += QString("font=%1 ").arg(m_format.m_font_tag); - str += QString(" text='%1'").arg(text); + str += QString(" text='%1'").arg(m_text); return str; } bool FormattedTextChunk::PreRender(bool isFirst, bool isLast, int &x, int y, int height) { - textFont = parent->GetFont(m_format); - if (!textFont) + m_textFont = m_parent->GetFont(m_format); + if (!m_textFont) return false; - QFontMetrics font(*(textFont->GetFace())); + QFontMetrics font(*(m_textFont->GetFace())); // If the chunk starts with whitespace, the leading whitespace // ultimately gets lost due to the text.trimmed() operation in the // MythUISimpleText constructor. To compensate, we manually // indent the chunk accordingly. int count = 0; - while (count < text.length() && text.at(count) == ' ') + while (count < m_text.length() && m_text.at(count) == ' ') { ++count; } @@ -721,15 +721,15 @@ bool FormattedTextChunk::PreRender(bool isFirst, bool isLast, // Don't draw a background behind leading spaces. if (isFirst) bgrect.setLeft(bgrect.left() + x_adjust); - bgShapeName = QString("subbg%1x%2@%3,%4") + m_bgShapeName = QString("subbg%1x%2@%3,%4") .arg(chunk_sz.width()).arg(height).arg(x).arg(y); - bgShapeRect = bgrect; + m_bgShapeRect = bgrect; // Shift to the right to account for leading spaces that // are removed by the MythUISimpleText constructor. Also // add in padding at the end to avoid clipping. - textName = QString("subtxt%1x%2@%3,%4") + m_textName = QString("subtxt%1x%2@%3,%4") .arg(chunk_sz.width()).arg(height).arg(x).arg(y); - textRect = QRect(x + x_adjust, y, + m_textRect = QRect(x + x_adjust, y, chunk_sz.width() - x_adjust + rightPadding, height); x += chunk_sz.width(); @@ -756,30 +756,6 @@ QSize FormattedTextLine::CalcSize(float layoutSpacing) const return QSize(width + rightPadding, height); } -FormattedTextSubtitle::FormattedTextSubtitle(const QString &base, - const QRect &safearea, - uint64_t start, uint64_t duration, - SubtitleScreen *p) : - m_base(base), m_safeArea(safearea), - m_start(start), m_duration(duration), m_subScreen(p) -{ - // make cppcheck happy - m_xAnchorPoint = 0; - m_yAnchorPoint = 0; - m_xAnchor = 0; - m_yAnchor = 0; -} - -FormattedTextSubtitle::FormattedTextSubtitle(void) : - m_start(0), m_duration(0), m_subScreen(nullptr) -{ - // make cppcheck happy - m_xAnchorPoint = 0; - m_yAnchorPoint = 0; - m_xAnchor = 0; - m_yAnchor = 0; -} - // Normal font height is designed to be 1/20 of safe area height, with // extra blank space between lines to make 17 lines within the safe // area. @@ -825,22 +801,22 @@ void FormattedTextSubtitle::Layout(void) int y = anchor_y; for (int i = 0; i < m_lines.size(); i++) { - if (m_lines[i].x_indent < 0) - m_lines[i].x_indent = anchor_x; - if (m_lines[i].y_indent < 0) - m_lines[i].y_indent = y; + if (m_lines[i].m_xIndent < 0) + m_lines[i].m_xIndent = anchor_x; + if (m_lines[i].m_yIndent < 0) + m_lines[i].m_yIndent = y; y += m_lines[i].CalcSize(LINE_SPACING).height(); // Prune leading all-whitespace chunks. while (!m_lines[i].chunks.isEmpty() && - m_lines[i].chunks.first().text.trimmed().isEmpty()) + m_lines[i].chunks.first().m_text.trimmed().isEmpty()) { - m_lines[i].x_indent += + m_lines[i].m_xIndent += m_lines[i].chunks.first().CalcSize().width(); m_lines[i].chunks.removeFirst(); } // Prune trailing all-whitespace chunks. while (!m_lines[i].chunks.isEmpty() && - m_lines[i].chunks.last().text.trimmed().isEmpty()) + m_lines[i].chunks.last().m_text.trimmed().isEmpty()) { m_lines[i].chunks.removeLast(); } @@ -849,7 +825,7 @@ void FormattedTextSubtitle::Layout(void) // routine.) if (!m_lines[i].chunks.isEmpty()) { - QString *str = &m_lines[i].chunks.last().text; + QString *str = &m_lines[i].chunks.last().m_text; int idx = str->length() - 1; while (idx >= 0 && str->at(idx) == ' ') --idx; @@ -862,8 +838,8 @@ void FormattedTextSubtitle::PreRender(void) { for (int i = 0; i < m_lines.size(); i++) { - int x = m_lines[i].x_indent; - int y = m_lines[i].y_indent; + int x = m_lines[i].m_xIndent; + int y = m_lines[i].m_yIndent; int height = m_lines[i].CalcSize().height(); QList::iterator chunk; bool isFirst = true; @@ -900,26 +876,26 @@ void FormattedTextSubtitle::Draw(void) // order of the children. In particular, background // shapes should be added/drawn first, and text drawn on // top. - if ((*chunk).textRect.width() > 0) { + if ((*chunk).m_textRect.width() > 0) { SubSimpleText *text = - new SubSimpleText((*chunk).text, *mythfont, - (*chunk).textRect, + new SubSimpleText((*chunk).m_text, *mythfont, + (*chunk).m_textRect, Qt::AlignLeft|Qt::AlignTop, /*m_subScreen*/nullptr, - (*chunk).textName, CacheNum(), + (*chunk).m_textName, CacheNum(), m_start + m_duration); textList += text; } - if ((*chunk).bgShapeRect.width() > 0) { + if ((*chunk).m_bgShapeRect.width() > 0) { MythUIShape *bgshape = m_subScreen->GetSubtitleFormat()-> GetBackground(/*m_subScreen*/nullptr, - (*chunk).bgShapeName, + (*chunk).m_bgShapeName, m_base, (*chunk).m_format, - MythRect((*chunk).bgShapeRect), CacheNum(), + MythRect((*chunk).m_bgShapeRect), CacheNum(), m_start, m_duration); if (bgshape) { - bgshape->SetArea(MythRect((*chunk).bgShapeRect)); + bgshape->SetArea(MythRect((*chunk).m_bgShapeRect)); shapeList += bgshape; } } @@ -937,14 +913,14 @@ QStringList FormattedTextSubtitle::ToSRT(void) const for (int i = 0; i < m_lines.size(); i++) { QString line; - if (m_lines[i].orig_x > 0) - line.fill(' ', m_lines[i].orig_x); + if (m_lines[i].m_origX > 0) + line.fill(' ', m_lines[i].m_origX); QList::const_iterator chunk; for (chunk = m_lines[i].chunks.constBegin(); chunk != m_lines[i].chunks.constEnd(); ++chunk) { - const QString &text = (*chunk).text; + const QString &text = (*chunk).m_text; const CC708CharacterAttribute &attr = (*chunk).m_format; bool isBlank = !attr.m_underline && text.trimmed().isEmpty(); if (!isBlank) @@ -1095,12 +1071,12 @@ void FormattedTextSubtitleSRT::WrapLongLines(void) width -= m_lines[i].chunks.back().CalcSize().width(); // Make sure there's a next line to wrap into. if (m_lines.size() == i + 1) - m_lines += FormattedTextLine(m_lines[i].x_indent, - m_lines[i].y_indent); + m_lines += FormattedTextLine(m_lines[i].m_xIndent, + m_lines[i].m_yIndent); m_lines[i+1].chunks.prepend(m_lines[i].chunks.takeLast()); LOG(VB_VBI, LOG_INFO, QString("Wrapping chunk to next line: '%1'") - .arg(m_lines[i+1].chunks[0].text)); + .arg(m_lines[i+1].chunks[0].m_text)); } // Split the last chunk until width is small enough or until // no more splits are possible. @@ -1113,8 +1089,8 @@ void FormattedTextSubtitleSRT::WrapLongLines(void) { // Make sure there's a next line to split into. if (m_lines.size() == i + 1) - m_lines += FormattedTextLine(m_lines[i].x_indent, - m_lines[i].y_indent); + m_lines += FormattedTextLine(m_lines[i].m_xIndent, + m_lines[i].m_yIndent); m_lines[i+1].chunks.prepend(newChunk); width = m_lines[i].CalcSize().width(); } @@ -1193,8 +1169,8 @@ void FormattedTextSubtitle608::Layout(void) // Calculate totalHeight and totalSpace for (i = 0; i < m_lines.size(); i++) { - m_lines[i].y_indent = max(m_lines[i].y_indent, prevY); // avoid overlap - int y = m_lines[i].y_indent; + m_lines[i].m_yIndent = max(m_lines[i].m_yIndent, prevY); // avoid overlap + int y = m_lines[i].m_yIndent; if (i == 0) firstY = prevY = y; int height = m_lines[i].CalcSize().height(); @@ -1215,15 +1191,15 @@ void FormattedTextSubtitle608::Layout(void) prevY = firstY; for (i = 0; i < m_lines.size(); i++) { - m_lines[i].y_indent = prevY + spaceBefore[i] * shrink; - prevY = m_lines[i].y_indent + heights[i]; + m_lines[i].m_yIndent = prevY + spaceBefore[i] * shrink; + prevY = m_lines[i].m_yIndent + heights[i]; } } // Shift Y coordinates back up into the safe area. int shift = min(firstY, max(0, prevY - safeHeight)); for (i = 0; i < m_lines.size(); i++) - m_lines[i].y_indent -= shift; + m_lines[i].m_yIndent -= shift; FormattedTextSubtitle::Layout(); } @@ -1366,25 +1342,11 @@ void FormattedTextSubtitle708::Init(const CC708Window &win, SubtitleScreen::SubtitleScreen(MythPlayer *player, const char * name, int fontStretch) : MythScreenType((MythScreenType*)nullptr, name), - m_player(player), m_subreader(nullptr), m_608reader(nullptr), - m_708reader(nullptr), m_safeArea(QRect()), - m_removeHTML(QRegExp("")), m_subtitleType(kDisplayNone), - m_fontSize(0), - m_textFontZoom(100), m_textFontZoomPrev(100), - m_textFontDelayMs(0), m_textFontDelayMsPrev(0), - m_refreshModified(false), m_refreshDeleted(false), + m_player(player), m_fontStretch(fontStretch), m_format(new SubtitleFormat) { m_removeHTML.setMinimal(true); - -#ifdef USING_LIBASS - m_assLibrary = nullptr; - m_assRenderer = nullptr; - m_assTrackNum = -1; - m_assTrack = nullptr; - m_assFontCount = 0; -#endif } SubtitleScreen::~SubtitleScreen(void) @@ -1827,8 +1789,8 @@ void SubtitleScreen::DisplayAVSubtitles(void) return; AVSubtitles* subs = m_subreader->GetAVSubtitles(); - QMutexLocker lock(&(subs->lock)); - if (subs->buffers.empty() && (kDisplayAVSubtitle != m_subtitleType)) + QMutexLocker lock(&(subs->m_lock)); + if (subs->m_buffers.empty() && (kDisplayAVSubtitle != m_subtitleType)) return; VideoOutput *videoOut = m_player->GetVideoOutput(); @@ -1841,9 +1803,9 @@ void SubtitleScreen::DisplayAVSubtitles(void) QRect dummy; videoOut->GetOSDBounds(dummy, m_safeArea, tmp, tmp, tmp); - while (!subs->buffers.empty()) + while (!subs->m_buffers.empty()) { - const AVSubtitle subtitle = subs->buffers.front(); + const AVSubtitle subtitle = subs->m_buffers.front(); if (subtitle.start_display_time > currentFrame->timecode) break; @@ -1856,14 +1818,14 @@ void SubtitleScreen::DisplayAVSubtitles(void) subtitle.start_display_time; ClearDisplayedSubtitles(); - subs->buffers.pop_front(); + subs->m_buffers.pop_front(); for (std::size_t i = 0; i < subtitle.num_rects; ++i) { AVSubtitleRect* rect = subtitle.rects[i]; bool displaysub = true; - if (subs->buffers.size() > 0 && - subs->buffers.front().end_display_time < + if (subs->m_buffers.size() > 0 && + subs->m_buffers.front().end_display_time < currentFrame->timecode) { displaysub = false; @@ -1880,7 +1842,7 @@ void SubtitleScreen::DisplayAVSubtitles(void) int right = rect->x + rect->w; int bottom = rect->y + rect->h; - if (subs->fixPosition || (currentFrame->height < bottom) || + if (subs->m_fixPosition || (currentFrame->height < bottom) || (currentFrame->width < right) || !display.width() || !display.height()) { diff --git a/mythtv/libs/libmythtv/subtitlescreen.h b/mythtv/libs/libmythtv/subtitlescreen.h index e3b3b846e70..5bc7e8e8f78 100644 --- a/mythtv/libs/libmythtv/subtitlescreen.h +++ b/mythtv/libs/libmythtv/subtitlescreen.h @@ -32,8 +32,8 @@ class FormattedTextChunk FormattedTextChunk(const QString &t, const CC708CharacterAttribute &formatting, SubtitleScreen *p) - : text(t), m_format(formatting), parent(p), textFont(nullptr) {} - FormattedTextChunk(void) : parent(nullptr), textFont(nullptr) {} + : m_text(t), m_format(formatting), m_parent(p) {} + FormattedTextChunk(void) = default; QSize CalcSize(float layoutSpacing = 0.0f) const; void CalcPadding(bool isFirst, bool isLast, int &left, int &right) const; @@ -41,30 +41,31 @@ class FormattedTextChunk QString ToLogString(void) const; bool PreRender(bool isFirst, bool isLast, int &x, int y, int height); - QString text; + QString m_text; CC708CharacterAttribute m_format; // const - const SubtitleScreen *parent; // where fonts and sizes are kept + const SubtitleScreen *m_parent {nullptr}; // where fonts and sizes are kept // The following are calculated by PreRender(). - QString bgShapeName; - QRect bgShapeRect; - MythFontProperties *textFont; - QString textName; - QRect textRect; + QString m_bgShapeName; + QRect m_bgShapeRect; + MythFontProperties *m_textFont {nullptr}; + QString m_textName; + QRect m_textRect; }; class FormattedTextLine { public: FormattedTextLine(int x = -1, int y = -1, int o_x = -1, int o_y = -1) - : x_indent(x), y_indent(y), orig_x(o_x), orig_y(o_y) {} + : m_xIndent(x), m_yIndent(y), m_origX(o_x), m_origY(o_y) {} QSize CalcSize(float layoutSpacing = 0.0f) const; QList chunks; - int x_indent; // -1 means TBD i.e. centered - int y_indent; // -1 means TBD i.e. relative to bottom - int orig_x, orig_y; // original, unscaled coordinates + int m_xIndent {-1}; // -1 means TBD i.e. centered + int m_yIndent {-1}; // -1 means TBD i.e. relative to bottom + int m_origX {-1}; // original, unscaled coordinates + int m_origY {-1}; // original, unscaled coordinates }; class FormattedTextSubtitle @@ -72,8 +73,10 @@ class FormattedTextSubtitle protected: FormattedTextSubtitle(const QString &base, const QRect &safearea, uint64_t start, uint64_t duration, - SubtitleScreen *p); - FormattedTextSubtitle(void); + SubtitleScreen *p) : + m_base(base), m_safeArea(safearea), + m_start(start), m_duration(duration), m_subScreen(p) {} + FormattedTextSubtitle(void) = default; public: virtual ~FormattedTextSubtitle() = default; // These are the steps that can be done outside of the UI thread @@ -87,17 +90,17 @@ class FormattedTextSubtitle QStringList ToSRT(void) const; protected: - QString m_base; + QString m_base; QVector m_lines; - const QRect m_safeArea; - uint64_t m_start; - uint64_t m_duration; - SubtitleScreen *m_subScreen; // where fonts and sizes are kept - int m_xAnchorPoint; // 0=left, 1=center, 2=right - int m_yAnchorPoint; // 0=top, 1=center, 2=bottom - int m_xAnchor; // pixels from left - int m_yAnchor; // pixels from top - QRect m_bounds; + const QRect m_safeArea; + uint64_t m_start {0}; + uint64_t m_duration {0}; + SubtitleScreen *m_subScreen {nullptr}; // where fonts and sizes are kept + int m_xAnchorPoint {0}; // 0=left, 1=center, 2=right + int m_yAnchorPoint {0}; // 0=top, 1=center, 2=bottom + int m_xAnchor {0}; // pixels from left + int m_yAnchor {0}; // pixels from top + QRect m_bounds; }; class FormattedTextSubtitleSRT : public FormattedTextSubtitle @@ -224,25 +227,25 @@ class SubtitleScreen : public MythScreenType void AddScaledImage(QImage &img, QRect &pos); void InitializeFonts(bool wasResized); - MythPlayer *m_player; - SubtitleReader *m_subreader; - CC608Reader *m_608reader; - CC708Reader *m_708reader; - QRect m_safeArea; - QRegExp m_removeHTML; - int m_subtitleType; - int m_fontSize; - int m_textFontZoom; // valid for 708 & text subs - int m_textFontZoomPrev; - int m_textFontDelayMs; // valid for text subs - int m_textFontDelayMsPrev; - bool m_refreshModified; - bool m_refreshDeleted; - int m_fontStretch; - QString m_family; // 608, 708, text, teletext + MythPlayer *m_player {nullptr}; + SubtitleReader *m_subreader {nullptr}; + CC608Reader *m_608reader {nullptr}; + CC708Reader *m_708reader {nullptr}; + QRect m_safeArea; + QRegExp m_removeHTML {""}; + int m_subtitleType {kDisplayNone}; + int m_fontSize {0}; + int m_textFontZoom {100}; // valid for 708 & text subs + int m_textFontZoomPrev {100}; + int m_textFontDelayMs {0}; // valid for text subs + int m_textFontDelayMsPrev {0}; + bool m_refreshModified {false}; + bool m_refreshDeleted {false}; + int m_fontStretch; + QString m_family; // 608, 708, text, teletext // Subtitles initialized but still to be processed and drawn QList m_qInited; - class SubtitleFormat *m_format; + class SubtitleFormat *m_format {nullptr}; #ifdef USING_LIBASS bool InitialiseAssLibrary(void); @@ -254,11 +257,11 @@ class SubtitleScreen : public MythScreenType void ResizeAssRenderer(void); void RenderAssTrack(uint64_t timecode); - ASS_Library *m_assLibrary; - ASS_Renderer *m_assRenderer; - int m_assTrackNum; - ASS_Track *m_assTrack; - uint m_assFontCount; + ASS_Library *m_assLibrary {nullptr}; + ASS_Renderer *m_assRenderer {nullptr}; + int m_assTrackNum {-1}; + ASS_Track *m_assTrack {nullptr}; + uint m_assFontCount {0}; #endif // USING_LIBASS }; diff --git a/mythtv/libs/libmythtv/teletextdecoder.h b/mythtv/libs/libmythtv/teletextdecoder.h index a22a07d7dc5..da91f5871d8 100644 --- a/mythtv/libs/libmythtv/teletextdecoder.h +++ b/mythtv/libs/libmythtv/teletextdecoder.h @@ -9,15 +9,15 @@ class TeletextDecoder { public: explicit TeletextDecoder(TeletextReader *reader) - : m_teletext_reader(reader), m_decodertype(-1) {} + : m_teletext_reader(reader) {} virtual ~TeletextDecoder() = default; int GetDecoderType(void) const { return m_decodertype; } void Decode(const unsigned char *buf, int vbimode); private: - TeletextReader *m_teletext_reader; - int m_decodertype; + TeletextReader *m_teletext_reader {nullptr}; + int m_decodertype {-1}; }; #endif diff --git a/mythtv/libs/libmythtv/teletextreader.cpp b/mythtv/libs/libmythtv/teletextreader.cpp index 8e507106e0d..65247ffcda3 100644 --- a/mythtv/libs/libmythtv/teletextreader.cpp +++ b/mythtv/libs/libmythtv/teletextreader.cpp @@ -11,11 +11,6 @@ #define MAGAZINE(page) ((page) / 256) TeletextReader::TeletextReader() - : m_curpage(0x100), m_cursubpage(-1), - m_curpage_showheader(true), m_curpage_issubtitle(false), - m_transparent(false), m_revealHidden(false), - m_header_changed(false), m_page_changed(false), - m_fetchpage(0), m_fetchsubpage(0) { memset(m_pageinput, 0, sizeof(m_pageinput)); memset(m_header, 0, sizeof(m_header)); diff --git a/mythtv/libs/libmythtv/teletextreader.h b/mythtv/libs/libmythtv/teletextreader.h index 63528b1e409..a1eb28ec0d8 100644 --- a/mythtv/libs/libmythtv/teletextreader.h +++ b/mythtv/libs/libmythtv/teletextreader.h @@ -123,20 +123,20 @@ class TeletextReader const TeletextSubPage *FindSubPageInternal(int,int,int) const; const TeletextPage *FindPageInternal(int,int) const; - int m_curpage; - int m_cursubpage; - bool m_curpage_showheader; - bool m_curpage_issubtitle; + int m_curpage {0x100}; + int m_cursubpage {-1}; + bool m_curpage_showheader {true}; + bool m_curpage_issubtitle {false}; int m_pageinput[3]; - bool m_transparent; - bool m_revealHidden; + bool m_transparent {false}; + bool m_revealHidden {false}; uint8_t m_header[40]; - bool m_header_changed; - bool m_page_changed; + bool m_header_changed {false}; + bool m_page_changed {false}; TeletextMagazine m_magazines[8]; unsigned char m_bitswap[256]; - int m_fetchpage; - int m_fetchsubpage; + int m_fetchpage {0}; + int m_fetchsubpage {0}; }; #endif // TELETEXTREADER_H diff --git a/mythtv/libs/libmythtv/teletextscreen.cpp b/mythtv/libs/libmythtv/teletextscreen.cpp index bb35206ad5a..c818b643f92 100644 --- a/mythtv/libs/libmythtv/teletextscreen.cpp +++ b/mythtv/libs/libmythtv/teletextscreen.cpp @@ -42,12 +42,8 @@ static QChar cvt_char(char ch, int lang) TeletextScreen::TeletextScreen(MythPlayer *player, const char * name, int fontStretch) : MythScreenType((MythScreenType*)nullptr, name), - m_player(player), m_teletextReader(nullptr), - m_safeArea(QRect()), - m_colWidth(10), m_rowHeight(10), - m_bgColor(QColor(kColorBlack)), - m_displaying(false), m_fontStretch(fontStretch), - m_fontHeight(10) + m_player(player), + m_fontStretch(fontStretch) { } diff --git a/mythtv/libs/libmythtv/teletextscreen.h b/mythtv/libs/libmythtv/teletextscreen.h index 2106aa3760e..815ecaadad8 100644 --- a/mythtv/libs/libmythtv/teletextscreen.h +++ b/mythtv/libs/libmythtv/teletextscreen.h @@ -40,16 +40,16 @@ class TeletextScreen: public MythScreenType void DrawStatus(void); void DrawPage(void); - MythPlayer *m_player; - TeletextReader *m_teletextReader; + MythPlayer *m_player {nullptr}; + TeletextReader *m_teletextReader {nullptr}; QRect m_safeArea; - int m_colWidth; - int m_rowHeight; - QColor m_bgColor; - bool m_displaying; + int m_colWidth {10}; + int m_rowHeight {10}; + QColor m_bgColor {kColorBlack}; + bool m_displaying {false}; QHash m_rowImages; int m_fontStretch; - int m_fontHeight; + int m_fontHeight {10}; public: static const QColor kColorBlack; diff --git a/mythtv/libs/libmythtv/textsubtitleparser.cpp b/mythtv/libs/libmythtv/textsubtitleparser.cpp index e63abfbdc7d..7172d429caf 100644 --- a/mythtv/libs/libmythtv/textsubtitleparser.cpp +++ b/mythtv/libs/libmythtv/textsubtitleparser.cpp @@ -153,7 +153,7 @@ class RemoteFileWrapper static bool operator<(const text_subtitle_t& left, const text_subtitle_t& right) { - return left.start < right.start; + return left.m_start < right.m_start; } TextSubtitles::~TextSubtitles() @@ -173,8 +173,8 @@ TextSubtitles::~TextSubtitles() */ bool TextSubtitles::HasSubtitleChanged(uint64_t timecode) const { - return (timecode < m_lastReturnedSubtitle.start || - timecode > m_lastReturnedSubtitle.end); + return (timecode < m_lastReturnedSubtitle.m_start || + timecode > m_lastReturnedSubtitle.m_end); } /** \fn TextSubtitles::GetSubtitles(uint64_t timecode) const @@ -202,15 +202,15 @@ QStringList TextSubtitles::GetSubtitles(uint64_t timecode) --currentSubPos; const text_subtitle_t &sub = *currentSubPos; - if (sub.start <= timecode && sub.end >= timecode) + if (sub.m_start <= timecode && sub.m_end >= timecode) { // found a sub to display m_lastReturnedSubtitle = sub; - return m_lastReturnedSubtitle.textLines; + return m_lastReturnedSubtitle.m_textLines; } // the subtitle time span has ended, let's display a blank sub - startCode = sub.end + 1; + startCode = sub.m_end + 1; } if (nextSubPos == m_subtitles.end()) @@ -239,7 +239,7 @@ QStringList TextSubtitles::GetSubtitles(uint64_t timecode) } else { - endCode = (*nextSubPos).start - 1; + endCode = (*nextSubPos).m_start - 1; } // we are in a position in which there are no subtitles to display, @@ -386,8 +386,8 @@ void TextSubtitleParser::LoadSubtitles(const QString &fileName, if (!target.IsFrameBasedTiming()) { - newsub.start *= 10; // convert from csec to msec - newsub.end *= 10; + newsub.m_start *= 10; // convert from csec to msec + newsub.m_end *= 10; } for (int line = 0; line < sub->lines; ++line) @@ -398,7 +398,7 @@ void TextSubtitleParser::LoadSubtitles(const QString &fileName, str = dec->toUnicode(subLine, strlen(subLine)); else str = QString(subLine); - newsub.textLines.push_back(str); + newsub.m_textLines.push_back(str); free(sub->text[line]); } diff --git a/mythtv/libs/libmythtv/textsubtitleparser.h b/mythtv/libs/libmythtv/textsubtitleparser.h index 72e86771a5b..754da92f40d 100644 --- a/mythtv/libs/libmythtv/textsubtitleparser.h +++ b/mythtv/libs/libmythtv/textsubtitleparser.h @@ -19,23 +19,23 @@ using namespace std; class text_subtitle_t { public: - text_subtitle_t(long start_, long end_) : start(start_), end(end_) {} - text_subtitle_t() : start(0), end(0) {} + text_subtitle_t(long start_, long end_) : m_start(start_), m_end(end_) {} + text_subtitle_t() = default; text_subtitle_t(const text_subtitle_t &other) : - start(other.start), end(other.end), - textLines(other.textLines) {} + m_start(other.m_start), m_end(other.m_end), + m_textLines(other.m_textLines) {} text_subtitle_t& operator= (const text_subtitle_t &rhs) { - start = rhs.start; - end = rhs.end; - textLines = rhs.textLines; + m_start = rhs.m_start; + m_end = rhs.m_end; + m_textLines = rhs.m_textLines; return *this; } public: - uint64_t start; ///< Starting time in msec or starting frame - uint64_t end; ///< Ending time in msec or ending frame - QStringList textLines; + uint64_t m_start {0}; ///< Starting time in msec or starting frame + uint64_t m_end {0}; ///< Ending time in msec or ending frame + QStringList m_textLines; }; typedef vector TextSubtitleList; @@ -43,12 +43,10 @@ typedef vector TextSubtitleList; class TextSubtitles { public: - TextSubtitles() : m_frameBasedTiming(false), m_byteCount(0), - m_isInProgress(false), m_hasSubtitles(false), - m_lock(QMutex::Recursive) + TextSubtitles() { - m_lastReturnedSubtitle.start = 0; - m_lastReturnedSubtitle.end = 0; + m_lastReturnedSubtitle.m_start = 0; + m_lastReturnedSubtitle.m_end = 0; } virtual ~TextSubtitles(); @@ -100,18 +98,18 @@ class TextSubtitles private: TextSubtitleList m_subtitles; mutable text_subtitle_t m_lastReturnedSubtitle; - bool m_frameBasedTiming; + bool m_frameBasedTiming {false}; QString m_fileName; QDateTime m_lastLoaded; - off_t m_byteCount; + off_t m_byteCount {0}; // Note: m_isInProgress is overly conservative because it doesn't // change from true to false after a recording completes. - bool m_isInProgress; + bool m_isInProgress {false}; // It's possible to have zero subtitles at the start of playback // because none have yet been written for an in-progress // recording, so use m_hasSubtitles instead of m_subtitles.size(). - bool m_hasSubtitles; - QMutex m_lock; + bool m_hasSubtitles {false}; + QMutex m_lock {QMutex::Recursive}; }; class TextSubtitleParser diff --git a/mythtv/libs/libmythtv/transporteditor.cpp b/mythtv/libs/libmythtv/transporteditor.cpp index b26d33a3794..56b21e046f7 100644 --- a/mythtv/libs/libmythtv/transporteditor.cpp +++ b/mythtv/libs/libmythtv/transporteditor.cpp @@ -183,7 +183,7 @@ void TransportListEditor::SetSourceID(uint _sourceid) } TransportListEditor::TransportListEditor(uint sourceid) : - m_videosource(new VideoSourceSelector(sourceid, QString(), false)), isLoading(false) + m_videosource(new VideoSourceSelector(sourceid, QString(), false)) { setLabel(tr("Multiplex Editor")); @@ -202,7 +202,7 @@ TransportListEditor::TransportListEditor(uint sourceid) : void TransportListEditor::SetSourceID(const QString& sourceid) { - if (isLoading) + if (m_isLoading) return; SetSourceID(sourceid.toUInt()); Load(); @@ -210,9 +210,9 @@ void TransportListEditor::SetSourceID(const QString& sourceid) void TransportListEditor::Load() { - if (isLoading) + if (m_isLoading) return; - isLoading = true; + m_isLoading = true; if (m_sourceid) { MSqlQuery query(MSqlQuery::InitCon()); @@ -229,7 +229,7 @@ void TransportListEditor::Load() if (!query.exec() || !query.isActive()) { MythDB::DBError("TransportList::fillSelections", query); - isLoading = false; + m_isLoading = false; return; } @@ -281,7 +281,7 @@ void TransportListEditor::Load() } GroupSetting::Load(); - isLoading = false; + m_isLoading = false; } void TransportListEditor::NewTransport() @@ -297,7 +297,7 @@ void TransportListEditor::NewTransport() void TransportListEditor::Delete(TransportSetting *transport) { - if (isLoading) + if (m_isLoading) return; ShowOkPopup( @@ -340,7 +340,7 @@ void TransportListEditor::Delete(TransportSetting *transport) void TransportListEditor::Menu(TransportSetting *transport) { - if (isLoading) + if (m_isLoading) return; MythMenu *menu = new MythMenu(tr("Transport Menu"), this, "transportmenu"); diff --git a/mythtv/libs/libmythtv/transporteditor.h b/mythtv/libs/libmythtv/transporteditor.h index d537b82932c..daa812f3c9b 100644 --- a/mythtv/libs/libmythtv/transporteditor.h +++ b/mythtv/libs/libmythtv/transporteditor.h @@ -60,7 +60,7 @@ class TransportSetting : public GroupSetting void openMenu(); private: - MultiplexID *m_mplexid; + MultiplexID *m_mplexid {nullptr}; }; // Page for selecting a transport to be created/edited @@ -84,11 +84,11 @@ class MTV_PUBLIC TransportListEditor : public GroupSetting void Delete(TransportSetting *transport); private: - VideoSourceSelector *m_videosource; + VideoSourceSelector *m_videosource {nullptr}; QVector m_list; uint m_sourceid; uint m_cardtype; - bool isLoading; + bool m_isLoading {false}; }; #endif // _TRANSPORT_EDITOR_H_ diff --git a/mythtv/libs/libmythtv/tvbrowsehelper.h b/mythtv/libs/libmythtv/tvbrowsehelper.h index e3a5047158d..4166052348e 100644 --- a/mythtv/libs/libmythtv/tvbrowsehelper.h +++ b/mythtv/libs/libmythtv/tvbrowsehelper.h @@ -29,14 +29,13 @@ class BrowseInfo uint chanid, const QString &starttime) : m_dir(dir), m_channum(channum), - m_chanid(chanid), m_starttime(starttime), - m_sourceid(0) + m_chanid(chanid), m_starttime(starttime) { } BrowseInfo(const QString &channum, uint sourceid) : - m_dir(BROWSE_SAME), m_channum(channum), - m_chanid(0), m_sourceid(sourceid) + m_channum(channum), + m_sourceid(sourceid) { } @@ -53,11 +52,11 @@ class BrowseInfo .arg(m_sourceid); } - BrowseDirection m_dir; + BrowseDirection m_dir {BROWSE_SAME}; QString m_channum; - uint m_chanid; + uint m_chanid {0}; QString m_starttime; - uint m_sourceid; + uint m_sourceid {0}; }; diff --git a/mythtv/libs/libmythtv/v4l2util.cpp b/mythtv/libs/libmythtv/v4l2util.cpp index 145ed6c37a4..f868e49dfe2 100644 --- a/mythtv/libs/libmythtv/v4l2util.cpp +++ b/mythtv/libs/libmythtv/v4l2util.cpp @@ -10,31 +10,15 @@ #include #define v4l2_ioctl(_FD_, _REQUEST_, _DATA_) ioctl(_FD_, _REQUEST_, _DATA_) -#define LOC QString("V4L2(%1): ").arg(m_device_name) - -V4L2util::V4L2util(void) - : m_fd(-1), - m_vbi_fd(-1), - m_version(0), - m_capabilities(0), - m_have_query_ext_ctrl(false) -{ -} +#define LOC QString("V4L2(%1): ").arg(m_deviceName) V4L2util::V4L2util(const QString& dev_name) - : m_fd(-1), - m_vbi_fd(-1), - m_capabilities(0), - m_have_query_ext_ctrl(false) { Open(dev_name); } V4L2util::V4L2util(const QString& dev_name, const QString& vbi_dev_name) - : m_fd(0), - m_vbi_fd(-1), - m_capabilities(0), - m_have_query_ext_ctrl(false) + : m_fd(0) { Open(dev_name, vbi_dev_name); } @@ -46,7 +30,7 @@ V4L2util::~V4L2util(void) bool V4L2util::Open(const QString& dev_name, const QString& vbi_dev_name) { - if (m_fd >= 0 && dev_name == m_device_name) + if (m_fd >= 0 && dev_name == m_deviceName) return true; Close(); @@ -58,15 +42,15 @@ bool V4L2util::Open(const QString& dev_name, const QString& vbi_dev_name) QString("Could not open '%1': ").arg(dev_name) + ENO); return false; } - m_device_name = dev_name; + m_deviceName = dev_name; struct v4l2_query_ext_ctrl qc; memset(&qc, 0, sizeof(v4l2_query_ext_ctrl)); qc.id = V4L2_CTRL_FLAG_NEXT_CTRL | V4L2_CTRL_FLAG_NEXT_COMPOUND; - m_have_query_ext_ctrl = (v4l2_ioctl(m_fd, VIDIOC_QUERY_EXT_CTRL, &qc) == 0); + m_haveQueryExtCtrl = (v4l2_ioctl(m_fd, VIDIOC_QUERY_EXT_CTRL, &qc) == 0); - m_card_name.clear(); - m_driver_name.clear(); + m_cardName.clear(); + m_driverName.clear(); m_version = 0; m_capabilities = 0; @@ -74,8 +58,8 @@ bool V4L2util::Open(const QString& dev_name, const QString& vbi_dev_name) memset(&capability, 0, sizeof(v4l2_capability)); if (ioctl(m_fd, VIDIOC_QUERYCAP, &capability) >= 0) { - m_card_name = QString::fromLatin1((const char*)capability.card); - m_driver_name = QString::fromLatin1((const char*)capability.driver); + m_cardName = QString::fromLatin1((const char*)capability.card); + m_driverName = QString::fromLatin1((const char*)capability.driver); m_version = capability.version; m_capabilities = capability.capabilities; } @@ -85,8 +69,8 @@ bool V4L2util::Open(const QString& dev_name, const QString& vbi_dev_name) return false; } - if (!m_driver_name.isEmpty()) - m_driver_name.remove( QRegExp("\\[[0-9]\\]$") ); + if (!m_driverName.isEmpty()) + m_driverName.remove( QRegExp("\\[[0-9]\\]$") ); OpenVBI(vbi_dev_name); @@ -723,7 +707,7 @@ bool V4L2util::UserAdjustableResolution(void) const // I have not been able to come up with a way of querying the // driver to answer this question. - if (m_driver_name == "hdpvr") + if (m_driverName == "hdpvr") return false; return true; } @@ -1250,7 +1234,7 @@ bool V4L2util::SetSlicedVBI(const VBIMode::vbimode_t& vbimode) vbifmt.fmt.sliced.service_set |= (VBIMode::PAL_TT == vbimode) ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525; - int fd = m_vbi_fd < 0 ? m_fd : m_vbi_fd; + int fd = m_vbiFd < 0 ? m_fd : m_vbiFd; if (ioctl(fd, VIDIOC_S_FMT, &vbifmt) < 0) { diff --git a/mythtv/libs/libmythtv/v4l2util.h b/mythtv/libs/libmythtv/v4l2util.h index 5a05bb489fd..2078d81b032 100644 --- a/mythtv/libs/libmythtv/v4l2util.h +++ b/mythtv/libs/libmythtv/v4l2util.h @@ -16,7 +16,7 @@ struct DriverOption; class MTV_PUBLIC V4L2util { public: - V4L2util(void); + V4L2util(void) = default; explicit V4L2util(const QString& dev_name); V4L2util(const QString& dev_name, const QString& vbi_dev_name); ~V4L2util(void); @@ -42,9 +42,9 @@ class MTV_PUBLIC V4L2util bool IsEncoder(void) const; bool UserAdjustableResolution(void) const; - QString DriverName(void) const { return m_driver_name; } - QString CardName(void) const { return m_card_name; } - QString ProfileName(void) const { return "V4L2:" + m_driver_name; } + QString DriverName(void) const { return m_driverName; } + QString CardName(void) const { return m_cardName; } + QString ProfileName(void) const { return "V4L2:" + m_driverName; } int GetStreamType(void) const; bool SetStreamType(int value); @@ -93,15 +93,15 @@ class MTV_PUBLIC V4L2util void log_controls(bool show_menus); private: - int m_fd; - int m_vbi_fd; + int m_fd {-1}; + int m_vbiFd {-1}; DriverOption::Options m_options; - QString m_device_name; - QString m_driver_name; - QString m_card_name; - int m_version; - uint32_t m_capabilities; - bool m_have_query_ext_ctrl; + QString m_deviceName; + QString m_driverName; + QString m_cardName; + int m_version {0}; + uint32_t m_capabilities {0}; + bool m_haveQueryExtCtrl {false}; }; #endif diff --git a/mythtv/libs/libmythtv/vbi608extractor.cpp b/mythtv/libs/libmythtv/vbi608extractor.cpp index 2206662bb10..03d7f0e7bc6 100644 --- a/mythtv/libs/libmythtv/vbi608extractor.cpp +++ b/mythtv/libs/libmythtv/vbi608extractor.cpp @@ -79,18 +79,18 @@ static float find_clock_diff(const QList &list) return avg_diff; } -VBI608Extractor::VBI608Extractor() : start(0.0f), rate(0.0f) +VBI608Extractor::VBI608Extractor() { - code[0] = UINT16_MAX; - code[1] = UINT16_MAX; + m_code[0] = UINT16_MAX; + m_code[1] = UINT16_MAX; } bool VBI608Extractor::FindClocks(const unsigned char *buf, uint width) { - raw_minimas.clear(); - raw_maximas.clear(); - maximas.clear(); - minimas.clear(); + m_rawMinimas.clear(); + m_rawMaximas.clear(); + m_maximas.clear(); + m_minimas.clear(); // find our threshold uint minv = 255; @@ -113,149 +113,149 @@ bool VBI608Extractor::FindClocks(const unsigned char *buf, uint width) for (uint i = 0; i < (width/3); i++) { if (buf[i] > avgv+10) - raw_maximas.push_back(last_max=i); + m_rawMaximas.push_back(last_max=i); else if (last_max>=0 && (i - last_max) <= noise_flr_sm) - raw_maximas.push_back(i); + m_rawMaximas.push_back(i); else if (buf[i] < avgv-10) - raw_minimas.push_back(last_min=i); + m_rawMinimas.push_back(last_min=i); else if (last_min>=0 && (i - last_min) <= noise_flr_lg) - raw_minimas.push_back(i); + m_rawMinimas.push_back(i); } - for (uint i = 0; i < uint(raw_maximas.size()); i++) + for (uint i = 0; i < uint(m_rawMaximas.size()); i++) { - uint start_idx = raw_maximas[i]; - while ((i+1) < uint(raw_maximas.size()) && - (raw_maximas[i+1] == raw_maximas[i] + 1)) i++; - uint end_idx = raw_maximas[i]; + uint start_idx = m_rawMaximas[i]; + while ((i+1) < uint(m_rawMaximas.size()) && + (m_rawMaximas[i+1] == m_rawMaximas[i] + 1)) i++; + uint end_idx = m_rawMaximas[i]; if (end_idx - start_idx > noise_flr_lg) - maximas.push_back((start_idx + end_idx) * 0.5f); + m_maximas.push_back((start_idx + end_idx) * 0.5f); } - if (maximas.size() < 7) + if (m_maximas.size() < 7) { LOG(VB_VBI, LOG_DEBUG, LOC + - QString("FindClocks: maximas %1 < 7").arg(maximas.size())); - print(raw_minimas, raw_maximas, minimas, maximas); + QString("FindClocks: maximas %1 < 7").arg(m_maximas.size())); + print(m_rawMinimas, m_rawMaximas, m_minimas, m_maximas); return false; } // drop outliers on edges bool dropped = true; - while (maximas.size() > 7 && dropped) + while (m_maximas.size() > 7 && dropped) { float min_diff = width * 8; float max_diff = 0.0f; float avg_diff = 0.0f; - for (uint i = 1; i < uint(maximas.size()); i++) + for (uint i = 1; i < uint(m_maximas.size()); i++) { - float diff = maximas[i] - maximas[i-1]; + float diff = m_maximas[i] - m_maximas[i-1]; min_diff = min(diff, min_diff); max_diff = max(diff, max_diff); avg_diff += diff; } avg_diff -= min_diff; avg_diff -= max_diff; - avg_diff /= (maximas.size() - 3); + avg_diff /= (m_maximas.size() - 3); dropped = false; if (avg_diff * 1.1f < max_diff) { - float last_diff = maximas.back() - - maximas[(uint)(maximas.size())-2]; + float last_diff = m_maximas.back() - + m_maximas[(uint)(m_maximas.size())-2]; if (last_diff*1.01f >= max_diff || last_diff > avg_diff * 1.2f) { - maximas.pop_back(); + m_maximas.pop_back(); dropped = true; } - float first_diff = maximas[1] - maximas[0]; - if ((maximas.size() > 7) && (first_diff*1.01f >= max_diff)) + float first_diff = m_maximas[1] - m_maximas[0]; + if ((m_maximas.size() > 7) && (first_diff*1.01f >= max_diff)) { - maximas.pop_front(); + m_maximas.pop_front(); dropped = true; } } if (avg_diff * 0.9f > min_diff) { - float last_diff = maximas.back() - - maximas[(uint)(maximas.size())-2]; - if ((maximas.size() > 7) && + float last_diff = m_maximas.back() - + m_maximas[(uint)(m_maximas.size())-2]; + if ((m_maximas.size() > 7) && (last_diff*0.99f <= min_diff || last_diff < avg_diff * 0.80f)) { - maximas.pop_back(); + m_maximas.pop_back(); dropped = true; } - float first_diff = maximas[1] - maximas[0]; - if ((maximas.size() > 7) && (first_diff*0.99f <= min_diff)) + float first_diff = m_maximas[1] - m_maximas[0]; + if ((m_maximas.size() > 7) && (first_diff*0.99f <= min_diff)) { - maximas.pop_front(); + m_maximas.pop_front(); dropped = true; } } } - if (maximas.size() != 7) + if (m_maximas.size() != 7) { LOG(VB_VBI, LOG_DEBUG, LOC + QString("FindClocks: maximas: %1 != 7") - .arg(maximas.size())); - print(raw_minimas, raw_maximas, minimas, maximas); + .arg(m_maximas.size())); + print(m_rawMinimas, m_rawMaximas, m_minimas, m_maximas); return false; } // find the minimas - for (uint i = 0; i < uint(raw_minimas.size()); i++) + for (uint i = 0; i < uint(m_rawMinimas.size()); i++) { - uint start_idx = raw_minimas[i]; - while ((i+1) < uint(raw_minimas.size()) && - (raw_minimas[i+1] == raw_minimas[i] + 1)) i++; - uint end_idx = raw_minimas[i]; + uint start_idx = m_rawMinimas[i]; + while ((i+1) < uint(m_rawMinimas.size()) && + (m_rawMinimas[i+1] == m_rawMinimas[i] + 1)) i++; + uint end_idx = m_rawMinimas[i]; float center = (start_idx + end_idx) * 0.5f; if (end_idx - start_idx > noise_flr_lg && - center > maximas[0] && center < maximas.back()) + center > m_maximas[0] && center < m_maximas.back()) { - minimas.push_back(center); + m_minimas.push_back(center); } } - if (minimas.size() != 6) + if (m_minimas.size() != 6) { LOG(VB_VBI, LOG_DEBUG, LOC + QString("FindClocks: minimas: %1 != 6") - .arg(minimas.size())); - print(raw_minimas, raw_maximas, minimas, maximas); + .arg(m_minimas.size())); + print(m_rawMinimas, m_rawMaximas, m_minimas, m_maximas); return false; } // get the average clock rate in samples - float maxima_avg_diff = find_clock_diff(maximas); - float minima_avg_diff = find_clock_diff(minimas); - rate = (maxima_avg_diff * 7 + minima_avg_diff * 6) / 13.0f; + float maxima_avg_diff = find_clock_diff(m_maximas); + float minima_avg_diff = find_clock_diff(m_minimas); + m_rate = (maxima_avg_diff * 7 + minima_avg_diff * 6) / 13.0f; if (maxima_avg_diff == 0.0f || minima_avg_diff == 0.0f) return false; // get the estimated location of the first maxima // based on the rate and location of all maximas - start = maximas[0]; - for (uint i = 1; i < uint(maximas.size()); i++) - start += maximas[i] - i * rate; - start /= maximas.size(); + m_start = m_maximas[0]; + for (uint i = 1; i < uint(m_maximas.size()); i++) + m_start += m_maximas[i] - i * m_rate; + m_start /= m_maximas.size(); // then move it back by a third to make each sample // more or less in the center of each encoded byte. - start -= rate * 0.33f; + m_start -= m_rate * 0.33f; // if the last bit is after the last sample... // 7 clocks + 3 bits run in + 16 bits data - if (start+((7+3+8+8-1) * rate) > width) + if (m_start+((7+3+8+8-1) * m_rate) > width) { LOG(VB_VBI, LOG_DEBUG, LOC + QString("FindClocks: end %1 > width %2") - .arg(start+((7+3+8+8-1) * rate)).arg(width)); + .arg(m_start+((7+3+8+8-1) * m_rate)).arg(width)); return false; } #if 0 LOG(VB_VBI, LOG_DEBUG, LOC + QString("FindClocks: Clock start %1, rate %2") - .arg(start).arg(rate)); + .arg(m_start).arg(m_rate)); #endif return true; @@ -266,8 +266,8 @@ bool VBI608Extractor::ExtractCC(const VideoFrame *picframe, uint max_lines) int ypitch = picframe->pitches[0]; int ywidth = picframe->width; - code[0] = UINT16_MAX; - code[1] = UINT16_MAX; + m_code[0] = UINT16_MAX; + m_code[1] = UINT16_MAX; // find CC uint found_cnt = 0; @@ -278,23 +278,23 @@ bool VBI608Extractor::ExtractCC(const VideoFrame *picframe, uint max_lines) if (FindClocks(y, ywidth)) { uint maxv = 0; - for (uint j = 0; j < start + 8 * rate; j++) + for (uint j = 0; j < m_start + 8 * m_rate; j++) maxv = max(uint((y+(i * ypitch))[j]), maxv); uint avgv = maxv / 2; - if (y[uint(start + (0+7) * rate)] > avgv || - y[uint(start + (1+7) * rate)] > avgv || - y[uint(start + (2+7) * rate)] < avgv) + if (y[uint(m_start + (0+7) * m_rate)] > avgv || + y[uint(m_start + (1+7) * m_rate)] > avgv || + y[uint(m_start + (2+7) * m_rate)] < avgv) { continue; // need 001 at run in.. } - code[found_cnt] = 0; + m_code[found_cnt] = 0; for (uint j = 0; j < 8+8; j++) { - bool bit = y[uint(start + (j+7+3) * rate)] > avgv; - code[found_cnt] = - (code[found_cnt]>>1) | (bit?(1<<15):0); + bool bit = y[uint(m_start + (j+7+3) * m_rate)] > avgv; + m_code[found_cnt] = + (m_code[found_cnt]>>1) | (bit?(1<<15):0); } found_cnt++; @@ -312,9 +312,9 @@ bool VBI608Extractor::ExtractCC(const VideoFrame *picframe, uint max_lines) v[uwidth / 3] = 0x40; for (uint j = 0; j < 7+3+8+8; j++) { - uint yloc = uint (start + j * rate + 0.5); + uint yloc = uint (m_start + j * m_rate + 0.5); Y[yloc] = 0xFF; - uint uloc = uint (uwidth * (start + j * rate + 0.5) / ywidth); + uint uloc = uint (uwidth * (m_start + j * m_rate + 0.5) / ywidth); u[uloc] = 0x40; } #endif @@ -326,27 +326,27 @@ bool VBI608Extractor::ExtractCC(const VideoFrame *picframe, uint max_lines) bool VBI608Extractor::ExtractCC12(const unsigned char *buf, uint width) { - code[0] = UINT16_MAX; + m_code[0] = UINT16_MAX; if (FindClocks(buf, width)) { uint maxv = 0; - for (uint j = 0; j < start + 8 * rate; j++) + for (uint j = 0; j < m_start + 8 * m_rate; j++) maxv = max(uint(buf[j]), maxv); uint avgv = maxv / 2; - if (buf[uint(start + (0+7) * rate)] > avgv || - buf[uint(start + (1+7) * rate)] > avgv || - buf[uint(start + (2+7) * rate)] < avgv) + if (buf[uint(m_start + (0+7) * m_rate)] > avgv || + buf[uint(m_start + (1+7) * m_rate)] > avgv || + buf[uint(m_start + (2+7) * m_rate)] < avgv) { LOG(VB_VBI, LOG_DEBUG, LOC + "did not find VBI 608 header"); return false; } - code[0] = 0; + m_code[0] = 0; for (uint j = 0; j < 8+8; j++) { - bool bit = buf[uint(start + (j+7+3) * rate)] > avgv; - code[0] = (code[0]>>1) | (bit?(1<<15):0); + bool bit = buf[uint(m_start + (j+7+3) * m_rate)] > avgv; + m_code[0] = (m_code[0]>>1) | (bit?(1<<15):0); } return true; @@ -356,26 +356,26 @@ bool VBI608Extractor::ExtractCC12(const unsigned char *buf, uint width) bool VBI608Extractor::ExtractCC34(const unsigned char *buf, uint width) { - code[1] = UINT16_MAX; + m_code[1] = UINT16_MAX; if (FindClocks(buf, width)) { uint maxv = 0; - for (uint j = 0; j < start + 8 * rate; j++) + for (uint j = 0; j < m_start + 8 * m_rate; j++) maxv = max(uint(buf[j]), maxv); uint avgv = maxv / 2; - if (buf[uint(start + (0+7) * rate)] > avgv || - buf[uint(start + (1+7) * rate)] > avgv || - buf[uint(start + (2+7) * rate)] < avgv) + if (buf[uint(m_start + (0+7) * m_rate)] > avgv || + buf[uint(m_start + (1+7) * m_rate)] > avgv || + buf[uint(m_start + (2+7) * m_rate)] < avgv) { return false; } - code[1] = 0; + m_code[1] = 0; for (uint j = 0; j < 8+8; j++) { - bool bit = buf[uint(start + (j+7+3) * rate)] > avgv; - code[1] = (code[1]>>1) | (bit?(1<<15):0); + bool bit = buf[uint(m_start + (j+7+3) * m_rate)] > avgv; + m_code[1] = (m_code[1]>>1) | (bit?(1<<15):0); } return true; } @@ -385,19 +385,19 @@ bool VBI608Extractor::ExtractCC34(const unsigned char *buf, uint width) uint VBI608Extractor::FillCCData(uint8_t cc_data[8]) const { uint cc_count = 0; - if (code[0] != UINT16_MAX) + if (m_code[0] != UINT16_MAX) { cc_data[2] = 0x04; - cc_data[3] = (code[0]) & 0xff; - cc_data[4] = (code[0]>>8) & 0xff; + cc_data[3] = (m_code[0]) & 0xff; + cc_data[4] = (m_code[0]>>8) & 0xff; cc_count++; } - if (code[1] != UINT16_MAX) + if (m_code[1] != UINT16_MAX) { cc_data[2+3*cc_count] = 0x04|0x01; - cc_data[3+3*cc_count] = (code[1]) & 0xff; - cc_data[4+3*cc_count] = (code[1]>>8) & 0xff; + cc_data[3+3*cc_count] = (m_code[1]) & 0xff; + cc_data[4+3*cc_count] = (m_code[1]>>8) & 0xff; cc_count++; } diff --git a/mythtv/libs/libmythtv/vbi608extractor.h b/mythtv/libs/libmythtv/vbi608extractor.h index c8403ccf618..ea9166ffb32 100644 --- a/mythtv/libs/libmythtv/vbi608extractor.h +++ b/mythtv/libs/libmythtv/vbi608extractor.h @@ -31,8 +31,8 @@ class VBI608Extractor public: VBI608Extractor(); - uint16_t GetCode1(void) const { return code[0]; } - uint16_t GetCode2(void) const { return code[1]; } + uint16_t GetCode1(void) const { return m_code[0]; } + uint16_t GetCode2(void) const { return m_code[1]; } bool ExtractCC(const VideoFrame*, uint max_lines = 4); bool ExtractCC12(const unsigned char *buf, uint width); @@ -41,17 +41,17 @@ class VBI608Extractor uint FillCCData(uint8_t cc_data[8]) const; private: - float GetClockStart(void) const { return start; } - float GetClockRate(void) const { return rate; } + float GetClockStart(void) const { return m_start; } + float GetClockRate(void) const { return m_rate; } bool FindClocks(const unsigned char *buf, uint width); - QList raw_minimas; - QList raw_maximas; - QList maximas; - QList minimas; - float start; - float rate; - uint16_t code[2]; + QList m_rawMinimas; + QList m_rawMaximas; + QList m_maximas; + QList m_minimas; + float m_start {0.0f}; + float m_rate {0.0f}; + uint16_t m_code[2]; }; #endif // _VBI_608_EXTRACTOR_H_ diff --git a/mythtv/libs/libmythtv/videobuffers.cpp b/mythtv/libs/libmythtv/videobuffers.cpp index d54340bc1d8..83fc3d1522d 100644 --- a/mythtv/libs/libmythtv/videobuffers.cpp +++ b/mythtv/libs/libmythtv/videobuffers.cpp @@ -23,7 +23,7 @@ int next_dbg_str = 0; YUVInfo::YUVInfo(uint w, uint h, uint sz, const int *p, const int *o, int aligned) - : width(w), height(h), size(sz) + : m_width(w), m_height(h), m_size(sz) { // make sure all our pitches are a multiple of "aligned" bytes // Needs to take into consideration that U and V channels are half @@ -32,32 +32,32 @@ YUVInfo::YUVInfo(uint w, uint h, uint sz, const int *p, const int *o, if (!aligned) { - width_aligned = width; + width_aligned = m_width; } else { - width_aligned = (width + aligned - 1) & ~(aligned - 1); + width_aligned = (m_width + aligned - 1) & ~(aligned - 1); } if (p) { - memcpy(pitches, p, 3 * sizeof(int)); + memcpy(m_pitches, p, 3 * sizeof(int)); } else { - pitches[0] = width_aligned; - pitches[1] = pitches[2] = (width_aligned+1) >> 1; + m_pitches[0] = width_aligned; + m_pitches[1] = m_pitches[2] = (width_aligned+1) >> 1; } if (o) { - memcpy(offsets, o, 3 * sizeof(int)); + memcpy(m_offsets, o, 3 * sizeof(int)); } else { - offsets[0] = 0; - offsets[1] = width_aligned * height; - offsets[2] = offsets[1] + ((width_aligned+1) >> 1) * ((height+1) >> 1); + m_offsets[0] = 0; + m_offsets[1] = width_aligned * m_height; + m_offsets[2] = m_offsets[1] + ((width_aligned+1) >> 1) * ((m_height+1) >> 1); } } @@ -134,14 +134,6 @@ YUVInfo::YUVInfo(uint w, uint h, uint sz, const int *p, const int *o, * \see VideoOutput */ -VideoBuffers::VideoBuffers() - : needfreeframes(0), needprebufferframes(0), - needprebufferframes_normal(0), needprebufferframes_small(0), - keepprebufferframes(0), createdpauseframe(false), rpos(0), vpos(0), - global_lock(QMutex::Recursive) -{ -} - VideoBuffers::~VideoBuffers() { DeleteBuffers(); @@ -172,7 +164,7 @@ void VideoBuffers::Init(uint numdecode, bool extra_for_pause, uint need_free, uint needprebuffer_normal, uint needprebuffer_small, uint keepprebuffer) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); Reset(); @@ -180,26 +172,26 @@ void VideoBuffers::Init(uint numdecode, bool extra_for_pause, // make a big reservation, so that things that depend on // pointer to VideoFrames work even after a few push_backs - buffers.reserve(max(numcreate, (uint)128)); + m_buffers.reserve(max(numcreate, (uint)128)); - buffers.resize(numcreate); + m_buffers.resize(numcreate); for (uint i = 0; i < numcreate; i++) { memset(At(i), 0, sizeof(VideoFrame)); At(i)->codec = FMT_NONE; At(i)->interlaced_frame = -1; At(i)->top_field_first = +1; - vbufferMap[At(i)] = i; + m_vbufferMap[At(i)] = i; } - needfreeframes = need_free; - needprebufferframes = needprebuffer_normal; - needprebufferframes_normal = needprebuffer_normal; - needprebufferframes_small = needprebuffer_small; - keepprebufferframes = keepprebuffer; - createdpauseframe = extra_for_pause; + m_needFreeFrames = need_free; + m_needPrebufferFrames = needprebuffer_normal; + m_needPrebufferFramesNormal = needprebuffer_normal; + m_needPrebufferFramesSmall = needprebuffer_small; + m_keepPrebufferFrames = keepprebuffer; + m_createdPauseFrame = extra_for_pause; - if (createdpauseframe) + if (m_createdPauseFrame) Enqueue(kVideoBuffer_pause, At(numcreate - 1)); for (uint i = 0; i < numdecode; i++) @@ -212,24 +204,24 @@ void VideoBuffers::Init(uint numdecode, bool extra_for_pause, */ void VideoBuffers::Reset() { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); // Delete ffmpeg VideoFrames so we can create // a different number of buffers below - frame_vector_t::iterator it = buffers.begin(); - for (;it != buffers.end(); ++it) + frame_vector_t::iterator it = m_buffers.begin(); + for (;it != m_buffers.end(); ++it) { av_freep(&it->qscale_table); } - available.clear(); - used.clear(); - limbo.clear(); - finished.clear(); - decode.clear(); - pause.clear(); - displayed.clear(); - vbufferMap.clear(); + m_available.clear(); + m_used.clear(); + m_limbo.clear(); + m_finished.clear(); + m_decode.clear(); + m_pause.clear(); + m_displayed.clear(); + m_vbufferMap.clear(); } /** @@ -238,32 +230,32 @@ void VideoBuffers::Reset() */ void VideoBuffers::SetPrebuffering(bool normal) { - QMutexLocker locker(&global_lock); - needprebufferframes = (normal) ? - needprebufferframes_normal : needprebufferframes_small; + QMutexLocker locker(&m_globalLock); + m_needPrebufferFrames = (normal) ? + m_needPrebufferFramesNormal : m_needPrebufferFramesSmall; } VideoFrame *VideoBuffers::GetNextFreeFrameInternal(BufferType enqueue_to) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); VideoFrame *frame = nullptr; // Try to get a frame not being used by the decoder - for (uint i = 0; i < available.size(); i++) + for (uint i = 0; i < m_available.size(); i++) { - frame = available.dequeue(); - if (decode.contains(frame)) - available.enqueue(frame); + frame = m_available.dequeue(); + if (m_decode.contains(frame)) + m_available.enqueue(frame); else break; } - while (frame && used.contains(frame)) + while (frame && m_used.contains(frame)) { LOG(VB_PLAYBACK, LOG_NOTICE, QString("GetNextFreeFrame() served a busy frame %1. Dropping. %2") .arg(DebugString(frame, true)).arg(GetStatus())); - frame = available.dequeue(); + frame = m_available.dequeue(); } if (frame) @@ -291,7 +283,9 @@ VideoFrame *VideoBuffers::GetNextFreeFrame(BufferType enqueue_to) { LOG(VB_GENERAL, LOG_ERR, QString("GetNextFreeFrame: " "available:%1 used:%2 limbo:%3 pause:%4 displayed:%5 decode:%6 finished:%7") - .arg(available.size()).arg(used.size()).arg(limbo.size()).arg(pause.size()).arg(displayed.size()).arg(decode.size()).arg(finished.size())); + .arg(m_available.size()).arg(m_used.size()).arg(m_limbo.size()) + .arg(m_pause.size()).arg(m_displayed.size()).arg(m_decode.size()) + .arg(m_finished.size())); LOG(VB_GENERAL, LOG_ERR, QString("GetNextFreeFrame() unable to " "lock frame %1 times. Discarding Frames.") @@ -320,14 +314,14 @@ VideoFrame *VideoBuffers::GetNextFreeFrame(BufferType enqueue_to) */ void VideoBuffers::ReleaseFrame(VideoFrame *frame) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); - vpos = vbufferMap[frame]; - limbo.remove(frame); + m_vpos = m_vbufferMap[frame]; + m_limbo.remove(frame); //non directrendering frames are ffmpeg handled if (frame->directrendering != 0) - decode.enqueue(frame); - used.enqueue(frame); + m_decode.enqueue(frame); + m_used.enqueue(frame); } /** @@ -337,18 +331,18 @@ void VideoBuffers::ReleaseFrame(VideoFrame *frame) */ void VideoBuffers::DeLimboFrame(VideoFrame *frame) { - QMutexLocker locker(&global_lock); - if (limbo.contains(frame)) - limbo.remove(frame); + QMutexLocker locker(&m_globalLock); + if (m_limbo.contains(frame)) + m_limbo.remove(frame); // if decoder didn't release frame and the buffer is getting released by // the decoder assume that the frame is lost and return to available - if (!decode.contains(frame)) + if (!m_decode.contains(frame)) SafeEnqueue(kVideoBuffer_avail, frame); // remove from decode queue since the decoder is finished - while (decode.contains(frame)) - decode.remove(frame); + while (m_decode.contains(frame)) + m_decode.remove(frame); } /** @@ -357,8 +351,8 @@ void VideoBuffers::DeLimboFrame(VideoFrame *frame) */ void VideoBuffers::StartDisplayingFrame(void) { - QMutexLocker locker(&global_lock); - rpos = vbufferMap[used.head()]; + QMutexLocker locker(&m_globalLock); + m_rpos = m_vbufferMap[m_used.head()]; } /** @@ -367,19 +361,19 @@ void VideoBuffers::StartDisplayingFrame(void) */ void VideoBuffers::DoneDisplayingFrame(VideoFrame *frame) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); - if(used.contains(frame)) + if(m_used.contains(frame)) Remove(kVideoBuffer_used, frame); Enqueue(kVideoBuffer_finished, frame); // check if any finished frames are no longer used by decoder and return to available - frame_queue_t ula(finished); + frame_queue_t ula(m_finished); frame_queue_t::iterator it = ula.begin(); for (; it != ula.end(); ++it) { - if (!decode.contains(*it)) + if (!m_decode.contains(*it)) { Remove(kVideoBuffer_finished, *it); Enqueue(kVideoBuffer_avail, *it); @@ -394,61 +388,61 @@ void VideoBuffers::DoneDisplayingFrame(VideoFrame *frame) */ void VideoBuffers::DiscardFrame(VideoFrame *frame) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); SafeEnqueue(kVideoBuffer_avail, frame); } frame_queue_t *VideoBuffers::Queue(BufferType type) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); frame_queue_t *q = nullptr; if (type == kVideoBuffer_avail) - q = &available; + q = &m_available; else if (type == kVideoBuffer_used) - q = &used; + q = &m_used; else if (type == kVideoBuffer_displayed) - q = &displayed; + q = &m_displayed; else if (type == kVideoBuffer_limbo) - q = &limbo; + q = &m_limbo; else if (type == kVideoBuffer_pause) - q = &pause; + q = &m_pause; else if (type == kVideoBuffer_decode) - q = &decode; + q = &m_decode; else if (type == kVideoBuffer_finished) - q = &finished; + q = &m_finished; return q; } const frame_queue_t *VideoBuffers::Queue(BufferType type) const { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); const frame_queue_t *q = nullptr; if (type == kVideoBuffer_avail) - q = &available; + q = &m_available; else if (type == kVideoBuffer_used) - q = &used; + q = &m_used; else if (type == kVideoBuffer_displayed) - q = &displayed; + q = &m_displayed; else if (type == kVideoBuffer_limbo) - q = &limbo; + q = &m_limbo; else if (type == kVideoBuffer_pause) - q = &pause; + q = &m_pause; else if (type == kVideoBuffer_decode) - q = &decode; + q = &m_decode; else if (type == kVideoBuffer_finished) - q = &finished; + q = &m_finished; return q; } VideoFrame *VideoBuffers::Dequeue(BufferType type) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); frame_queue_t *q = Queue(type); @@ -460,7 +454,7 @@ VideoFrame *VideoBuffers::Dequeue(BufferType type) VideoFrame *VideoBuffers::Head(BufferType type) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); frame_queue_t *q = Queue(type); @@ -475,7 +469,7 @@ VideoFrame *VideoBuffers::Head(BufferType type) VideoFrame *VideoBuffers::Tail(BufferType type) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); frame_queue_t *q = Queue(type); @@ -497,10 +491,10 @@ void VideoBuffers::Enqueue(BufferType type, VideoFrame *frame) if (!q) return; - global_lock.lock(); + m_globalLock.lock(); q->remove(frame); q->enqueue(frame); - global_lock.unlock(); + m_globalLock.unlock(); return; } @@ -510,27 +504,27 @@ void VideoBuffers::Remove(BufferType type, VideoFrame *frame) if (!frame) return; - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); if ((type & kVideoBuffer_avail) == kVideoBuffer_avail) - available.remove(frame); + m_available.remove(frame); if ((type & kVideoBuffer_used) == kVideoBuffer_used) - used.remove(frame); + m_used.remove(frame); if ((type & kVideoBuffer_displayed) == kVideoBuffer_displayed) - displayed.remove(frame); + m_displayed.remove(frame); if ((type & kVideoBuffer_limbo) == kVideoBuffer_limbo) - limbo.remove(frame); + m_limbo.remove(frame); if ((type & kVideoBuffer_pause) == kVideoBuffer_pause) - pause.remove(frame); + m_pause.remove(frame); if ((type & kVideoBuffer_decode) == kVideoBuffer_decode) - decode.remove(frame); + m_decode.remove(frame); if ((type & kVideoBuffer_finished) == kVideoBuffer_finished) - finished.remove(frame); + m_finished.remove(frame); } void VideoBuffers::Requeue(BufferType dst, BufferType src, int num) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); num = (num <= 0) ? Size(src) : num; for (uint i=0; i<(uint)num; i++) @@ -546,7 +540,7 @@ void VideoBuffers::SafeEnqueue(BufferType dst, VideoFrame* frame) if (!frame) return; - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); Remove(kVideoBuffer_all, frame); Enqueue(dst, frame); @@ -554,31 +548,31 @@ void VideoBuffers::SafeEnqueue(BufferType dst, VideoFrame* frame) frame_queue_t::iterator VideoBuffers::begin_lock(BufferType type) { - global_lock.lock(); + m_globalLock.lock(); frame_queue_t *q = Queue(type); if (q) return q->begin(); else - return available.begin(); + return m_available.begin(); } frame_queue_t::iterator VideoBuffers::end(BufferType type) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); frame_queue_t::iterator it; frame_queue_t *q = Queue(type); if (q) it = q->end(); else - it = available.end(); + it = m_available.end(); return it; } uint VideoBuffers::Size(BufferType type) const { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); const frame_queue_t *q = Queue(type); if (q) @@ -589,7 +583,7 @@ uint VideoBuffers::Size(BufferType type) const bool VideoBuffers::Contains(BufferType type, VideoFrame *frame) const { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); const frame_queue_t *q = Queue(type); if (q) @@ -600,18 +594,18 @@ bool VideoBuffers::Contains(BufferType type, VideoFrame *frame) const VideoFrame *VideoBuffers::GetScratchFrame(void) { - if (!createdpauseframe || !Head(kVideoBuffer_pause)) + if (!m_createdPauseFrame || !Head(kVideoBuffer_pause)) { LOG(VB_GENERAL, LOG_ERR, "GetScratchFrame() called, but not allocated"); } - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); return Head(kVideoBuffer_pause); } void VideoBuffers::SetLastShownFrameToScratch(void) { - if (!createdpauseframe || !Head(kVideoBuffer_pause)) + if (!m_createdPauseFrame || !Head(kVideoBuffer_pause)) { LOG(VB_GENERAL, LOG_ERR, "SetLastShownFrameToScratch() called but no pause frame"); @@ -619,7 +613,7 @@ void VideoBuffers::SetLastShownFrameToScratch(void) } VideoFrame *pause = Head(kVideoBuffer_pause); - rpos = vbufferMap[pause]; + m_rpos = m_vbufferMap[pause]; } /** @@ -628,13 +622,13 @@ void VideoBuffers::SetLastShownFrameToScratch(void) */ void VideoBuffers::DiscardFrames(bool next_frame_keyframe) { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); LOG(VB_PLAYBACK, LOG_INFO, QString("VideoBuffers::DiscardFrames(%1): %2") .arg(next_frame_keyframe).arg(GetStatus())); if (!next_frame_keyframe) { - frame_queue_t ula(used); + frame_queue_t ula(m_used); frame_queue_t::iterator it = ula.begin(); for (; it != ula.end(); ++it) DiscardFrame(*it); @@ -645,27 +639,27 @@ void VideoBuffers::DiscardFrames(bool next_frame_keyframe) } // Remove inheritence of all frames not in displayed or pause - frame_queue_t ula(used); - ula.insert(ula.end(), limbo.begin(), limbo.end()); - ula.insert(ula.end(), available.begin(), available.end()); - ula.insert(ula.end(), finished.begin(), finished.end()); + frame_queue_t ula(m_used); + ula.insert(ula.end(), m_limbo.begin(), m_limbo.end()); + ula.insert(ula.end(), m_available.begin(), m_available.end()); + ula.insert(ula.end(), m_finished.begin(), m_finished.end()); frame_queue_t::iterator it; // Discard frames - frame_queue_t discards(used); - discards.insert(discards.end(), limbo.begin(), limbo.end()); - discards.insert(discards.end(), finished.begin(), finished.end()); + frame_queue_t discards(m_used); + discards.insert(discards.end(), m_limbo.begin(), m_limbo.end()); + discards.insert(discards.end(), m_finished.begin(), m_finished.end()); for (it = discards.begin(); it != discards.end(); ++it) DiscardFrame(*it); // Verify that things are kosher - if (available.count() + pause.count() + displayed.count() != Size()) + if (m_available.count() + m_pause.count() + m_displayed.count() != Size()) { for (uint i=0; i < Size(); i++) { - if (!available.contains(At(i)) && - !pause.contains(At(i)) && - !displayed.contains(At(i))) + if (!m_available.contains(At(i)) && + !m_pause.contains(At(i)) && + !m_displayed.contains(At(i))) { // This message is DEBUG because it does occur // after Reset is called. @@ -683,11 +677,11 @@ void VideoBuffers::DiscardFrames(bool next_frame_keyframe) // Make sure frames used by decoder are last... // This is for libmpeg2 which still uses the frames after a reset. - for (it = decode.begin(); it != decode.end(); ++it) + for (it = m_decode.begin(); it != m_decode.end(); ++it) Remove(kVideoBuffer_all, *it); - for (it = decode.begin(); it != decode.end(); ++it) - available.enqueue(*it); - decode.clear(); + for (it = m_decode.begin(); it != m_decode.end(); ++it) + m_available.enqueue(*it); + m_decode.clear(); LOG(VB_PLAYBACK, LOG_INFO, QString("VideoBuffers::DiscardFrames(%1): %2 -- done") @@ -697,27 +691,27 @@ void VideoBuffers::DiscardFrames(bool next_frame_keyframe) void VideoBuffers::ClearAfterSeek(void) { { - QMutexLocker locker(&global_lock); + QMutexLocker locker(&m_globalLock); for (uint i = 0; i < Size(); i++) At(i)->timecode = 0; - while (used.count() > 1) + while (m_used.count() > 1) { - VideoFrame *buffer = used.dequeue(); - available.enqueue(buffer); + VideoFrame *buffer = m_used.dequeue(); + m_available.enqueue(buffer); } - if (used.count() > 0) + if (m_used.count() > 0) { - VideoFrame *buffer = used.dequeue(); - available.enqueue(buffer); - vpos = vbufferMap[buffer]; - rpos = vpos; + VideoFrame *buffer = m_used.dequeue(); + m_available.enqueue(buffer); + m_vpos = m_vbufferMap[buffer]; + m_rpos = m_vpos; } else { - vpos = rpos = 0; + m_vpos = m_rpos = 0; } } } @@ -750,15 +744,15 @@ bool VideoBuffers::CreateBuffers(VideoFrameType type, int width, int height, bufs.push_back(data); yuvinfo.emplace_back(width, height, buf_size, nullptr, nullptr); - allocated_arrays.push_back(data); + m_allocatedArrays.push_back(data); } for (uint i = 0; i < Size(); i++) { - init(&buffers[i], - type, bufs[i], yuvinfo[i].width, yuvinfo[i].height, - max(buf_size, yuvinfo[i].size), - (const int*) yuvinfo[i].pitches, (const int*) yuvinfo[i].offsets); + init(&m_buffers[i], + type, bufs[i], yuvinfo[i].m_width, yuvinfo[i].m_height, + max(buf_size, yuvinfo[i].m_size), + (const int*) yuvinfo[i].m_pitches, (const int*) yuvinfo[i].m_offsets); ok &= (bufs[i] != nullptr); } @@ -777,32 +771,32 @@ bool VideoBuffers::CreateBuffer(int width, int height, uint num, void* data, if (num >= Size()) return false; - init(&buffers[num], fmt, (unsigned char*)data, width, height, 0); - buffers[num].priv[0] = ffmpeg_hack; - buffers[num].priv[1] = ffmpeg_hack; + init(&m_buffers[num], fmt, (unsigned char*)data, width, height, 0); + m_buffers[num].priv[0] = ffmpeg_hack; + m_buffers[num].priv[1] = ffmpeg_hack; return true; } uint VideoBuffers::AddBuffer(int width, int height, void* data, VideoFrameType fmt) { - QMutexLocker lock(&global_lock); + QMutexLocker lock(&m_globalLock); uint num = Size(); - buffers.resize(num + 1); - memset(&buffers[num], 0, sizeof(VideoFrame)); - buffers[num].interlaced_frame = -1; - buffers[num].top_field_first = 1; - vbufferMap[At(num)] = num; + m_buffers.resize(num + 1); + memset(&m_buffers[num], 0, sizeof(VideoFrame)); + m_buffers[num].interlaced_frame = -1; + m_buffers[num].top_field_first = 1; + m_vbufferMap[At(num)] = num; if (!data) { int size = buffersize(fmt, width, height); data = av_malloc(size); - allocated_arrays.push_back((unsigned char*)data); + m_allocatedArrays.push_back((unsigned char*)data); } - init(&buffers[num], fmt, (unsigned char*)data, width, height, 0); - buffers[num].priv[0] = ffmpeg_hack; - buffers[num].priv[1] = ffmpeg_hack; + init(&m_buffers[num], fmt, (unsigned char*)data, width, height, 0); + m_buffers[num].priv[0] = ffmpeg_hack; + m_buffers[num].priv[1] = ffmpeg_hack; Enqueue(kVideoBuffer_avail, At(num)); return Size(); @@ -813,14 +807,14 @@ void VideoBuffers::DeleteBuffers() next_dbg_str = 0; for (uint i = 0; i < Size(); i++) { - buffers[i].buf = nullptr; + m_buffers[i].buf = nullptr; - av_freep(&buffers[i].qscale_table); + av_freep(&m_buffers[i].qscale_table); } - for (uint i = 0; i < allocated_arrays.size(); i++) - av_free(allocated_arrays[i]); - allocated_arrays.clear(); + for (uint i = 0; i < m_allocatedArrays.size(); i++) + av_free(m_allocatedArrays[i]); + m_allocatedArrays.clear(); } static unsigned long long to_bitmap(const frame_queue_t& list, int); @@ -830,16 +824,16 @@ QString VideoBuffers::GetStatus(int n) const n = Size(); QString str(""); - if (global_lock.tryLock()) + if (m_globalLock.tryLock()) { int m = Size(); - unsigned long long a = to_bitmap(available, m); - unsigned long long u = to_bitmap(used, m); - unsigned long long d = to_bitmap(displayed, m); - unsigned long long l = to_bitmap(limbo, m); - unsigned long long p = to_bitmap(pause, m); - unsigned long long f = to_bitmap(finished, m); - unsigned long long x = to_bitmap(decode, m); + unsigned long long a = to_bitmap(m_available, m); + unsigned long long u = to_bitmap(m_used, m); + unsigned long long d = to_bitmap(m_displayed, m); + unsigned long long l = to_bitmap(m_limbo, m); + unsigned long long p = to_bitmap(m_pause, m); + unsigned long long f = to_bitmap(m_finished, m); + unsigned long long x = to_bitmap(m_decode, m); for (uint i=0; i<(uint)n; i++) { unsigned long long mask = 1ull<= needfreeframes; } + { return Size(kVideoBuffer_avail) >= m_needFreeFrames; } bool EnoughDecodedFrames(void) const - { return Size(kVideoBuffer_used) >= needprebufferframes; } + { return Size(kVideoBuffer_used) >= m_needPrebufferFrames; } bool EnoughPrebufferedFrames(void) const - { return Size(kVideoBuffer_used) >= keepprebufferframes; } + { return Size(kVideoBuffer_used) >= m_keepPrebufferFrames; } - const VideoFrame *At(uint i) const { return &buffers[i]; } - const VideoFrame *GetLastDecodedFrame(void) const { return At(vpos); } - const VideoFrame *GetLastShownFrame(void) const { return At(rpos); } - uint Size() const { return buffers.size(); } + const VideoFrame *At(uint i) const { return &m_buffers[i]; } + const VideoFrame *GetLastDecodedFrame(void) const { return At(m_vpos); } + const VideoFrame *GetLastShownFrame(void) const { return At(m_rpos); } + uint Size() const { return m_buffers.size(); } void Clear(uint i); void Clear(void); @@ -130,26 +130,31 @@ class MTV_PUBLIC VideoBuffers QString GetStatus(int n=-1) const; // debugging method private: - frame_queue_t *Queue(BufferType type); - const frame_queue_t *Queue(BufferType type) const; - VideoFrame *GetNextFreeFrameInternal(BufferType enqueue_to); - - frame_queue_t available, used, limbo, pause, displayed, decode, finished; - vbuffer_map_t vbufferMap; // videobuffers to buffer's index - frame_vector_t buffers; - uchar_vector_t allocated_arrays; // for DeleteBuffers - - uint needfreeframes; - uint needprebufferframes; - uint needprebufferframes_normal; - uint needprebufferframes_small;; - uint keepprebufferframes; - bool createdpauseframe; - - uint rpos; - uint vpos; - - mutable QMutex global_lock; + frame_queue_t *Queue(BufferType type); + const frame_queue_t *Queue(BufferType type) const; + VideoFrame *GetNextFreeFrameInternal(BufferType enqueue_to); + + frame_queue_t m_available; + frame_queue_t m_used; + frame_queue_t m_limbo; + frame_queue_t m_pause; + frame_queue_t m_displayed; + frame_queue_t m_decode; + frame_queue_t m_finished; + vbuffer_map_t m_vbufferMap; // videobuffers to buffer's index + frame_vector_t m_buffers; + uchar_vector_t m_allocatedArrays; // for DeleteBuffers + + uint m_needFreeFrames {0}; + uint m_needPrebufferFrames {0}; + uint m_needPrebufferFramesNormal {0}; + uint m_needPrebufferFramesSmall {0}; + uint m_keepPrebufferFrames {0}; + bool m_createdPauseFrame {false}; + uint m_rpos {0}; + uint m_vpos {0}; + + mutable QMutex m_globalLock {QMutex::Recursive}; }; #endif // __VIDEOBUFFERS_H__ diff --git a/mythtv/libs/libmythtv/videoout_xv.cpp b/mythtv/libs/libmythtv/videoout_xv.cpp index 224422ae8f3..00bcab7e485 100644 --- a/mythtv/libs/libmythtv/videoout_xv.cpp +++ b/mythtv/libs/libmythtv/videoout_xv.cpp @@ -1086,8 +1086,8 @@ vector VideoOutputXv::CreateShmImages(uint num, bool use_xv) img->pitches, img->offsets); if (xv_chroma == GUID_YV12_PLANAR) { - swap(tmp.pitches[1], tmp.pitches[2]); - swap(tmp.offsets[1], tmp.offsets[2]); + swap(tmp.m_pitches[1], tmp.m_pitches[2]); + swap(tmp.m_offsets[1], tmp.m_offsets[2]); } XJ_yuv_infos.push_back(tmp); diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp index 2a3831285c1..826bd657cf0 100644 --- a/mythtv/libs/libmythtv/videosource.cpp +++ b/mythtv/libs/libmythtv/videosource.cpp @@ -65,9 +65,9 @@ static const uint kDefaultMultirecCount = 2; VideoSourceSelector::VideoSourceSelector(uint _initial_sourceid, const QString &_card_types, bool _must_have_mplexid) : - initial_sourceid(_initial_sourceid), - card_types(_card_types), - must_have_mplexid(_must_have_mplexid) + m_initialSourceId(_initial_sourceid), + m_cardTypes(_card_types), + m_mustHaveMplexId(_must_have_mplexid) { setLabel(tr("Video Source")); } @@ -80,19 +80,19 @@ void VideoSourceSelector::Load(void) "SELECT DISTINCT videosource.name, videosource.sourceid " "FROM capturecard, videosource"; - querystr += (must_have_mplexid) ? ", channel " : " "; + querystr += (m_mustHaveMplexId) ? ", channel " : " "; querystr += "WHERE capturecard.sourceid = videosource.sourceid AND " " capturecard.hostname = :HOSTNAME "; - if (!card_types.isEmpty()) + if (!m_cardTypes.isEmpty()) { querystr += QString(" AND capturecard.cardtype in %1 ") - .arg(card_types); + .arg(m_cardTypes); } - if (must_have_mplexid) + if (m_mustHaveMplexId) { querystr += " AND channel.sourceid = videosource.sourceid " @@ -112,10 +112,10 @@ void VideoSourceSelector::Load(void) addSelection(query.value(0).toString(), query.value(1).toString()); - sel = (query.value(1).toUInt() == initial_sourceid) ? cnt : sel; + sel = (query.value(1).toUInt() == m_initialSourceId) ? cnt : sel; } - if (initial_sourceid) + if (m_initialSourceId) { if (cnt) setValue(sel); @@ -378,7 +378,7 @@ FreqTableSelector::FreqTableSelector(const VideoSource &parent) : } TransFreqTableSelector::TransFreqTableSelector(uint _sourceid) : - sourceid(_sourceid) + m_sourceId(_sourceid) { setLabel(QObject::tr("Channel frequency table")); @@ -392,7 +392,7 @@ void TransFreqTableSelector::Load(void) if (idx1 >= 0) setValue(idx1); - if (!sourceid) + if (!m_sourceId) return; MSqlQuery query(MSqlQuery::InitCon()); @@ -400,7 +400,7 @@ void TransFreqTableSelector::Load(void) "SELECT freqtable " "FROM videosource " "WHERE sourceid = :SOURCEID"); - query.bindValue(":SOURCEID", sourceid); + query.bindValue(":SOURCEID", m_sourceId); if (!query.exec() || !query.isActive()) { @@ -408,15 +408,15 @@ void TransFreqTableSelector::Load(void) return; } - loaded_freq_table.clear(); + m_LoadedFreqTable.clear(); if (query.next()) { - loaded_freq_table = query.value(0).toString(); - if (!loaded_freq_table.isEmpty() && - (loaded_freq_table.toLower() != "default")) + m_LoadedFreqTable = query.value(0).toString(); + if (!m_LoadedFreqTable.isEmpty() && + (m_LoadedFreqTable.toLower() != "default")) { - int idx2 = getValueIndex(loaded_freq_table); + int idx2 = getValueIndex(m_LoadedFreqTable); if (idx2 >= 0) setValue(idx2); } @@ -427,8 +427,8 @@ void TransFreqTableSelector::Save(void) { LOG(VB_GENERAL, LOG_INFO, "TransFreqTableSelector::Save(void)"); - if ((loaded_freq_table == getValue()) || - ((loaded_freq_table.toLower() == "default") && + if ((m_LoadedFreqTable == getValue()) || + ((m_LoadedFreqTable.toLower() == "default") && (getValue() == gCoreContext->GetSetting("FreqTable")))) { return; @@ -441,7 +441,7 @@ void TransFreqTableSelector::Save(void) "WHERE sourceid = :SOURCEID"); query.bindValue(":FREQTABLE", getValue()); - query.bindValue(":SOURCEID", sourceid); + query.bindValue(":SOURCEID", m_sourceId); if (!query.exec() || !query.isActive()) { @@ -452,7 +452,7 @@ void TransFreqTableSelector::Save(void) void TransFreqTableSelector::SetSourceID(uint _sourceid) { - sourceid = _sourceid; + m_sourceId = _sourceid; Load(); } @@ -473,18 +473,18 @@ class UseEIT : public MythUICheckBoxSetting XMLTV_generic_config::XMLTV_generic_config(const VideoSource& _parent, QString _grabber, StandardSetting *_setting) : - parent(_parent), grabber(_grabber) + m_parent(_parent), m_grabber(_grabber) { setVisible(false); QString filename = QString("%1/%2.xmltv") - .arg(GetConfDir()).arg(parent.getSourceName()); + .arg(GetConfDir()).arg(m_parent.getSourceName()); - grabberArgs.push_back("--config-file"); - grabberArgs.push_back(filename); - grabberArgs.push_back("--configure"); + m_grabberArgs.push_back("--config-file"); + m_grabberArgs.push_back(filename); + m_grabberArgs.push_back("--configure"); - _setting->addTargetedChild(_grabber, new UseEIT(parent)); + _setting->addTargetedChild(_grabber, new UseEIT(m_parent)); ButtonStandardSetting *config = new ButtonStandardSetting(tr("Configure")); config->setHelpText(tr("Run XMLTV configure command.")); @@ -503,7 +503,7 @@ void XMLTV_generic_config::Save() "instead of just 'mythfilldatabase'.\nYour grabber does not provide " "channel numbers, so you have to set them manually."); - if (is_grabber_external(grabber)) + if (is_grabber_external(m_grabber)) { LOG(VB_GENERAL, LOG_ERR, err_msg); ShowOkPopup(err_msg); @@ -515,7 +515,7 @@ void XMLTV_generic_config::RunConfig(void) { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); MythScreenType *ssd = - new MythTerminal(mainStack, grabber, grabberArgs); + new MythTerminal(mainStack, m_grabber, m_grabberArgs); if (ssd->Create()) mainStack->AddScreen(ssd); @@ -527,10 +527,10 @@ EITOnly_config::EITOnly_config(const VideoSource& _parent, StandardSetting *_set { setVisible(false); - useeit = new UseEIT(_parent); - useeit->setValue(true); - useeit->setVisible(false); - addChild(useeit); + m_useeit = new UseEIT(_parent); + m_useeit->setValue(true); + m_useeit->setVisible(false); + addChild(m_useeit); TransTextEditSetting *label; label=new TransTextEditSetting(); @@ -544,16 +544,16 @@ EITOnly_config::EITOnly_config(const VideoSource& _parent, StandardSetting *_set void EITOnly_config::Save(void) { // Force this value on - useeit->setValue(true); - useeit->Save(); + m_useeit->setValue(true); + m_useeit->Save(); } NoGrabber_config::NoGrabber_config(const VideoSource& _parent) { - useeit = new UseEIT(_parent); - useeit->setValue(false); - useeit->setVisible(false); - addChild(useeit); + m_useeit = new UseEIT(_parent); + m_useeit->setValue(false); + m_useeit->setVisible(false); + addChild(m_useeit); TransTextEditSetting *label = new TransTextEditSetting(); label->setValue(QObject::tr("Do not configure a grabber")); @@ -562,18 +562,18 @@ NoGrabber_config::NoGrabber_config(const VideoSource& _parent) void NoGrabber_config::Save(void) { - useeit->setValue(false); - useeit->Save(); + m_useeit->setValue(false); + m_useeit->Save(); } VideoSource::VideoSource() { // must be first - id = new ID(); - addChild(id = new ID()); + m_id = new ID(); + addChild(m_id = new ID()); setLabel(QObject::tr("Video Source Setup")); - addChild(name = new Name(*this)); + addChild(m_name = new Name(*this)); addChild(new XMLTVGrabber(*this)); addChild(new FreqTableSelector(*this)); addChild(new DVBNetID(*this, -1, -1)); @@ -645,7 +645,7 @@ void VideoSource::fillSelections(MythUIComboBoxSetting* setting) void VideoSource::loadByID(int sourceid) { - id->setValue(sourceid); + m_id->setValue(sourceid); } class VideoDevice : public CaptureCardComboBoxSetting @@ -733,7 +733,7 @@ class VideoDevice : public CaptureCardComboBoxSetting continue; // ignore duplicates if allow_duplicates not set - if (!allow_duplicates && minor_list[minor_num]) + if (!allow_duplicates && m_minorList[minor_num]) continue; // if the driver returns any info add this device to our list @@ -753,20 +753,20 @@ class VideoDevice : public CaptureCardComboBoxSetting } // add to list of minors discovered to avoid duplicates - minor_list[minor_num] = 1; + m_minorList[minor_num] = 1; } delete driverExp; return cnt; } - QString Driver(void) const { return driver_name; } - QString Card(void) const { return card_name; } + QString Driver(void) const { return m_driverName; } + QString Card(void) const { return m_cardName; } private: - QMap minor_list; - QString card_name; - QString driver_name; + QMap m_minorList; + QString m_cardName; + QString m_driverName; }; class VBIDevice : public CaptureCardComboBoxSetting @@ -1142,7 +1142,7 @@ class FirewireGUID : public CaptureCardComboBoxSetting FirewireModel::FirewireModel(const CaptureCard &parent, const FirewireGUID *_guid) : CaptureCardComboBoxSetting(parent, false, "firewire_model"), - guid(_guid) + m_guid(_guid) { setLabel(QObject::tr("Cable box model")); addSelection(QObject::tr("Motorola Generic"), "MOTO GENERIC"); @@ -1174,7 +1174,7 @@ void FirewireModel::SetGUID(const QString &_guid) (void) _guid; #ifdef USING_FIREWIRE - AVCInfo info = guid->GetAVCInfo(_guid); + AVCInfo info = m_guid->GetAVCInfo(_guid); QString model = FirewireDevice::GetModelName(info.m_vendorid, info.m_modelid); setValue(max(getValueIndex(model), 0)); #endif // USING_FIREWIRE @@ -1187,7 +1187,7 @@ void FirewireDesc::SetGUID(const QString &_guid) setLabel(tr("Description")); #ifdef USING_FIREWIRE - QString name = guid->GetAVCInfo(_guid).m_product_name; + QString name = m_guid->GetAVCInfo(_guid).m_product_name; name.replace("Scientific-Atlanta", "SA"); name.replace(", Inc.", ""); name.replace("Explorer(R)", ""); @@ -1315,38 +1315,38 @@ class UseHDHomeRunDevice : public TransMythUICheckBoxSetting HDHomeRunConfigurationGroup::HDHomeRunConfigurationGroup (CaptureCard& a_parent, CardType &a_cardtype) : - parent(a_parent) + m_parent(a_parent) { setVisible(false); // Fill Device list FillDeviceList(); - deviceid = new HDHomeRunDeviceID(parent, *this); + m_deviceId = new HDHomeRunDeviceID(m_parent, *this); QMap::iterator dit; - for (dit = devicelist.begin(); dit != devicelist.end(); ++dit) + for (dit = m_deviceList.begin(); dit != m_deviceList.end(); ++dit) { HDHomeRunDevice &dev = *dit; dev.checkbox = new UseHDHomeRunDevice( dev.deviceid, dev.model, dev.cardip); a_cardtype.addTargetedChild("HDHOMERUN", dev.checkbox); } - a_cardtype.addTargetedChild("HDHOMERUN", new EmptyAudioDevice(parent)); - a_cardtype.addTargetedChild("HDHOMERUN", new EmptyVBIDevice(parent)); - a_cardtype.addTargetedChild("HDHOMERUN", deviceid); + a_cardtype.addTargetedChild("HDHOMERUN", new EmptyAudioDevice(m_parent)); + a_cardtype.addTargetedChild("HDHOMERUN", new EmptyVBIDevice(m_parent)); + a_cardtype.addTargetedChild("HDHOMERUN", m_deviceId); GroupSetting *buttonRecOpt = new GroupSetting(); buttonRecOpt->setLabel(tr("Recording Options")); - buttonRecOpt->addChild(new SignalTimeout(parent, 1000, 250)); - buttonRecOpt->addChild(new ChannelTimeout(parent, 3000, 1750)); - buttonRecOpt->addChild(new HDHomeRunEITScan(parent)); + buttonRecOpt->addChild(new SignalTimeout(m_parent, 1000, 250)); + buttonRecOpt->addChild(new ChannelTimeout(m_parent, 3000, 1750)); + buttonRecOpt->addChild(new HDHomeRunEITScan(m_parent)); a_cardtype.addTargetedChild("HDHOMERUN", buttonRecOpt); }; void HDHomeRunConfigurationGroup::FillDeviceList(void) { - devicelist.clear(); + m_deviceList.clear(); // Find physical devices first // ProbeVideoDevices returns "deviceid ip" pairs @@ -1366,13 +1366,13 @@ void HDHomeRunConfigurationGroup::FillDeviceList(void) tmpdevice.model = model; tmpdevice.cardip = devip; tmpdevice.deviceid = devid; - devicelist[tmpdevice.deviceid] = tmpdevice; + m_deviceList[tmpdevice.deviceid] = tmpdevice; } #if 0 // Debug dump of cards QMap::iterator debugit; - for (debugit = devicelist.begin(); debugit != devicelist.end(); ++debugit) + for (debugit = m_deviceList.begin(); debugit != m_deviceList.end(); ++debugit) { LOG(VB_GENERAL, LOG_DEBUG, QString("%1: %2 %3") .arg(debugit.key()).arg((*debugit).model) @@ -1400,8 +1400,8 @@ void HDHomeRunConfigurationGroup::SetDeviceCheckBoxes(QString devices) // If we know about this device, set its checkbox to on. QMap::iterator dit; - dit = devicelist.find(devid); - if (dit != devicelist.end()) + dit = m_deviceList.find(devid); + if (dit != m_deviceList.end()) (*dit).checkbox->setValue(true); } } @@ -1412,7 +1412,7 @@ QString HDHomeRunConfigurationGroup::GetDeviceCheckBoxes(void) // turned on. QStringList devstrs; QMap::iterator dit; - for (dit = devicelist.begin(); dit != devicelist.end(); ++dit) + for (dit = m_deviceList.begin(); dit != m_deviceList.end(); ++dit) { if ((*dit).checkbox->boolValue()) devstrs << (*dit).deviceid; @@ -1434,7 +1434,6 @@ VBoxIP::VBoxIP() setEnabled(false); connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(UpdateDevices(const QString&))); - _oldValue=""; }; void VBoxIP::setEnabled(bool e) @@ -1442,13 +1441,13 @@ void VBoxIP::setEnabled(bool e) MythUITextEditSetting::setEnabled(e); if (e) { - if (!_oldValue.isEmpty()) - setValue(_oldValue); + if (!m_oldValue.isEmpty()) + setValue(m_oldValue); emit NewIP(getValue()); } else { - _oldValue = getValue(); + m_oldValue = getValue(); } } @@ -1465,20 +1464,19 @@ VBoxTunerIndex::VBoxTunerIndex() setEnabled(false); connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(UpdateDevices(const QString&))); - _oldValue = ""; }; void VBoxTunerIndex::setEnabled(bool e) { MythUITextEditSetting::setEnabled(e); if (e) { - if (!_oldValue.isEmpty()) - setValue(_oldValue); + if (!m_oldValue.isEmpty()) + setValue(m_oldValue); emit NewTuner(getValue()); } else { - _oldValue = getValue(); + m_oldValue = getValue(); } } @@ -1498,29 +1496,29 @@ VBoxDeviceID::VBoxDeviceID(const CaptureCard &parent) : void VBoxDeviceID::SetIP(const QString &ip) { - _ip = ip; - setValue(QString("%1-%2").arg(_ip).arg(_tuner)); + m_ip = ip; + setValue(QString("%1-%2").arg(m_ip).arg(m_tuner)); } void VBoxDeviceID::SetTuner(const QString &tuner) { - _tuner = tuner; - setValue(QString("%1-%2").arg(_ip).arg(_tuner)); + m_tuner = tuner; + setValue(QString("%1-%2").arg(m_ip).arg(m_tuner)); } void VBoxDeviceID::SetOverrideDeviceID(const QString &deviceid) { - _overridedeviceid = deviceid; + m_overrideDeviceId = deviceid; setValue(deviceid); } void VBoxDeviceID::Load(void) { GetStorage()->Load(); - if (!_overridedeviceid.isEmpty()) + if (!m_overrideDeviceId.isEmpty()) { - setValue(_overridedeviceid); - _overridedeviceid.clear(); + setValue(m_overrideDeviceId); + m_overrideDeviceId.clear(); } } @@ -1531,11 +1529,11 @@ VBoxDeviceIDList::VBoxDeviceIDList( VBoxTunerIndex *cardtuner, VBoxDeviceList *devicelist, const CaptureCard &parent) : - _deviceid(deviceid), - _desc(desc), - _cardip(cardip), - _cardtuner(cardtuner), - _devicelist(devicelist), + m_deviceId(deviceid), + m_desc(desc), + m_cardIp(cardip), + m_cardTuner(cardtuner), + m_deviceList(devicelist), m_parent(parent) { setLabel(QObject::tr("Available devices")); @@ -1545,8 +1543,6 @@ VBoxDeviceIDList::VBoxDeviceIDList( connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(UpdateDevices(const QString&))); - - _oldValue = ""; }; /// \brief Adds all available device-tuner combinations to list @@ -1559,8 +1555,8 @@ void VBoxDeviceIDList::fillSelections(const QString &cur) QString current = cur; - VBoxDeviceList::iterator it = _devicelist->begin(); - for (; it != _devicelist->end(); ++it) + VBoxDeviceList::iterator it = m_deviceList->begin(); + for (; it != m_deviceList->end(); ++it) { devs.push_back(it.key()); in_use[it.key()] = (*it).inuse; @@ -1586,18 +1582,18 @@ void VBoxDeviceIDList::fillSelections(const QString &cur) if (current != cur) { - _deviceid->SetOverrideDeviceID(current); + m_deviceId->SetOverrideDeviceID(current); } else if (sel == man_addr && !current.isEmpty()) { // Populate the proper values for IP address and tuner QStringList selection = current.split("-"); - _cardip->SetOldValue(selection.first()); - _cardtuner->SetOldValue(selection.last()); + m_cardIp->SetOldValue(selection.first()); + m_cardTuner->SetOldValue(selection.last()); - _cardip->setValue(selection.first()); - _cardtuner->setValue(selection.last()); + m_cardIp->setValue(selection.first()); + m_cardTuner->setValue(selection.last()); } } @@ -1614,24 +1610,24 @@ void VBoxDeviceIDList::UpdateDevices(const QString &v) { if (v == VBoxDeviceIDList::tr("Manually Enter IP Address")) { - _cardip->setEnabled(true); - _cardtuner->setEnabled(true); + m_cardIp->setEnabled(true); + m_cardTuner->setEnabled(true); } else if (!v.isEmpty()) { - if (_oldValue == VBoxDeviceIDList::tr("Manually Enter IP Address")) + if (m_oldValue == VBoxDeviceIDList::tr("Manually Enter IP Address")) { - _cardip->setEnabled(false); - _cardtuner->setEnabled(false); + m_cardIp->setEnabled(false); + m_cardTuner->setEnabled(false); } - _deviceid->setValue(v); + m_deviceId->setValue(v); // Update _cardip and _cardtuner - _cardip->setValue((*_devicelist)[v].cardip); - _cardtuner->setValue(QString("%1").arg((*_devicelist)[v].tunerno)); - _desc->setValue((*_devicelist)[v].desc); + m_cardIp->setValue((*m_deviceList)[v].cardip); + m_cardTuner->setValue(QString("%1").arg((*m_deviceList)[v].tunerno)); + m_desc->setValue((*m_deviceList)[v].desc); } - _oldValue = v; + m_oldValue = v; }; // ----------------------- @@ -1740,23 +1736,23 @@ class ASIDevice : public CaptureCardComboBoxSetting ASIConfigurationGroup::ASIConfigurationGroup(CaptureCard& a_parent, CardType &cardType): - parent(a_parent), - device(new ASIDevice(parent)), - cardinfo(new TransTextEditSetting()) + m_parent(a_parent), + m_device(new ASIDevice(m_parent)), + m_cardInfo(new TransTextEditSetting()) { setVisible(false); - cardinfo->setLabel(tr("Status")); - cardinfo->setEnabled(false); + m_cardInfo->setLabel(tr("Status")); + m_cardInfo->setEnabled(false); - cardType.addTargetedChild("ASI", device); - cardType.addTargetedChild("ASI", new EmptyAudioDevice(parent)); - cardType.addTargetedChild("ASI", new EmptyVBIDevice(parent)); - cardType.addTargetedChild("ASI", cardinfo); + cardType.addTargetedChild("ASI", m_device); + cardType.addTargetedChild("ASI", new EmptyAudioDevice(m_parent)); + cardType.addTargetedChild("ASI", new EmptyVBIDevice(m_parent)); + cardType.addTargetedChild("ASI", m_cardInfo); - connect(device, SIGNAL(valueChanged(const QString&)), - this, SLOT( probeCard( const QString&))); + connect(m_device, SIGNAL(valueChanged(const QString&)), + this, SLOT( probeCard( const QString&))); - probeCard(device->getValue()); + probeCard(m_device->getValue()); }; void ASIConfigurationGroup::probeCard(const QString &device) @@ -1764,13 +1760,13 @@ void ASIConfigurationGroup::probeCard(const QString &device) #ifdef USING_ASI if (device.isEmpty()) { - cardinfo->setValue(""); + m_cardInfo->setValue(""); return; } - if (parent.getCardID() && parent.GetRawCardType() != "ASI") + if (m_parent.getCardID() && m_parent.GetRawCardType() != "ASI") { - cardinfo->setValue(""); + m_cardInfo->setValue(""); return; } @@ -1778,40 +1774,40 @@ void ASIConfigurationGroup::probeCard(const QString &device) int device_num = CardUtil::GetASIDeviceNumber(device, &error); if (device_num < 0) { - cardinfo->setValue(tr("Not a valid DVEO ASI card")); + m_cardInfo->setValue(tr("Not a valid DVEO ASI card")); LOG(VB_GENERAL, LOG_WARNING, "ASIConfigurationGroup::probeCard(), Warning: " + error); return; } - cardinfo->setValue(tr("Valid DVEO ASI card")); + m_cardInfo->setValue(tr("Valid DVEO ASI card")); #else Q_UNUSED(device); - cardinfo->setValue(QString("Not compiled with ASI support")); + m_cardInfo->setValue(QString("Not compiled with ASI support")); #endif } ImportConfigurationGroup::ImportConfigurationGroup(CaptureCard& a_parent, CardType& a_cardtype): - parent(a_parent), - info(new TransTextEditSetting()), size(new TransTextEditSetting()) + m_parent(a_parent), + m_info(new TransTextEditSetting()), m_size(new TransTextEditSetting()) { setVisible(false); - FileDevice *device = new FileDevice(parent); + FileDevice *device = new FileDevice(m_parent); device->setHelpText(tr("A local file used to simulate a recording." " Leave empty to use MythEvents to trigger an" " external program to import recording files.")); a_cardtype.addTargetedChild("IMPORT", device); - a_cardtype.addTargetedChild("IMPORT", new EmptyAudioDevice(parent)); - a_cardtype.addTargetedChild("IMPORT", new EmptyVBIDevice(parent)); + a_cardtype.addTargetedChild("IMPORT", new EmptyAudioDevice(m_parent)); + a_cardtype.addTargetedChild("IMPORT", new EmptyVBIDevice(m_parent)); - info->setLabel(tr("File info")); - info->setEnabled(false); - a_cardtype.addTargetedChild("IMPORT", info); + m_info->setLabel(tr("File info")); + m_info->setEnabled(false); + a_cardtype.addTargetedChild("IMPORT", m_info); - size->setLabel(tr("File size")); - size->setEnabled(false); - a_cardtype.addTargetedChild("IMPORT", size); + m_size->setLabel(tr("File size")); + m_size->setEnabled(false); + a_cardtype.addTargetedChild("IMPORT", m_size); connect(device, SIGNAL(valueChanged(const QString&)), this, SLOT( probeCard( const QString&))); @@ -1843,8 +1839,8 @@ void ImportConfigurationGroup::probeCard(const QString &device) ci = tr("File %1 does not exist").arg(device); } - info->setValue(ci); - size->setValue(cs); + m_info->setValue(ci); + m_size->setValue(cs); } // ----------------------- @@ -1853,30 +1849,30 @@ void ImportConfigurationGroup::probeCard(const QString &device) VBoxConfigurationGroup::VBoxConfigurationGroup (CaptureCard& a_parent, CardType& a_cardtype) : - parent(a_parent) + m_parent(a_parent) { setVisible(false); // Fill Device list FillDeviceList(); - deviceid = new VBoxDeviceID(parent); - desc = new GroupSetting(); - desc->setLabel(tr("Description")); - cardip = new VBoxIP(); - cardtuner = new VBoxTunerIndex(); - deviceidlist = new VBoxDeviceIDList( - deviceid, desc, cardip, cardtuner, &devicelist, parent); - - a_cardtype.addTargetedChild("VBOX", deviceidlist); - a_cardtype.addTargetedChild("VBOX", new EmptyAudioDevice(parent)); - a_cardtype.addTargetedChild("VBOX", new EmptyVBIDevice(parent)); - a_cardtype.addTargetedChild("VBOX", deviceid); - a_cardtype.addTargetedChild("VBOX", desc); - a_cardtype.addTargetedChild("VBOX", cardip); - a_cardtype.addTargetedChild("VBOX", cardtuner); - a_cardtype.addTargetedChild("VBOX", new SignalTimeout(parent, 7000, 1000)); - a_cardtype.addTargetedChild("VBOX", new ChannelTimeout(parent, 10000, 1750)); + m_deviceId = new VBoxDeviceID(m_parent); + m_desc = new GroupSetting(); + m_desc->setLabel(tr("Description")); + m_cardIp = new VBoxIP(); + m_cardTuner = new VBoxTunerIndex(); + m_deviceIdList = new VBoxDeviceIDList( + m_deviceId, m_desc, m_cardIp, m_cardTuner, &m_deviceList, m_parent); + + a_cardtype.addTargetedChild("VBOX", m_deviceIdList); + a_cardtype.addTargetedChild("VBOX", new EmptyAudioDevice(m_parent)); + a_cardtype.addTargetedChild("VBOX", new EmptyVBIDevice(m_parent)); + a_cardtype.addTargetedChild("VBOX", m_deviceId); + a_cardtype.addTargetedChild("VBOX", m_desc); + a_cardtype.addTargetedChild("VBOX", m_cardIp); + a_cardtype.addTargetedChild("VBOX", m_cardTuner); + a_cardtype.addTargetedChild("VBOX", new SignalTimeout(m_parent, 7000, 1000)); + a_cardtype.addTargetedChild("VBOX", new ChannelTimeout(m_parent, 10000, 1750)); // TransButtonSetting *buttonRecOpt = new TransButtonSetting(); // buttonRecOpt->setLabel(tr("Recording Options")); // addChild(buttonRecOpt); @@ -1884,15 +1880,15 @@ VBoxConfigurationGroup::VBoxConfigurationGroup // connect(buttonRecOpt, SIGNAL(pressed()), // this, SLOT( VBoxExtraPanel())); - connect(cardip, SIGNAL(NewIP(const QString&)), - deviceid, SLOT( SetIP(const QString&))); - connect(cardtuner, SIGNAL(NewTuner(const QString&)), - deviceid, SLOT( SetTuner(const QString&))); + connect(m_cardIp, SIGNAL(NewIP(const QString&)), + m_deviceId, SLOT( SetIP(const QString&))); + connect(m_cardTuner, SIGNAL(NewTuner(const QString&)), + m_deviceId, SLOT( SetTuner(const QString&))); }; void VBoxConfigurationGroup::FillDeviceList(void) { - devicelist.clear(); + m_deviceList.clear(); // Find physical devices first // ProbeVideoDevices returns "deviceid ip tunerno tunertype" @@ -1918,7 +1914,7 @@ void VBoxConfigurationGroup::FillDeviceList(void) tmpdevice.tunerno = tunerNo; tmpdevice.tunertype = tunerType; tmpdevice.mythdeviceid = id + "-" + tunerNo + "-" + tunerType; - devicelist[tmpdevice.mythdeviceid] = tmpdevice; + m_deviceList[tmpdevice.mythdeviceid] = tmpdevice; } // Now find configured devices @@ -1929,9 +1925,9 @@ void VBoxConfigurationGroup::FillDeviceList(void) for (it = db.begin(); it != db.end(); ++it) { QMap::iterator dit; - dit = devicelist.find(*it); + dit = m_deviceList.find(*it); - if (dit != devicelist.end()) + if (dit != m_deviceList.end()) (*dit).inuse = true; } } @@ -1961,7 +1957,7 @@ void CetonSetting::LoadValue(const QString &value) CetonDeviceID::CetonDeviceID(const CaptureCard &parent) : MythUITextEditSetting(new CaptureCardDBStorage(this, parent, "videodevice")), - _ip(), _card(), _tuner(), _parent(parent) + m_parent(parent) { setLabel(tr("Device ID")); setHelpText(tr("Device ID of Ceton device")); @@ -1972,8 +1968,8 @@ void CetonDeviceID::SetIP(const QString &ip) QString regexp = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){4}$"; if (QRegExp(regexp).exactMatch(ip + ".")) { - _ip = ip; - setValue(QString("%1-RTP.%3").arg(_ip).arg(_tuner)); + m_ip = ip; + setValue(QString("%1-RTP.%3").arg(m_ip).arg(m_tuner)); } } @@ -1981,8 +1977,8 @@ void CetonDeviceID::SetTuner(const QString &tuner) { if (QRegExp("^\\d$").exactMatch(tuner)) { - _tuner = tuner; - setValue(QString("%1-RTP.%2").arg(_ip).arg(_tuner)); + m_tuner = tuner; + setValue(QString("%1-RTP.%2").arg(m_ip).arg(m_tuner)); } } @@ -2037,22 +2033,22 @@ static void CetonConfigurationGroup(CaptureCard& parent, CardType& cardtype) V4LConfigurationGroup::V4LConfigurationGroup(CaptureCard& a_parent, CardType& a_cardtype) : - parent(a_parent), - cardinfo(new TransTextEditSetting()), vbidev(new VBIDevice(parent)) + m_parent(a_parent), + m_cardInfo(new TransTextEditSetting()), m_vbiDev(new VBIDevice(m_parent)) { setVisible(false); QString drv = "(?!ivtv|hdpvr|(saa7164(.*))).*"; - VideoDevice *device = new VideoDevice(parent, 0, 15, QString(), drv); + VideoDevice *device = new VideoDevice(m_parent, 0, 15, QString(), drv); - cardinfo->setLabel(tr("Probed info")); - cardinfo->setEnabled(false); + m_cardInfo->setLabel(tr("Probed info")); + m_cardInfo->setEnabled(false); a_cardtype.addTargetedChild("V4L", device); - a_cardtype.addTargetedChild("V4L", cardinfo); - a_cardtype.addTargetedChild("V4L", vbidev); - a_cardtype.addTargetedChild("V4L", new AudioDevice(parent)); - a_cardtype.addTargetedChild("V4L", new AudioRateLimit(parent)); - a_cardtype.addTargetedChild("V4L", new SkipBtAudio(parent)); + a_cardtype.addTargetedChild("V4L", m_cardInfo); + a_cardtype.addTargetedChild("V4L", m_vbiDev); + a_cardtype.addTargetedChild("V4L", new AudioDevice(m_parent)); + a_cardtype.addTargetedChild("V4L", new AudioRateLimit(m_parent)); + a_cardtype.addTargetedChild("V4L", new SkipBtAudio(m_parent)); connect(device, SIGNAL(valueChanged(const QString&)), this, SLOT( probeCard( const QString&))); @@ -2075,34 +2071,33 @@ void V4LConfigurationGroup::probeCard(const QString &device) close(videofd); } - cardinfo->setValue(ci); - vbidev->setFilter(cn, dn); + m_cardInfo->setValue(ci); + m_vbiDev->setFilter(cn, dn); } MPEGConfigurationGroup::MPEGConfigurationGroup(CaptureCard &a_parent, CardType &a_cardtype) : - parent(a_parent), - device(nullptr), vbidevice(nullptr), - cardinfo(new TransTextEditSetting()) + m_parent(a_parent), + m_cardInfo(new TransTextEditSetting()) { setVisible(false); QString drv = "ivtv|(saa7164(.*))"; - device = new VideoDevice(parent, 0, 15, QString(), drv); - vbidevice = new VBIDevice(parent); - vbidevice->setVisible(false); + m_device = new VideoDevice(m_parent, 0, 15, QString(), drv); + m_vbiDevice = new VBIDevice(m_parent); + m_vbiDevice->setVisible(false); - cardinfo->setLabel(tr("Probed info")); - cardinfo->setEnabled(false); + m_cardInfo->setLabel(tr("Probed info")); + m_cardInfo->setEnabled(false); - a_cardtype.addTargetedChild("MPEG", device); - a_cardtype.addTargetedChild("MPEG", vbidevice); - a_cardtype.addTargetedChild("MPEG", cardinfo); - a_cardtype.addTargetedChild("MPEG", new ChannelTimeout(parent, 12000, 2000)); + a_cardtype.addTargetedChild("MPEG", m_device); + a_cardtype.addTargetedChild("MPEG", m_vbiDevice); + a_cardtype.addTargetedChild("MPEG", m_cardInfo); + a_cardtype.addTargetedChild("MPEG", new ChannelTimeout(m_parent, 12000, 2000)); - connect(device, SIGNAL(valueChanged(const QString&)), - this, SLOT( probeCard( const QString&))); + connect(m_device, SIGNAL(valueChanged(const QString&)), + this, SLOT( probeCard( const QString&))); - probeCard(device->getValue()); + probeCard(m_device->getValue()); } void MPEGConfigurationGroup::probeCard(const QString &device) @@ -2120,32 +2115,32 @@ void MPEGConfigurationGroup::probeCard(const QString &device) close(videofd); } - cardinfo->setValue(ci); - vbidevice->setVisible(dn!="ivtv"); - vbidevice->setFilter(cn, dn); + m_cardInfo->setValue(ci); + m_vbiDevice->setVisible(dn!="ivtv"); + m_vbiDevice->setFilter(cn, dn); } DemoConfigurationGroup::DemoConfigurationGroup(CaptureCard &a_parent, CardType &a_cardtype) : - parent(a_parent), - info(new TransTextEditSetting()), size(new TransTextEditSetting()) + m_parent(a_parent), + m_info(new TransTextEditSetting()), m_size(new TransTextEditSetting()) { setVisible(false); - FileDevice *device = new FileDevice(parent); + FileDevice *device = new FileDevice(m_parent); device->setHelpText(tr("A local MPEG file used to simulate a recording.")); a_cardtype.addTargetedChild("DEMO", device); - a_cardtype.addTargetedChild("DEMO", new EmptyAudioDevice(parent)); - a_cardtype.addTargetedChild("DEMO", new EmptyVBIDevice(parent)); + a_cardtype.addTargetedChild("DEMO", new EmptyAudioDevice(m_parent)); + a_cardtype.addTargetedChild("DEMO", new EmptyVBIDevice(m_parent)); - info->setLabel(tr("File info")); - info->setEnabled(false); - a_cardtype.addTargetedChild("DEMO", info); + m_info->setLabel(tr("File info")); + m_info->setEnabled(false); + a_cardtype.addTargetedChild("DEMO", m_info); - size->setLabel(tr("File size")); - size->setEnabled(false); - a_cardtype.addTargetedChild("DEMO", size); + m_size->setLabel(tr("File size")); + m_size->setEnabled(false); + a_cardtype.addTargetedChild("DEMO", m_size); connect(device, SIGNAL(valueChanged(const QString&)), this, SLOT( probeCard( const QString&))); @@ -2172,30 +2167,30 @@ void DemoConfigurationGroup::probeCard(const QString &device) ci = tr("File does not exist"); } - info->setValue(ci); - size->setValue(cs); + m_info->setValue(ci); + m_size->setValue(cs); } #if !defined( USING_MINGW ) && !defined( _MSC_VER ) ExternalConfigurationGroup::ExternalConfigurationGroup(CaptureCard &a_parent, CardType &a_cardtype) : - parent(a_parent), - info(new TransTextEditSetting()) + m_parent(a_parent), + m_info(new TransTextEditSetting()) { setVisible(false); - CommandPath *device = new CommandPath(parent); + CommandPath *device = new CommandPath(m_parent); device->setLabel(tr("Command path")); device->setHelpText(tr("A 'black box' application controlled via " "stdin, status on stderr and TransportStream " "read from stdout")); a_cardtype.addTargetedChild("EXTERNAL", device); - info->setLabel(tr("File info")); - info->setEnabled(false); - a_cardtype.addTargetedChild("EXTERNAL", info); + m_info->setLabel(tr("File info")); + m_info->setEnabled(false); + a_cardtype.addTargetedChild("EXTERNAL", m_info); a_cardtype.addTargetedChild("EXTERNAL", - new ChannelTimeout(parent, 20000, 1750)); + new ChannelTimeout(m_parent, 20000, 1750)); connect(device, SIGNAL(valueChanged(const QString&)), this, SLOT( probeApp( const QString&))); @@ -2227,30 +2222,29 @@ void ExternalConfigurationGroup::probeApp(const QString & path) .arg(fileInfo.absoluteFilePath()); } - info->setValue(ci); + m_info->setValue(ci); } #endif // !defined( USING_MINGW ) && !defined( _MSC_VER ) HDPVRConfigurationGroup::HDPVRConfigurationGroup(CaptureCard &a_parent, CardType &a_cardtype) : - parent(a_parent), cardinfo(new GroupSetting()), - audioinput(new TunerCardAudioInput(parent, QString(), "HDPVR")), - vbidevice(nullptr) + m_parent(a_parent), m_cardInfo(new GroupSetting()), + m_audioInput(new TunerCardAudioInput(m_parent, QString(), "HDPVR")) { setVisible(false); VideoDevice *device = - new VideoDevice(parent, 0, 15, QString(), "hdpvr"); + new VideoDevice(m_parent, 0, 15, QString(), "hdpvr"); - cardinfo->setLabel(tr("Probed info")); - cardinfo->setEnabled(false); + m_cardInfo->setLabel(tr("Probed info")); + m_cardInfo->setEnabled(false); a_cardtype.addTargetedChild("HDPVR", device); - a_cardtype.addTargetedChild("HDPVR", new EmptyAudioDevice(parent)); - a_cardtype.addTargetedChild("HDPVR", new EmptyVBIDevice(parent)); - a_cardtype.addTargetedChild("HDPVR", cardinfo); - a_cardtype.addTargetedChild("HDPVR", audioinput); - a_cardtype.addTargetedChild("HDPVR", new ChannelTimeout(parent, 15000, 2000)); + a_cardtype.addTargetedChild("HDPVR", new EmptyAudioDevice(m_parent)); + a_cardtype.addTargetedChild("HDPVR", new EmptyVBIDevice(m_parent)); + a_cardtype.addTargetedChild("HDPVR", m_cardInfo); + a_cardtype.addTargetedChild("HDPVR", m_audioInput); + a_cardtype.addTargetedChild("HDPVR", new ChannelTimeout(m_parent, 15000, 2000)); connect(device, SIGNAL(valueChanged(const QString&)), this, SLOT( probeCard( const QString&))); @@ -2272,20 +2266,20 @@ void HDPVRConfigurationGroup::probeCard(const QString &device) close(videofd); } - cardinfo->setValue(ci); - audioinput->fillSelections(device); + m_cardInfo->setValue(ci); + m_audioInput->fillSelections(device); } V4L2encGroup::V4L2encGroup(CaptureCard &parent, CardType& cardtype) : m_parent(parent), - m_cardinfo(new TransTextEditSetting()) + m_cardInfo(new TransTextEditSetting()) { setLabel(QObject::tr("V4L2 encoder devices (multirec capable)")); m_device = new VideoDevice(m_parent, 0, 15); cardtype.addTargetedChild("V4L2ENC", m_device); - m_cardinfo->setLabel(tr("Probed info")); - cardtype.addTargetedChild("V4L2ENC", m_cardinfo); + m_cardInfo->setLabel(tr("Probed info")); + cardtype.addTargetedChild("V4L2ENC", m_cardInfo); setVisible(false); @@ -2313,7 +2307,7 @@ void V4L2encGroup::probeCard(const QString &device_name) if (!m_DriverName.isEmpty()) card_info = card_name + " [" + m_DriverName + "]"; - m_cardinfo->setValue(card_info); + m_cardInfo->setValue(card_info); if (m_device->getSubSettings()->size() == 0) { @@ -2421,9 +2415,9 @@ CaptureCardGroup::CaptureCardGroup(CaptureCard &parent) } CaptureCard::CaptureCard(bool use_card_group) - : id(new ID) + : m_id(new ID) { - addChild(id); + addChild(m_id); if (use_card_group) CaptureCardGroup(*this); addChild(new Hostname(*this)); @@ -2473,7 +2467,7 @@ void CaptureCard::fillSelections(GroupSetting *setting) void CaptureCard::loadByID(int cardid) { - id->setValue(cardid); + m_id->setValue(cardid); Load(); } @@ -2697,11 +2691,11 @@ class InputGroup : public TransMythUIComboBoxSetting { public: InputGroup(const CardInput &parent, uint group_num) : - TransMythUIComboBoxSetting(), cardinput(parent), - groupnum(group_num), groupid(0) + TransMythUIComboBoxSetting(), m_cardInput(parent), + m_groupNum(group_num) { setLabel(QObject::tr("Input group") + - QString(" %1").arg(groupnum + 1)); + QString(" %1").arg(m_groupNum + 1)); setHelpText(QObject::tr( "Leave as 'Generic' unless this input is shared with " "another device. Only one of the inputs in an input " @@ -2712,11 +2706,11 @@ class InputGroup : public TransMythUIComboBoxSetting void Save(void) override // StandardSetting { - uint inputid = cardinput.getInputID(); + uint inputid = m_cardInput.getInputID(); uint new_groupid = getValue().toUInt(); - if (groupid) - CardUtil::UnlinkInputGroup(inputid, groupid); + if (m_groupId) + CardUtil::UnlinkInputGroup(inputid, m_groupId); if (new_groupid) { @@ -2728,19 +2722,19 @@ class InputGroup : public TransMythUIComboBoxSetting virtual void Save(QString /*destination*/) { Save(); } private: - const CardInput &cardinput; - uint groupnum; - uint groupid; + const CardInput &m_cardInput; + uint m_groupNum; + uint m_groupId {0}; }; void InputGroup::Load(void) { #if 0 LOG(VB_GENERAL, LOG_DEBUG, QString("InputGroup::Load() %1 %2") - .arg(groupnum).arg(cardinput.getInputID())); + .arg(m_groupNum).arg(m_cardInput.getInputID())); #endif - uint inputid = cardinput.getInputID(); + uint inputid = m_cardInput.getInputID(); QMap grpcnt; vector names; vector grpid; @@ -2780,13 +2774,13 @@ void InputGroup::Load(void) } // makes sure we select something - groupid = 0; - if (groupnum < selected_groupids.size()) - groupid = selected_groupids[groupnum]; + m_groupId = 0; + if (m_groupNum < selected_groupids.size()) + m_groupId = selected_groupids[m_groupNum]; #if 0 LOG(VB_GENERAL, LOG_DEBUG, QString("Group num: %1 id: %2") - .arg(groupnum).arg(groupid)); + .arg(m_groupNum).arg(m_groupId)); { QString msg; for (uint i = 0; i < selected_groupids.size(); i++) @@ -2800,7 +2794,7 @@ void InputGroup::Load(void) uint index = 0; for (uint i = 0; i < names.size(); i++) { - bool sel = (groupid == grpid[i]); + bool sel = (m_groupId == grpid[i]); index = (sel) ? i : index; #if 0 @@ -2980,29 +2974,27 @@ class DishNetEIT : public MythUICheckBoxSetting CardInput::CardInput(const QString & cardtype, const QString & device, int _cardid) : - id(new ID()), - inputname(new InputName(*this)), - sourceid(new SourceID(*this)), - startchan(new StartingChannel(*this)), - scan(new ButtonStandardSetting(tr("Scan for channels"))), - srcfetch(new ButtonStandardSetting(tr("Fetch channels from listings source"))), - externalInputSettings(new DiSEqCDevSettings()), - inputgrp0(new InputGroup(*this, 0)), - inputgrp1(new InputGroup(*this, 1)), - instancecount(nullptr), - schedgroup(nullptr) -{ - addChild(id); + m_id(new ID()), + m_inputName(new InputName(*this)), + m_sourceId(new SourceID(*this)), + m_startChan(new StartingChannel(*this)), + m_scan(new ButtonStandardSetting(tr("Scan for channels"))), + m_srcFetch(new ButtonStandardSetting(tr("Fetch channels from listings source"))), + m_externalInputSettings(new DiSEqCDevSettings()), + m_inputGrp0(new InputGroup(*this, 0)), + m_inputGrp1(new InputGroup(*this, 1)) +{ + addChild(m_id); if (CardUtil::IsInNeedOfExternalInputConf(_cardid)) { - addChild(new DTVDeviceConfigGroup(*externalInputSettings, + addChild(new DTVDeviceConfigGroup(*m_externalInputSettings, _cardid, true)); } - addChild(inputname); + addChild(m_inputName); addChild(new InputDisplayName(*this)); - addChild(sourceid); + addChild(m_sourceId); if (CardUtil::IsEncoder(cardtype) || CardUtil::IsUnscanable(cardtype)) { @@ -3017,28 +3009,28 @@ CardInput::CardInput(const QString & cardtype, const QString & device, addChild(new DishNetEIT(*this)); } - scan->setHelpText( + m_scan->setHelpText( tr("Use channel scanner to find channels for this input.")); - srcfetch->setHelpText( + m_srcFetch->setHelpText( tr("This uses the listings data source to " "provide the channels for this input.") + " " + tr("This can take a long time to run.")); - addChild(scan); - addChild(srcfetch); + addChild(m_scan); + addChild(m_srcFetch); - addChild(startchan); + addChild(m_startChan); GroupSetting *interact = new GroupSetting(); interact->setLabel(QObject::tr("Interactions between inputs")); if (CardUtil::IsTunerSharingCapable(cardtype)) { - instancecount = new InstanceCount(*this, kDefaultMultirecCount); - interact->addChild(instancecount); - schedgroup = new SchedGroup(*this); - interact->addChild(schedgroup); + m_instanceCount = new InstanceCount(*this, kDefaultMultirecCount); + interact->addChild(m_instanceCount); + m_schedGroup = new SchedGroup(*this); + interact->addChild(m_schedGroup); } interact->addChild(new InputPriority(*this)); interact->addChild(new ScheduleOrder(*this, _cardid)); @@ -3051,63 +3043,63 @@ CardInput::CardInput(const QString & cardtype, const QString & device, "share the same resource such as a FireWire card and " "an analog card input controlling the same set top box.")); interact->addChild(ingrpbtn); - interact->addChild(inputgrp0); - interact->addChild(inputgrp1); + interact->addChild(m_inputGrp0); + interact->addChild(m_inputGrp1); addChild(interact); setObjectName("CardInput"); SetSourceID("-1"); - connect(scan, SIGNAL(clicked()), SLOT(channelScanner())); - connect(srcfetch, SIGNAL(clicked()), SLOT(sourceFetch())); - connect(sourceid, SIGNAL(valueChanged(const QString&)), - startchan,SLOT( SetSourceID (const QString&))); - connect(sourceid, SIGNAL(valueChanged(const QString&)), - this, SLOT( SetSourceID (const QString&))); - connect(ingrpbtn, SIGNAL(clicked()), - this, SLOT( CreateNewInputGroup())); - if (schedgroup) - connect(instancecount, SIGNAL(valueChanged(const QString &)), - this, SLOT(UpdateSchedGroup(const QString &))); + connect(m_scan, SIGNAL(clicked()), SLOT(channelScanner())); + connect(m_srcFetch, SIGNAL(clicked()), SLOT(sourceFetch())); + connect(m_sourceId, SIGNAL(valueChanged(const QString&)), + m_startChan,SLOT( SetSourceID (const QString&))); + connect(m_sourceId, SIGNAL(valueChanged(const QString&)), + this, SLOT( SetSourceID (const QString&))); + connect(ingrpbtn, SIGNAL(clicked()), + this, SLOT( CreateNewInputGroup())); + if (m_schedGroup) + connect(m_instanceCount, SIGNAL(valueChanged(const QString &)), + this, SLOT(UpdateSchedGroup(const QString &))); } CardInput::~CardInput() { - if (externalInputSettings) + if (m_externalInputSettings) { - delete externalInputSettings; - externalInputSettings = nullptr; + delete m_externalInputSettings; + m_externalInputSettings = nullptr; } } void CardInput::SetSourceID(const QString &sourceid) { - uint cid = id->getValue().toUInt(); + uint cid = m_id->getValue().toUInt(); QString raw_card_type = CardUtil::GetRawInputType(cid); bool enable = (sourceid.toInt() > 0); - scan->setEnabled(enable && !raw_card_type.isEmpty() && + m_scan->setEnabled(enable && !raw_card_type.isEmpty() && !CardUtil::IsUnscanable(raw_card_type)); - srcfetch->setEnabled(enable); + m_srcFetch->setEnabled(enable); } void CardInput::UpdateSchedGroup(const QString &val) { int value = val.toInt(); if (value <= 1) - schedgroup->setValue(false); - schedgroup->setEnabled(value > 1); + m_schedGroup->setValue(false); + m_schedGroup->setEnabled(value > 1); } QString CardInput::getSourceName(void) const { - return sourceid->getValueLabel(); + return m_sourceId->getValueLabel(); } void CardInput::CreateNewInputGroup(void) { - inputgrp0->Save(); - inputgrp1->Save(); + m_inputGrp0->Save(); + m_inputGrp1->Save(); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythTextInputDialog *settingdialog = @@ -3153,26 +3145,26 @@ void CardInput::CreateNewInputGroupSlot(const QString& name) uint inputgroupid = CardUtil::CreateInputGroup(new_name); - inputgrp0->Load(); - inputgrp1->Load(); + m_inputGrp0->Load(); + m_inputGrp1->Load(); - if (!inputgrp0->getValue().toUInt()) + if (!m_inputGrp0->getValue().toUInt()) { - inputgrp0->setValue( - inputgrp0->getValueIndex(QString::number(inputgroupid))); + m_inputGrp0->setValue( + m_inputGrp0->getValueIndex(QString::number(inputgroupid))); } else { - inputgrp1->setValue( - inputgrp1->getValueIndex(QString::number(inputgroupid))); + m_inputGrp1->setValue( + m_inputGrp1->getValueIndex(QString::number(inputgroupid))); } } void CardInput::channelScanner(void) { - uint srcid = sourceid->getValue().toUInt(); - uint crdid = id->getValue().toUInt(); - QString in = inputname->getValue(); + uint srcid = m_sourceId->getValue().toUInt(); + uint crdid = m_id->getValue().toUInt(); + QString in = m_inputName->getValue(); #ifdef USING_BACKEND uint num_channels_before = SourceUtil::GetChannelCount(srcid); @@ -3199,11 +3191,11 @@ void CardInput::channelScanner(void) [=]() { if (SourceUtil::GetChannelCount(srcid)) - startchan->SetSourceID(QString::number(srcid)); + m_startChan->SetSourceID(QString::number(srcid)); if (num_channels_before) { - startchan->Load(); - startchan->Save(); + m_startChan->Load(); + m_startChan->Save(); } }); mainStack->AddScreen(ssd); @@ -3219,8 +3211,8 @@ void CardInput::channelScanner(void) void CardInput::sourceFetch(void) { - uint srcid = sourceid->getValue().toUInt(); - uint crdid = id->getValue().toUInt(); + uint srcid = m_sourceId->getValue().toUInt(); + uint crdid = m_id->getValue().toUInt(); uint num_channels_before = SourceUtil::GetChannelCount(srcid); @@ -3245,11 +3237,11 @@ void CardInput::sourceFetch(void) } if (SourceUtil::GetChannelCount(srcid)) - startchan->SetSourceID(QString::number(srcid)); + m_startChan->SetSourceID(QString::number(srcid)); if (num_channels_before) { - startchan->Load(); - startchan->Save(); + m_startChan->Load(); + m_startChan->Save(); } } @@ -3280,8 +3272,8 @@ QString CardInputDBStorage::GetSetClause(MSqlBindings &bindings) const void CardInput::loadByID(int inputid) { - id->setValue(inputid); - externalInputSettings->Load(inputid); + m_id->setValue(inputid); + m_externalInputSettings->Load(inputid); GroupSetting::Load(); } @@ -3301,14 +3293,14 @@ void CardInput::loadByInput(int _cardid, QString _inputname) void CardInput::Save(void) { - uint cardid = id->getValue().toUInt(); + uint cardid = m_id->getValue().toUInt(); QString init_input = CardUtil::GetInputName(cardid); GroupSetting::Save(); - externalInputSettings->Store(getInputID()); + m_externalInputSettings->Store(getInputID()); uint icount = 1; - if (instancecount) - icount = instancecount->getValue().toUInt(); + if (m_instanceCount) + icount = m_instanceCount->getValue().toUInt(); vector cardids = CardUtil::GetChildInputIDs(cardid); // Delete old clone cards as required. @@ -3502,7 +3494,7 @@ CardInputEditor::CardInputEditor() void CardInputEditor::Load(void) { - cardinputs.clear(); + m_cardInputs.clear(); clearSettings(); // We do this manually because we want custom labels. If @@ -3537,7 +3529,7 @@ void CardInputEditor::Load(void) QString inputlabel = QString("%1 (%2) -> %3") .arg(CardUtil::GetDeviceLabel(cardtype, videodevice)) .arg(inputname).arg(cardinput->getSourceName()); - cardinputs.push_back(cardinput); + m_cardInputs.push_back(cardinput); cardinput->setLabel(inputlabel); addChild(cardinput); } @@ -3591,23 +3583,23 @@ static QString remove_chaff(const QString &name) void DVBConfigurationGroup::reloadDiseqcTree(const QString &videodevice) { - if (diseqc_tree) - diseqc_tree->Load(videodevice); + if (m_diseqcTree) + m_diseqcTree->Load(videodevice); } void DVBConfigurationGroup::probeCard(const QString &videodevice) { if (videodevice.isEmpty()) { - cardname->setValue(""); - cardtype->setValue(""); + m_cardName->setValue(""); + m_cardType->setValue(""); return; } - if (parent.getCardID() && parent.GetRawCardType() != "DVB") + if (m_parent.getCardID() && m_parent.GetRawCardType() != "DVB") { - cardname->setValue(""); - cardtype->setValue(""); + m_cardName->setValue(""); + m_cardType->setValue(""); return; } @@ -3621,51 +3613,51 @@ void DVBConfigurationGroup::probeCard(const QString &videodevice) switch (CardUtil::toInputType(subtype)) { case CardUtil::ERROR_OPEN: - cardname->setValue(err_open); - cardtype->setValue(strerror(errno)); + m_cardName->setValue(err_open); + m_cardType->setValue(strerror(errno)); break; case CardUtil::ERROR_UNKNOWN: - cardname->setValue(err_other); - cardtype->setValue("Unknown error"); + m_cardName->setValue(err_other); + m_cardType->setValue("Unknown error"); break; case CardUtil::ERROR_PROBE: - cardname->setValue(err_other); - cardtype->setValue(strerror(errno)); + m_cardName->setValue(err_other); + m_cardType->setValue(strerror(errno)); break; case CardUtil::QPSK: - cardtype->setValue("DVB-S"); - cardname->setValue(frontend_name); - signal_timeout->setValue(7000); - channel_timeout->setValue(10000); + m_cardType->setValue("DVB-S"); + m_cardName->setValue(frontend_name); + m_signalTimeout->setValue(7000); + m_channelTimeout->setValue(10000); break; case CardUtil::DVBS2: - cardtype->setValue("DVB-S2"); - cardname->setValue(frontend_name); - signal_timeout->setValue(7000); - channel_timeout->setValue(10000); + m_cardType->setValue("DVB-S2"); + m_cardName->setValue(frontend_name); + m_signalTimeout->setValue(7000); + m_channelTimeout->setValue(10000); break; case CardUtil::QAM: - cardtype->setValue("DVB-C"); - cardname->setValue(frontend_name); - signal_timeout->setValue(1000); - channel_timeout->setValue(3000); + m_cardType->setValue("DVB-C"); + m_cardName->setValue(frontend_name); + m_signalTimeout->setValue(1000); + m_channelTimeout->setValue(3000); break; case CardUtil::DVBT2: - cardtype->setValue("DVB-T2"); - cardname->setValue(frontend_name); - signal_timeout->setValue(1000); - channel_timeout->setValue(3000); + m_cardType->setValue("DVB-T2"); + m_cardName->setValue(frontend_name); + m_signalTimeout->setValue(1000); + m_channelTimeout->setValue(3000); break; case CardUtil::OFDM: { - cardtype->setValue("DVB-T"); - cardname->setValue(frontend_name); - signal_timeout->setValue(1000); - channel_timeout->setValue(3000); + m_cardType->setValue("DVB-T"); + m_cardName->setValue(frontend_name); + m_signalTimeout->setValue(1000); + m_channelTimeout->setValue(3000); if (frontend_name.toLower().indexOf("usb") >= 0) { - signal_timeout->setValue(40000); - channel_timeout->setValue(42500); + m_signalTimeout->setValue(40000); + m_channelTimeout->setValue(42500); } // slow down tuning for buggy drivers @@ -3673,12 +3665,12 @@ void DVBConfigurationGroup::probeCard(const QString &videodevice) (frontend_name == "TerraTec/qanu USB2.0 Highspeed DVB-T Receiver")) { - tuning_delay->setValue(200); + m_tuningDelay->setValue(200); } #if 0 // frontends on hybrid DVB-T/Analog cards QString short_name = remove_chaff(frontend_name); - buttonAnalog->setVisible( + m_buttonAnalog->setVisible( short_name.startsWith("zarlink zl10353", Qt::CaseInsensitive) || short_name.startsWith("wintv hvr 900 m/r: 65008/a1c0", @@ -3691,23 +3683,23 @@ void DVBConfigurationGroup::probeCard(const QString &videodevice) case CardUtil::ATSC: { QString short_name = remove_chaff(frontend_name); - cardtype->setValue("ATSC"); - cardname->setValue(short_name); - signal_timeout->setValue(500); - channel_timeout->setValue(3000); + m_cardType->setValue("ATSC"); + m_cardName->setValue(short_name); + m_signalTimeout->setValue(500); + m_channelTimeout->setValue(3000); // According to #1779 and #1935 the AverMedia 180 needs // a 3000 ms signal timeout, at least for QAM tuning. if (frontend_name == "Nextwave NXT200X VSB/QAM frontend") { - signal_timeout->setValue(3000); - channel_timeout->setValue(5500); + m_signalTimeout->setValue(3000); + m_channelTimeout->setValue(5500); } #if 0 // frontends on hybrid DVB-T/Analog cards if (frontend_name.toLower().indexOf("usb") < 0) { - buttonAnalog->setVisible( + m_buttonAnalog->setVisible( short_name.startsWith("pchdtv", Qt::CaseInsensitive) || short_name.startsWith("dvico", Qt::CaseInsensitive) || short_name.startsWith("nextwave", Qt::CaseInsensitive)); @@ -3719,14 +3711,14 @@ void DVBConfigurationGroup::probeCard(const QString &videodevice) break; } #else - cardtype->setValue(QString("Recompile with DVB-Support!")); + m_cardType->setValue(QString("Recompile with DVB-Support!")); #endif } TunerCardAudioInput::TunerCardAudioInput(const CaptureCard &parent, QString dev, QString type) : CaptureCardComboBoxSetting(parent, false, "audiodevice"), - last_device(dev), last_cardtype(type) + m_lastDevice(dev), m_lastCardType(type) { setLabel(QObject::tr("Audio input")); setHelpText(QObject::tr("If there is more than one audio input, " @@ -3735,8 +3727,8 @@ TunerCardAudioInput::TunerCardAudioInput(const CaptureCard &parent, if (cardid <= 0) return; - last_cardtype = CardUtil::GetRawInputType(cardid); - last_device = CardUtil::GetAudioDevice(cardid); + m_lastCardType = CardUtil::GetRawInputType(cardid); + m_lastDevice = CardUtil::GetAudioDevice(cardid); } int TunerCardAudioInput::fillSelections(const QString &device) @@ -3746,89 +3738,89 @@ int TunerCardAudioInput::fillSelections(const QString &device) if (device.isEmpty()) return 0; - last_device = device; + m_lastDevice = device; QStringList inputs = - CardUtil::ProbeAudioInputs(device, last_cardtype); + CardUtil::ProbeAudioInputs(device, m_lastCardType); for (uint i = 0; i < (uint)inputs.size(); i++) { addSelection(inputs[i], QString::number(i), - last_device == QString::number(i)); + m_lastDevice == QString::number(i)); } return inputs.size(); } DVBConfigurationGroup::DVBConfigurationGroup(CaptureCard& a_parent, CardType& cardType) : - parent(a_parent), - diseqc_tree(new DiSEqCDevTree()) + m_parent(a_parent), + m_diseqcTree(new DiSEqCDevTree()) { setVisible(false); - cardnum = new DVBCardNum(parent); - cardname = new DVBCardName(); - cardtype = new DVBCardType(); + m_cardNum = new DVBCardNum(m_parent); + m_cardName = new DVBCardName(); + m_cardType = new DVBCardType(); - signal_timeout = new SignalTimeout(parent, 500, 250); - channel_timeout = new ChannelTimeout(parent, 3000, 1750); + m_signalTimeout = new SignalTimeout(m_parent, 500, 250); + m_channelTimeout = new ChannelTimeout(m_parent, 3000, 1750); - cardType.addTargetedChild("DVB", cardnum); + cardType.addTargetedChild("DVB", m_cardNum); - cardType.addTargetedChild("DVB", cardname); - cardType.addTargetedChild("DVB", cardtype); + cardType.addTargetedChild("DVB", m_cardName); + cardType.addTargetedChild("DVB", m_cardType); - cardType.addTargetedChild("DVB", signal_timeout); - cardType.addTargetedChild("DVB", channel_timeout); + cardType.addTargetedChild("DVB", m_signalTimeout); + cardType.addTargetedChild("DVB", m_channelTimeout); - cardType.addTargetedChild("DVB", new EmptyAudioDevice(parent)); - cardType.addTargetedChild("DVB", new EmptyVBIDevice(parent)); + cardType.addTargetedChild("DVB", new EmptyAudioDevice(m_parent)); + cardType.addTargetedChild("DVB", new EmptyVBIDevice(m_parent)); - cardType.addTargetedChild("DVB", new DVBNoSeqStart(parent)); - cardType.addTargetedChild("DVB", new DVBOnDemand(parent)); - cardType.addTargetedChild("DVB", new DVBEITScan(parent)); + cardType.addTargetedChild("DVB", new DVBNoSeqStart(m_parent)); + cardType.addTargetedChild("DVB", new DVBOnDemand(m_parent)); + cardType.addTargetedChild("DVB", new DVBEITScan(m_parent)); - diseqc_btn = new DeviceTree(*diseqc_tree); - diseqc_btn->setLabel(tr("DiSEqC (Switch, LNB, and Rotor Configuration)")); - diseqc_btn->setHelpText(tr("Input and satellite settings.")); - diseqc_btn->setVisible(false); + m_diseqcBtn = new DeviceTree(*m_diseqcTree); + m_diseqcBtn->setLabel(tr("DiSEqC (Switch, LNB, and Rotor Configuration)")); + m_diseqcBtn->setHelpText(tr("Input and satellite settings.")); + m_diseqcBtn->setVisible(false); - tuning_delay = new DVBTuningDelay(parent); - cardType.addTargetedChild("DVB", tuning_delay); - cardType.addTargetedChild("DVB", diseqc_btn); - tuning_delay->setVisible(false); + m_tuningDelay = new DVBTuningDelay(m_parent); + cardType.addTargetedChild("DVB", m_tuningDelay); + cardType.addTargetedChild("DVB", m_diseqcBtn); + m_tuningDelay->setVisible(false); - connect(cardnum, SIGNAL(valueChanged(const QString&)), + connect(m_cardNum, SIGNAL(valueChanged(const QString&)), this, SLOT( probeCard (const QString&))); - connect(cardnum, SIGNAL(valueChanged(const QString&)), + connect(m_cardNum, SIGNAL(valueChanged(const QString&)), this, SLOT( reloadDiseqcTree(const QString&))); } DVBConfigurationGroup::~DVBConfigurationGroup() { - if (diseqc_tree) + if (m_diseqcTree) { - delete diseqc_tree; - diseqc_tree = nullptr; + delete m_diseqcTree; + m_diseqcTree = nullptr; } } void DVBConfigurationGroup::Load(void) { - reloadDiseqcTree(cardnum->getValue()); - diseqc_btn->Load(); + reloadDiseqcTree(m_cardNum->getValue()); + m_diseqcBtn->Load(); GroupSetting::Load(); - if (cardtype->getValue() == "DVB-S" || - cardtype->getValue() == "DVB-S2" || - DiSEqCDevTree::Exists(parent.getCardID())) + if (m_cardType->getValue() == "DVB-S" || + m_cardType->getValue() == "DVB-S2" || + DiSEqCDevTree::Exists(m_parent.getCardID())) { - diseqc_btn->setVisible(true); + m_diseqcBtn->setVisible(true); } } void DVBConfigurationGroup::Save(void) { GroupSetting::Save(); - diseqc_tree->Store(parent.getCardID(), cardnum->getValue()); + m_diseqcTree->Store(m_parent.getCardID(), m_cardNum->getValue()); DiSEqCDev trees; trees.InvalidateTrees(); } diff --git a/mythtv/libs/libmythtv/videosource.h b/mythtv/libs/libmythtv/videosource.h index 707505820ac..5b2ec39f0f9 100644 --- a/mythtv/libs/libmythtv/videosource.h +++ b/mythtv/libs/libmythtv/videosource.h @@ -67,9 +67,9 @@ class VideoSourceSelector : public TransMythUIComboBoxSetting uint GetSourceID(void) const { return getValue().toUInt(); } private: - uint initial_sourceid; - QString card_types; - bool must_have_mplexid; + uint m_initialSourceId; + QString m_cardTypes; + bool m_mustHaveMplexId; }; class FreqTableSelector : @@ -95,8 +95,8 @@ class TransFreqTableSelector : public TransMythUIComboBoxSetting void SetSourceID(uint _sourceid); private: - uint sourceid; - QString loaded_freq_table; + uint m_sourceId; + QString m_LoadedFreqTable; }; class XMLTV_generic_config: public GroupSetting @@ -114,9 +114,9 @@ class XMLTV_generic_config: public GroupSetting void RunConfig(void); protected: - const VideoSource &parent; - QString grabber; - QStringList grabberArgs; + const VideoSource &m_parent; + QString m_grabber; + QStringList m_grabberArgs; }; class EITOnly_config: public GroupSetting @@ -128,7 +128,7 @@ class EITOnly_config: public GroupSetting virtual void Save(QString) { Save(); } protected: - UseEIT *useeit; + UseEIT *m_useeit {nullptr}; }; class NoGrabber_config: public GroupSetting @@ -140,7 +140,7 @@ class NoGrabber_config: public GroupSetting virtual void Save(QString) { Save(); } protected: - UseEIT *useeit; + UseEIT *m_useeit {nullptr}; }; class IdSetting : public AutoIncrementSetting { @@ -163,7 +163,7 @@ class VideoSource : public GroupSetting { public: VideoSource(); - int getSourceID(void) const { return id->intValue(); }; + int getSourceID(void) const { return m_id->intValue(); }; void loadByID(int id); @@ -171,7 +171,7 @@ class VideoSource : public GroupSetting { static void fillSelections(MythUIComboBoxSetting* setting); static QString idToName(int id); - QString getSourceName(void) const { return name->getValue(); }; + QString getSourceName(void) const { return m_name->getValue(); }; void Load(void) override // StandardSetting { @@ -180,7 +180,7 @@ class VideoSource : public GroupSetting { void Save(void) override // StandardSetting { - if (name) + if (m_name) GroupSetting::Save(); } bool canDelete(void) override; // GroupSetting @@ -206,8 +206,8 @@ class VideoSource : public GroupSetting { }; private: - ID *id; - Name *name; + ID *m_id {nullptr}; + Name *m_name {nullptr}; }; class CaptureCardDBStorage : public SimpleDBStorage @@ -253,8 +253,8 @@ class TunerCardAudioInput : public CaptureCardComboBoxSetting int fillSelections(const QString &device); private: - QString last_device; - QString last_cardtype; + QString m_lastDevice; + QString m_lastCardType; }; class EmptyAudioDevice : public MythUITextEditSetting @@ -344,9 +344,9 @@ class HDHomeRunConfigurationGroup : public GroupSetting void FillDeviceList(void); private: - CaptureCard &parent; - HDHomeRunDeviceID *deviceid; - HDHomeRunDeviceList devicelist; + CaptureCard &m_parent; + HDHomeRunDeviceID *m_deviceId {nullptr}; + HDHomeRunDeviceList m_deviceList; }; class HDHomeRunDeviceID : public MythUITextEditSetting @@ -395,13 +395,13 @@ class VBoxConfigurationGroup : public GroupSetting void FillDeviceList(void); private: - CaptureCard &parent; - StandardSetting *desc; - VBoxDeviceIDList *deviceidlist; - VBoxDeviceID *deviceid; - VBoxIP *cardip; - VBoxTunerIndex *cardtuner; - VBoxDeviceList devicelist; + CaptureCard &m_parent; + StandardSetting *m_desc {nullptr}; + VBoxDeviceIDList *m_deviceIdList {nullptr}; + VBoxDeviceID *m_deviceId {nullptr}; + VBoxIP *m_cardIp {nullptr}; + VBoxTunerIndex *m_cardTuner {nullptr}; + VBoxDeviceList m_deviceList; }; class V4LConfigurationGroup : public GroupSetting @@ -415,9 +415,9 @@ class V4LConfigurationGroup : public GroupSetting void probeCard(const QString &device); private: - CaptureCard &parent; - TransTextEditSetting *cardinfo; - VBIDevice *vbidev; + CaptureCard &m_parent; + TransTextEditSetting *m_cardInfo {nullptr}; + VBIDevice *m_vbiDev {nullptr}; }; class VideoDevice; @@ -434,10 +434,10 @@ class MPEGConfigurationGroup: public GroupSetting void probeCard(const QString &device); private: - CaptureCard &parent; - VideoDevice *device; - VBIDevice *vbidevice; - TransTextEditSetting *cardinfo; + CaptureCard &m_parent; + VideoDevice *m_device {nullptr}; + VBIDevice *m_vbiDevice {nullptr}; + TransTextEditSetting *m_cardInfo {nullptr}; }; class HDPVRConfigurationGroup: public GroupSetting @@ -451,10 +451,10 @@ class HDPVRConfigurationGroup: public GroupSetting void probeCard(const QString &device); private: - CaptureCard &parent; - GroupSetting *cardinfo; - TunerCardAudioInput *audioinput; - VBIDevice *vbidevice; + CaptureCard &m_parent; + GroupSetting *m_cardInfo {nullptr}; + TunerCardAudioInput *m_audioInput {nullptr}; + VBIDevice *m_vbiDevice {nullptr}; }; class ASIDevice; @@ -468,10 +468,10 @@ class V4L2encGroup: public GroupSetting private: CaptureCard &m_parent; - TransTextEditSetting *m_cardinfo; - VideoDevice *m_device; + TransTextEditSetting *m_cardInfo {nullptr}; + VideoDevice *m_device {nullptr}; - QString m_DriverName; + QString m_DriverName; protected slots: void probeCard(const QString &device); @@ -488,9 +488,9 @@ class ASIConfigurationGroup: public GroupSetting void probeCard(const QString &device); private: - CaptureCard &parent; - ASIDevice *device; - TransTextEditSetting *cardinfo; + CaptureCard &m_parent; + ASIDevice *m_device {nullptr}; + TransTextEditSetting *m_cardInfo {nullptr}; }; class ImportConfigurationGroup: public GroupSetting @@ -504,9 +504,9 @@ class ImportConfigurationGroup: public GroupSetting void probeCard(const QString &device); private: - CaptureCard &parent; - TransTextEditSetting *info; - TransTextEditSetting *size; + CaptureCard &m_parent; + TransTextEditSetting *m_info {nullptr}; + TransTextEditSetting *m_size {nullptr}; }; class DemoConfigurationGroup: public GroupSetting @@ -520,9 +520,9 @@ class DemoConfigurationGroup: public GroupSetting void probeCard(const QString &device); private: - CaptureCard &parent; - TransTextEditSetting *info; - TransTextEditSetting *size; + CaptureCard &m_parent; + TransTextEditSetting *m_info {nullptr}; + TransTextEditSetting *m_size {nullptr}; }; #if !defined( USING_MINGW ) && !defined( _MSC_VER ) @@ -537,8 +537,8 @@ class ExternalConfigurationGroup: public GroupSetting void probeApp(const QString & path); private: - CaptureCard &parent; - TransTextEditSetting *info; + CaptureCard &m_parent; + TransTextEditSetting *m_info {nullptr}; }; #endif @@ -566,19 +566,19 @@ class DVBConfigurationGroup : public GroupSetting void reloadDiseqcTree(const QString &device); private: - CaptureCard &parent; + CaptureCard &m_parent; - DVBCardNum *cardnum; - DVBCardName *cardname; - DVBCardType *cardtype; - SignalTimeout *signal_timeout; - ChannelTimeout *channel_timeout; + DVBCardNum *m_cardNum {nullptr}; + DVBCardName *m_cardName {nullptr}; + DVBCardType *m_cardType {nullptr}; + SignalTimeout *m_signalTimeout {nullptr}; + ChannelTimeout *m_channelTimeout {nullptr}; #if 0 - TransButtonSetting *buttonAnalog; + TransButtonSetting *m_buttonAnalog {nullptr}; #endif - DVBTuningDelay *tuning_delay; - DiSEqCDevTree *diseqc_tree; - DeviceTree *diseqc_btn; + DVBTuningDelay *m_tuningDelay {nullptr}; + DiSEqCDevTree *m_diseqcTree {nullptr}; + DeviceTree *m_diseqcBtn {nullptr}; }; class FirewireGUID; @@ -593,7 +593,7 @@ class FirewireModel : public CaptureCardComboBoxSetting void SetGUID(const QString&); private: - const FirewireGUID *guid; + const FirewireGUID *m_guid {nullptr}; }; class FirewireDesc : public GroupSetting @@ -602,13 +602,13 @@ class FirewireDesc : public GroupSetting public: explicit FirewireDesc(const FirewireGUID *_guid) : - GroupSetting(), guid(_guid) { } + GroupSetting(), m_guid(_guid) { } public slots: void SetGUID(const QString&); private: - const FirewireGUID *guid; + const FirewireGUID *m_guid {nullptr}; }; class CaptureCardGroup : public GroupSetting @@ -624,7 +624,7 @@ class CaptureCard : public GroupSetting public: explicit CaptureCard(bool use_card_group = true); - int getCardID(void) const { return id->intValue(); } + int getCardID(void) const { return m_id->intValue(); } QString GetRawCardType(void) const; void loadByID(int id); @@ -662,7 +662,7 @@ class CaptureCard : public GroupSetting }; private: - ID *id; + ID *m_id {nullptr}; }; class CardInputDBStorage : public SimpleDBStorage @@ -755,7 +755,7 @@ class MTV_PUBLIC CardInputEditor : public GroupSetting void Load(void) override; // StandardSetting private: - vector cardinputs; + vector m_cardInputs; }; class StartingChannel : public MythUIComboBoxSetting @@ -784,7 +784,7 @@ class CardInput : public GroupSetting int cardid); ~CardInput(); - int getInputID(void) const { return id->intValue(); }; + int getInputID(void) const { return m_id->intValue(); }; void loadByID(int id); void loadByInput(int cardid, QString input); @@ -809,17 +809,17 @@ class CardInput : public GroupSetting } }; - ID *id; - InputName *inputname; - SourceID *sourceid; - StartingChannel *startchan; - ButtonStandardSetting *scan; - ButtonStandardSetting *srcfetch; - DiSEqCDevSettings *externalInputSettings; - InputGroup *inputgrp0; - InputGroup *inputgrp1; - MythUISpinBoxSetting *instancecount; - MythUICheckBoxSetting *schedgroup; + ID *m_id {nullptr}; + InputName *m_inputName {nullptr}; + SourceID *m_sourceId {nullptr}; + StartingChannel *m_startChan {nullptr}; + ButtonStandardSetting *m_scan {nullptr}; + ButtonStandardSetting *m_srcFetch {nullptr}; + DiSEqCDevSettings *m_externalInputSettings {nullptr}; + InputGroup *m_inputGrp0 {nullptr}; + InputGroup *m_inputGrp1 {nullptr}; + MythUISpinBoxSetting *m_instanceCount {nullptr}; + MythUICheckBoxSetting *m_schedGroup {nullptr}; }; /// @@ -835,7 +835,7 @@ class VBoxIP : public MythUITextEditSetting void setEnabled(bool e) override; // StandardSetting void SetOldValue(const QString &s) - { _oldValue = s; }; + { m_oldValue = s; }; signals: void NewIP(const QString&); @@ -844,7 +844,7 @@ class VBoxIP : public MythUITextEditSetting void UpdateDevices(const QString&); private: - QString _oldValue; + QString m_oldValue; }; class VBoxTunerIndex : public MythUITextEditSetting @@ -856,7 +856,7 @@ class VBoxTunerIndex : public MythUITextEditSetting void setEnabled(bool e) override; // StandardSetting void SetOldValue(const QString &s) - { _oldValue = s; }; + { m_oldValue = s; }; signals: void NewTuner(const QString&); @@ -865,7 +865,7 @@ class VBoxTunerIndex : public MythUITextEditSetting void UpdateDevices(const QString&); private: - QString _oldValue; + QString m_oldValue; }; class VBoxDeviceIDList : public TransMythUIComboBoxSetting @@ -888,14 +888,14 @@ class VBoxDeviceIDList : public TransMythUIComboBoxSetting void UpdateDevices(const QString&); private: - VBoxDeviceID *_deviceid; - StandardSetting *_desc; - VBoxIP *_cardip; - VBoxTunerIndex *_cardtuner; - VBoxDeviceList *_devicelist; + VBoxDeviceID *m_deviceId; + StandardSetting *m_desc; + VBoxIP *m_cardIp; + VBoxTunerIndex *m_cardTuner; + VBoxDeviceList *m_deviceList; const CaptureCard &m_parent; - QString _oldValue; + QString m_oldValue; }; class VBoxDeviceID : public MythUITextEditSetting @@ -913,9 +913,9 @@ class VBoxDeviceID : public MythUITextEditSetting void SetOverrideDeviceID(const QString&); private: - QString _ip; - QString _tuner; - QString _overridedeviceid; + QString m_ip; + QString m_tuner; + QString m_overrideDeviceId; }; class CetonSetting : public TransTextEditSetting @@ -953,10 +953,10 @@ class CetonDeviceID : public MythUITextEditSetting void SetTuner(const QString&); private: - QString _ip; - QString _card; - QString _tuner; - const CaptureCard &_parent; + QString m_ip; + QString m_card; + QString m_tuner; + const CaptureCard &m_parent; }; #endif diff --git a/mythtv/libs/libmythtv/vsync.cpp b/mythtv/libs/libmythtv/vsync.cpp index 4feb3edbb15..e5d7246ce4b 100644 --- a/mythtv/libs/libmythtv/vsync.cpp +++ b/mythtv/libs/libmythtv/vsync.cpp @@ -113,8 +113,7 @@ VideoSync *VideoSync::BestMethod(VideoOutput *video_output, * video synchronization method. */ VideoSync::VideoSync(VideoOutput *video_output, int refreshint) : - m_video_output(video_output), m_refresh_interval(refreshint), - m_nexttrigger(0), m_delay(-1) + m_video_output(video_output), m_refresh_interval(refreshint) { } @@ -212,7 +211,7 @@ static int drmWaitVBlank(int fd, drm_wait_vblank_t *vbl) return ret; } -const char *DRMVideoSync::sm_dri_dev = "/dev/dri/card0"; +const char *DRMVideoSync::s_dri_dev = "/dev/dri/card0"; DRMVideoSync::DRMVideoSync(VideoOutput *vo, int ri) : VideoSync(vo, ri) @@ -231,12 +230,12 @@ bool DRMVideoSync::TryInit(void) { drm_wait_vblank_t blank; - m_dri_fd = open(sm_dri_dev, O_RDWR); + m_dri_fd = open(s_dri_dev, O_RDWR); if (m_dri_fd < 0) { LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("DRMVideoSync: Could not open device %1, %2") - .arg(sm_dri_dev).arg(strerror(errno))); + .arg(s_dri_dev).arg(strerror(errno))); return false; // couldn't open device } @@ -368,18 +367,6 @@ int RTCVideoSync::WaitForFrame(int nominal_frame_interval, int extra_delay) } #endif /* __linux__ */ -BusyWaitVideoSync::BusyWaitVideoSync(VideoOutput *vo, int ri) : - VideoSync(vo, ri) -{ - m_cheat = 5000; - m_fudge = 0; -} - -bool BusyWaitVideoSync::TryInit(void) -{ - return true; -} - int BusyWaitVideoSync::WaitForFrame(int nominal_frame_interval, int extra_delay) { // Offset for externally-provided A/V sync delay @@ -412,16 +399,6 @@ int BusyWaitVideoSync::WaitForFrame(int nominal_frame_interval, int extra_delay) return 0; } -USleepVideoSync::USleepVideoSync(VideoOutput *vo, int ri) : - VideoSync(vo, ri) -{ -} - -bool USleepVideoSync::TryInit(void) -{ - return true; -} - int USleepVideoSync::WaitForFrame(int nominal_frame_interval, int extra_delay) { // Offset for externally-provided A/V sync delay diff --git a/mythtv/libs/libmythtv/vsync.h b/mythtv/libs/libmythtv/vsync.h index f33aee4e38c..96ee8602325 100644 --- a/mythtv/libs/libmythtv/vsync.h +++ b/mythtv/libs/libmythtv/vsync.h @@ -95,12 +95,12 @@ class VideoSync int64_t GetTime(void); int CalcDelay(int nominal_frame_interval); - VideoOutput *m_video_output; - int m_refresh_interval; // of display - int64_t m_nexttrigger; - int m_delay; + VideoOutput *m_video_output {nullptr}; + int m_refresh_interval; // of display + int64_t m_nexttrigger {0}; + int m_delay {-1}; - static int s_forceskip; + static int s_forceskip; }; #ifndef _WIN32 @@ -124,7 +124,7 @@ class DRMVideoSync : public VideoSync private: int m_dri_fd; - static const char *sm_dri_dev; + static const char *s_dri_dev; }; #endif // !_WIN32 @@ -169,17 +169,17 @@ class RTCVideoSync : public VideoSync class BusyWaitVideoSync : public VideoSync { public: - BusyWaitVideoSync(VideoOutput *, int refresh_interval); + BusyWaitVideoSync(VideoOutput *vo, int ri) : VideoSync(vo, ri) {}; ~BusyWaitVideoSync() = default; QString getName(void) const override // VideoSync { return QString("USleep with busy wait"); } - bool TryInit(void) override; // VideoSync + bool TryInit(void) override {return true; } // VideoSync int WaitForFrame(int nominal_frame_interval, int extra_delay) override; // VideoSync private: - int m_cheat; - int m_fudge; + int m_cheat {5000}; + int m_fudge {0}; }; /** \brief Video synchronization classes employing only usleep(). @@ -195,12 +195,12 @@ class BusyWaitVideoSync : public VideoSync class USleepVideoSync : public VideoSync { public: - USleepVideoSync(VideoOutput *, int refresh_interval); + USleepVideoSync(VideoOutput *vo, int ri) : VideoSync(vo, ri) {} ~USleepVideoSync() = default; QString getName(void) const override // VideoSync { return QString("USleep"); } - bool TryInit(void) override; // VideoSync + bool TryInit(void) override {return true; } // VideoSync int WaitForFrame(int nominal_frame_interval, int extra_delay) override; // VideoSync };