diff --git a/mythtv/libs/libmythtv/recorders/DeviceReadBuffer.cpp b/mythtv/libs/libmythtv/recorders/DeviceReadBuffer.cpp index d05d3636da6..fbc7c7df64a 100644 --- a/mythtv/libs/libmythtv/recorders/DeviceReadBuffer.cpp +++ b/mythtv/libs/libmythtv/recorders/DeviceReadBuffer.cpp @@ -1,5 +1,4 @@ #include -using namespace std; #include "DeviceReadBuffer.h" #include "mythcorecontext.h" @@ -70,10 +69,10 @@ bool DeviceReadBuffer::Setup(const QString &streamName, int streamfd, m_used = 0; m_devReadSize = m_readQuanta * (m_usingPoll ? 256 : 48); m_devReadSize = (deviceBufferSize) ? - min(m_devReadSize, (size_t)deviceBufferSize) : m_devReadSize; + std::min(m_devReadSize, (size_t)deviceBufferSize) : m_devReadSize; m_readThreshold = m_readQuanta * 128; - m_buffer = new (nothrow) unsigned char[m_size + m_devReadSize]; + m_buffer = new (std::nothrow) unsigned char[m_size + m_devReadSize]; m_readPtr = m_buffer; m_writePtr = m_buffer; @@ -346,7 +345,7 @@ void DeviceReadBuffer::run(void) { // Limit read size for faster return from read auto unused = static_cast(WaitForUnused(m_readQuanta)); - size_t read_size = min(m_devReadSize, unused); + size_t read_size = std::min(m_devReadSize, unused); // if read_size > 0 do the read... if (read_size) @@ -447,7 +446,7 @@ bool DeviceReadBuffer::Poll(void) const timeout = 10; else if (m_pollTimeoutIsError) // subtract a bit to allow processing time. - timeout = max((int)m_maxPollWait - timer.elapsed() - 15, 10); + timeout = std::max((int)m_maxPollWait - timer.elapsed() - 15, 10); int ret = poll(polls.data(), poll_cnt, timeout); @@ -614,8 +613,8 @@ bool DeviceReadBuffer::CheckForErrors( */ uint DeviceReadBuffer::Read(unsigned char *buf, const uint count) { - uint avail = WaitForUsed(min(count, (uint)m_readThreshold), 20); - size_t cnt = min(count, avail); + uint avail = WaitForUsed(std::min(count, (uint)m_readThreshold), 20); + size_t cnt = std::min(count, avail); if (!cnt) return 0; diff --git a/mythtv/libs/libmythtv/recorders/ExternalChannel.h b/mythtv/libs/libmythtv/recorders/ExternalChannel.h index 7645d318ac4..518a46bee6e 100644 --- a/mythtv/libs/libmythtv/recorders/ExternalChannel.h +++ b/mythtv/libs/libmythtv/recorders/ExternalChannel.h @@ -6,7 +6,6 @@ #include #include #include -using namespace std; // Qt headers #include diff --git a/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp b/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp index 04000b32431..db16022ead6 100644 --- a/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp +++ b/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.cpp @@ -410,7 +410,7 @@ void ExternIO::Fork(void) { std::cerr << "ExternIO: " << "setpgid() failed: " - << strerror(errno) << endl; + << strerror(errno) << std::endl; } /* run command */ @@ -431,13 +431,13 @@ void ExternIO::Fork(void) // Can't use LOG due to locking fun. std::cerr << "ExternIO: " << "execv() failed: " - << strerror(errno) << endl; + << strerror(errno) << std::endl; } else { std::cerr << "ExternIO: " << "execv() should not be here?: " - << strerror(errno) << endl; + << strerror(errno) << std::endl; } #endif // !defined( USING_MINGW ) && !defined( _MSC_VER ) @@ -866,7 +866,7 @@ bool ExternalStreamHandler::SetAPIVersion(void) if (tokens.size() > 1) m_apiVersion = tokens[1].toUInt(); - m_apiVersion = min(m_apiVersion, static_cast(MAX_API_VERSION)); + m_apiVersion = std::min(m_apiVersion, static_cast(MAX_API_VERSION)); if (m_apiVersion < 1) { LOG(VB_RECORD, LOG_ERR, LOC + diff --git a/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.h b/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.h index cd1c03e7ef8..3acd38feaa3 100644 --- a/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.h +++ b/mythtv/libs/libmythtv/recorders/ExternalStreamHandler.h @@ -5,7 +5,6 @@ #include #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp index 66f5517354b..48f18cd9ca7 100644 --- a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.cpp @@ -18,7 +18,6 @@ #include #include -using namespace std; #include "mythmiscutil.h" #include "mythcontext.h" @@ -86,7 +85,7 @@ NuppelVideoRecorder::NuppelVideoRecorder(TVRec *rec, ChannelBase *channel) : V4LRecorder(rec) { m_channelObj = channel; - m_seekTable = new vector; + m_seekTable = new std::vector; m_ccd = new CC608Decoder(this); SetPositionMapType(MARK_KEYFRAME); @@ -2059,7 +2058,7 @@ void NuppelVideoRecorder::WriteSeekTable(void) } void NuppelVideoRecorder::WriteKeyFrameAdjustTable( - const vector &kfa_table) + const std::vector &kfa_table) { int numentries = kfa_table.size(); @@ -2248,7 +2247,7 @@ void NuppelVideoRecorder::doAudioThread(void) (like we used to.) Measure to see how much stuff is in there, and correct for it when calculating the timestamp */ gettimeofday(&anow, &m_tzone); - int bytes_read = max(m_audioDevice->GetNumReadyBytes(), 0); + int bytes_read = std::max(m_audioDevice->GetNumReadyBytes(), 0); int act = m_actAudioBuffer; @@ -2436,7 +2435,7 @@ void NuppelVideoRecorder::FormatTT(struct VBIData *vbidata) break; memcpy(outpos, &st, sizeof(st)); outpos += sizeof(st); - int count = max(st.len, static_cast(41)); + int count = std::max(st.len, static_cast(41)); std::copy(linebuf.cbegin(), linebuf.cbegin() + count, outpos); outpos += count; *outpos = 0; diff --git a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h index c02377c156a..5917369bd1a 100644 --- a/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h +++ b/mythtv/libs/libmythtv/recorders/NuppelVideoRecorder.h @@ -23,7 +23,6 @@ extern "C" { #include #include #include -using namespace std; // Qt headers #include @@ -111,7 +110,7 @@ class MTV_PUBLIC NuppelVideoRecorder : public V4LRecorder, public CC608Input void WriteHeader(void); void WriteSeekTable(void); void WriteKeyFrameAdjustTable( - const vector &kfa_table); + const std::vector &kfa_table); void UpdateSeekTable(int frame_num, long offset = 0); bool SetupAVCodecVideo(void); @@ -190,14 +189,14 @@ class MTV_PUBLIC NuppelVideoRecorder : public V4LRecorder, public CC608Input RTjpeg *m_rtjc {nullptr}; #define OUT_LEN (1024*1024 + 1024*1024 / 64 + 16 + 3) - array m_out {}; + std::array m_out {}; #define HEAP_ALLOC(var,size) \ std::array __LZO_MMODEL var HEAP_ALLOC(wrkmem, LZO1X_1_MEM_COMPRESS) {}; - vector m_videoBuffer; - vector m_audioBuffer; - vector m_textBuffer; + std::vector m_videoBuffer; + std::vector m_audioBuffer; + std::vector m_textBuffer; int m_actVideoEncode {0}; int m_actVideoBuffer {0}; @@ -226,7 +225,7 @@ class MTV_PUBLIC NuppelVideoRecorder : public V4LRecorder, public CC608Input bool m_recording {false}; int m_keyframeDist {KEYFRAMEDIST}; - vector *m_seekTable {nullptr}; + std::vector *m_seekTable {nullptr}; long long m_lastPositionMapPos {0}; long long m_extendedDataOffset {0}; diff --git a/mythtv/libs/libmythtv/recorders/asichannel.h b/mythtv/libs/libmythtv/recorders/asichannel.h index 7088933b2c8..7d1b0279649 100644 --- a/mythtv/libs/libmythtv/recorders/asichannel.h +++ b/mythtv/libs/libmythtv/recorders/asichannel.h @@ -4,7 +4,6 @@ #define ASI_CHANNEL_H #include -using namespace std; // Qt headers #include @@ -34,13 +33,13 @@ class ASIChannel : public DTVChannel { return m_isOpen; } QString GetDevice(void) const override // ChannelBase { return m_device; } - vector GetTunerTypes(void) const override // DTVChannel + std::vector GetTunerTypes(void) const override // DTVChannel { return m_tunerTypes; } bool IsPIDTuningSupported(void) const override // DTVChannel { return true; } private: - vector m_tunerTypes; + std::vector m_tunerTypes; QString m_device; bool m_isOpen {false}; }; diff --git a/mythtv/libs/libmythtv/recorders/asistreamhandler.h b/mythtv/libs/libmythtv/recorders/asistreamhandler.h index 3c1ff31dcde..0722de573a9 100644 --- a/mythtv/libs/libmythtv/recorders/asistreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/asistreamhandler.h @@ -4,7 +4,6 @@ #define ASISTREAMHANDLER_H #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/avcinfo.cpp b/mythtv/libs/libmythtv/recorders/avcinfo.cpp index 1d6fd900016..391e87cb0a5 100644 --- a/mythtv/libs/libmythtv/recorders/avcinfo.cpp +++ b/mythtv/libs/libmythtv/recorders/avcinfo.cpp @@ -45,8 +45,8 @@ bool AVCInfo::GetSubunitInfo(void) for (uint i = 0; i < 8; i++) { - vector cmd; - vector ret; + std::vector cmd; + std::vector ret; cmd.push_back(FirewireDevice::kAVCStatusInquiryCommand); cmd.push_back(FirewireDevice::kAVCSubunitTypeUnit | diff --git a/mythtv/libs/libmythtv/recorders/avcinfo.h b/mythtv/libs/libmythtv/recorders/avcinfo.h index 3b16348c0c3..1643acd9a69 100644 --- a/mythtv/libs/libmythtv/recorders/avcinfo.h +++ b/mythtv/libs/libmythtv/recorders/avcinfo.h @@ -5,7 +5,6 @@ #include #include #include -using namespace std; // Qt headers #include @@ -29,8 +28,8 @@ class AVCInfo virtual ~AVCInfo() = default; virtual bool SendAVCCommand( - const vector &/*cmd*/, - vector &/*result*/, + const std::vector &/*cmd*/, + std::vector &/*result*/, int /*retry_cnt*/) { return false; diff --git a/mythtv/libs/libmythtv/recorders/cetonchannel.h b/mythtv/libs/libmythtv/recorders/cetonchannel.h index 07c7e395628..f290f8b1c55 100644 --- a/mythtv/libs/libmythtv/recorders/cetonchannel.h +++ b/mythtv/libs/libmythtv/recorders/cetonchannel.h @@ -37,7 +37,7 @@ class CetonChannel : public DTVChannel bool IsOpen(void) const override; // ChannelBase QString GetDevice(void) const override // ChannelBase { return m_deviceId; } - vector GetTunerTypes(void) const override // DTVChannel + std::vector GetTunerTypes(void) const override // DTVChannel { return m_tunerTypes; } // Sets @@ -53,7 +53,7 @@ class CetonChannel : public DTVChannel private: QString m_deviceId; CetonStreamHandler *m_streamHandler {nullptr}; - vector m_tunerTypes; + std::vector m_tunerTypes; }; #endif diff --git a/mythtv/libs/libmythtv/recorders/channelbase.cpp b/mythtv/libs/libmythtv/recorders/channelbase.cpp index c4b79a29d3e..675b8bba248 100644 --- a/mythtv/libs/libmythtv/recorders/channelbase.cpp +++ b/mythtv/libs/libmythtv/recorders/channelbase.cpp @@ -11,7 +11,6 @@ // C++ headers #include #include -using namespace std; // Qt headers #include @@ -236,7 +235,7 @@ bool ChannelBase::IsInputAvailable( mplexid_restriction = 0; chanid_restriction = 0; - vector inputids = CardUtil::GetConflictingInputs(m_inputId); + std::vector inputids = CardUtil::GetConflictingInputs(m_inputId); for (uint inputid : inputids) { if (RemoteIsBusy(inputid, info)) diff --git a/mythtv/libs/libmythtv/recorders/darwinavcinfo.cpp b/mythtv/libs/libmythtv/recorders/darwinavcinfo.cpp index 5757e2cd22d..fea2e9924ad 100644 --- a/mythtv/libs/libmythtv/recorders/darwinavcinfo.cpp +++ b/mythtv/libs/libmythtv/recorders/darwinavcinfo.cpp @@ -6,7 +6,6 @@ // Std C++ headers #include -using namespace std; // MythTV headers #include "darwinfirewiredevice.h" @@ -114,8 +113,8 @@ void DarwinAVCInfo::Update(uint64_t _guid, DarwinFirewireDevice *dev, } bool DarwinAVCInfo::SendAVCCommand( - const vector &cmd, - vector &result, + const std::vector &cmd, + std::vector &result, int /*retry_cnt*/) { result.clear(); diff --git a/mythtv/libs/libmythtv/recorders/darwinavcinfo.h b/mythtv/libs/libmythtv/recorders/darwinavcinfo.h index 4ff6b00317c..c09300f92df 100644 --- a/mythtv/libs/libmythtv/recorders/darwinavcinfo.h +++ b/mythtv/libs/libmythtv/recorders/darwinavcinfo.h @@ -5,7 +5,6 @@ // C++ headers #include -using namespace std; // OS X headers #undef always_inline @@ -42,8 +41,8 @@ class DarwinAVCInfo : public AVCInfo void CloseDeviceInterface(void); bool SendAVCCommand( - const vector &cmd, - vector &result, + const std::vector &cmd, + std::vector &result, int retry_cnt) override; // AVCInfo bool GetDeviceNodes(int &local_node, int &remote_node); diff --git a/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.cpp b/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.cpp index 5f76bfd9053..eb15846e45d 100644 --- a/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.cpp +++ b/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.cpp @@ -22,7 +22,6 @@ // Std C++ headers #include #include -using namespace std; // MythTV headers #include "darwinfirewiredevice.h" @@ -329,7 +328,7 @@ bool DarwinFirewireDevice::OpenAVStream(void) int max_speed = GetMaxSpeed(); LOG(VB_GENERAL, LOG_INFO, LOC + QString("Max Speed: %1, Our speed: %2") .arg(max_speed).arg(m_speed)); - m_speed = min((uint)max_speed, m_speed); + m_speed = std::min((uint)max_speed, m_speed); uint fwchan = 0; bool streaming = IsSTBStreaming(&fwchan); @@ -499,8 +498,8 @@ bool DarwinFirewireDevice::StopStreaming(void) return true; } -bool DarwinFirewireDevice::SendAVCCommand(const vector &cmd, - vector &result, +bool DarwinFirewireDevice::SendAVCCommand(const std::vector &cmd, + std::vector &result, int retry_cnt) { return GetInfoPtr()->SendAVCCommand(cmd, result, retry_cnt); @@ -606,9 +605,9 @@ void DarwinFirewireDevice::ProcessStreamingMessage( } } -vector DarwinFirewireDevice::GetSTBList(void) +std::vector DarwinFirewireDevice::GetSTBList(void) { - vector list; + std::vector list; { DarwinFirewireDevice dev(0,0,0); @@ -627,7 +626,7 @@ vector DarwinFirewireDevice::GetSTBList(void) return list; } -vector DarwinFirewireDevice::GetSTBListPrivate(void) +std::vector DarwinFirewireDevice::GetSTBListPrivate(void) { #if 0 LOG(VB_GENERAL, LOG_DEBUG, LOC + "GetSTBListPrivate -- begin"); @@ -637,7 +636,7 @@ vector DarwinFirewireDevice::GetSTBListPrivate(void) LOG(VB_GENERAL, LOG_DEBUG, LOC + "GetSTBListPrivate -- got lock"); #endif - vector list; + std::vector list; for (auto dev : qAsConst(m_priv->m_devices)) { diff --git a/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.h b/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.h index 4720e56f887..98a3bfa8a80 100644 --- a/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.h +++ b/mythtv/libs/libmythtv/recorders/darwinfirewiredevice.h @@ -37,7 +37,7 @@ class DarwinFirewireDevice : public FirewireDevice bool IsPortOpen(void) const override; // FirewireDevice // Statics - static vector GetSTBList(void); + static std::vector GetSTBList(void); private: DarwinFirewireDevice(const DarwinFirewireDevice &) = delete; // not copyable @@ -54,8 +54,8 @@ class DarwinFirewireDevice : public FirewireDevice bool StopStreaming(void); bool SendAVCCommand( - const vector &cmd, - vector &result, + const std::vector &cmd, + std::vector &result, int /*retry_cnt*/) override; // FirewireDevice void HandleBusReset(void); @@ -79,7 +79,7 @@ class DarwinFirewireDevice : public FirewireDevice int GetMaxSpeed(void); bool IsSTBStreaming(uint *fw_channel = nullptr); - vector GetSTBListPrivate(void); + std::vector GetSTBListPrivate(void); private: int m_local_node {-1}; diff --git a/mythtv/libs/libmythtv/recorders/dtvchannel.cpp b/mythtv/libs/libmythtv/recorders/dtvchannel.cpp index a15af3b10c5..b51d70575d2 100644 --- a/mythtv/libs/libmythtv/recorders/dtvchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/dtvchannel.cpp @@ -75,9 +75,9 @@ QString DTVChannel::GetTuningMode(void) const return m_tuningMode; } -vector DTVChannel::GetTunerTypes(void) const +std::vector DTVChannel::GetTunerTypes(void) const { - vector tts; + std::vector tts; if (m_tunerType != DTVTunerType::kTunerTypeUnknown) tts.push_back(m_tunerType); return tts; @@ -340,13 +340,13 @@ bool DTVChannel::SetChannelByString(const QString &channum) } // Now we construct the PAT & PMT - vector pnum; pnum.push_back(1); - vector pid; pid.push_back(9999); + std::vector pnum; pnum.push_back(1); + std::vector pid; pid.push_back(9999); m_genPAT = ProgramAssociationTable::Create(0,version,pnum,pid); int pcrpid = -1; - vector pids; - vector types; + std::vector pids; + std::vector types; for (auto & pit : pid_cache) { if (!pit.GetStreamID()) diff --git a/mythtv/libs/libmythtv/recorders/dtvchannel.h b/mythtv/libs/libmythtv/recorders/dtvchannel.h index f1f9df03f44..b1107e06b94 100644 --- a/mythtv/libs/libmythtv/recorders/dtvchannel.h +++ b/mythtv/libs/libmythtv/recorders/dtvchannel.h @@ -10,7 +10,6 @@ // C++ headers #include #include -using namespace std; // Qt headers #include @@ -117,7 +116,7 @@ class DTVChannel : public ChannelBase QString GetTuningMode(void) const; /// \brief Returns a vector of supported tuning types. - virtual vector GetTunerTypes(void) const; + virtual std::vector GetTunerTypes(void) const; void GetCachedPids(pid_cache_t &pid_cache) const; diff --git a/mythtv/libs/libmythtv/recorders/dtvrecorder.h b/mythtv/libs/libmythtv/recorders/dtvrecorder.h index 7b6f46aac3c..fd97b207d71 100644 --- a/mythtv/libs/libmythtv/recorders/dtvrecorder.h +++ b/mythtv/libs/libmythtv/recorders/dtvrecorder.h @@ -11,8 +11,6 @@ #include -using namespace std; - #include #include @@ -164,7 +162,7 @@ class DTVRecorder : // keyframe finding buffer bool m_bufferPackets {false}; - vector m_payloadBuffer; + std::vector m_payloadBuffer; // general recorder stuff mutable QMutex m_pidLock {QMutex::Recursive}; @@ -181,7 +179,7 @@ class DTVRecorder : std::array m_streamId {0}; std::array m_pidStatus {0}; std::array m_continuityCounter {0}; - vector m_scratch; + std::vector m_scratch; // Statistics int m_minimumRecordingQuality {95}; diff --git a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp index b19c866bf39..75b0da4dd96 100644 --- a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp @@ -1,7 +1,6 @@ #include #include // for lower_bound -using namespace std; #include "dtvchannel.h" #include "dtvsignalmonitor.h" @@ -26,7 +25,7 @@ static bool insert_crc(QList &seen_crc, const PSIPTable &psip) uint64_t key = (((uint64_t)psip.TableID()) << 32) | psip.CRC(); QList::iterator it = - lower_bound(seen_crc.begin(), seen_crc.end(), key); + std::lower_bound(seen_crc.begin(), seen_crc.end(), key); if ((it == seen_crc.end()) || (*it != key)) { @@ -173,8 +172,8 @@ void DTVSignalMonitor::UpdateMonitorValues(void) void DTVSignalMonitor::UpdateListeningForEIT(void) { - vector add_eit; - vector del_eit; + std::vector add_eit; + std::vector del_eit; if (GetStreamData()->HasEITPIDChanges(m_eitPids) && GetStreamData()->GetEITPIDChanges(m_eitPids, add_eit, del_eit)) diff --git a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h index a5bf8dfa696..c83af0e2f72 100644 --- a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h +++ b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h @@ -4,7 +4,6 @@ #define DTVSIGNALMONITOR_H #include -using namespace std; #include "signalmonitor.h" #include "signalmonitorvalue.h" @@ -109,7 +108,7 @@ class DTVSignalMonitor : public SignalMonitor, protected: MPEGStreamData *m_streamData {nullptr}; - vector m_eitPids; + std::vector m_eitPids; SignalMonitorValue m_seenPAT; SignalMonitorValue m_seenPMT; SignalMonitorValue m_seenMGT; diff --git a/mythtv/libs/libmythtv/recorders/dummychannel.h b/mythtv/libs/libmythtv/recorders/dummychannel.h index 5d15a505d83..ce8ffd55ef6 100644 --- a/mythtv/libs/libmythtv/recorders/dummychannel.h +++ b/mythtv/libs/libmythtv/recorders/dummychannel.h @@ -11,8 +11,6 @@ #include "tv_rec.h" #include "channelbase.h" -using namespace std; - class DummyChannel : public ChannelBase { public: diff --git a/mythtv/libs/libmythtv/recorders/dvbcam.cpp b/mythtv/libs/libmythtv/recorders/dvbcam.cpp index dec1d34a0f9..e6c982c3136 100644 --- a/mythtv/libs/libmythtv/recorders/dvbcam.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbcam.cpp @@ -41,8 +41,6 @@ #include #include -using namespace std; - #include #include #include diff --git a/mythtv/libs/libmythtv/recorders/dvbcam.h b/mythtv/libs/libmythtv/recorders/dvbcam.h index f03744303ab..26bd283b898 100644 --- a/mythtv/libs/libmythtv/recorders/dvbcam.h +++ b/mythtv/libs/libmythtv/recorders/dvbcam.h @@ -2,7 +2,6 @@ #define DVBCAM_H #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/dvbstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/dvbstreamhandler.cpp index 8084fb9d6bb..3fd7887f026 100644 --- a/mythtv/libs/libmythtv/recorders/dvbstreamhandler.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbstreamhandler.cpp @@ -351,7 +351,7 @@ void DVBStreamHandler::RunSR(void) LOG(VB_RECORD, LOG_DEBUG, LOC + "RunSR(): " + "end"); } -using pid_list_t = vector; +using pid_list_t = std::vector; static pid_list_t::iterator find( const PIDInfoMap &map, @@ -392,7 +392,7 @@ void DVBStreamHandler::CycleFiltersByPriority(void) } for (auto & it : priority_queue) - sort(it.begin(), it.end()); + std::sort(it.begin(), it.end()); for (PIDPriority i = kPIDPriorityHigh; i > kPIDPriorityNone; i = (PIDPriority)((int)i-1)) diff --git a/mythtv/libs/libmythtv/recorders/dvbstreamhandler.h b/mythtv/libs/libmythtv/recorders/dvbstreamhandler.h index 69c5eae6f8b..1145ada67ae 100644 --- a/mythtv/libs/libmythtv/recorders/dvbstreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/dvbstreamhandler.h @@ -4,7 +4,6 @@ #define DVBSTREAMHANDLER_H #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/firewiredevice.cpp b/mythtv/libs/libmythtv/recorders/firewiredevice.cpp index 75d174f1327..06cc704f96a 100644 --- a/mythtv/libs/libmythtv/recorders/firewiredevice.cpp +++ b/mythtv/libs/libmythtv/recorders/firewiredevice.cpp @@ -69,8 +69,8 @@ bool FirewireDevice::SetPowerState(bool on) { QMutexLocker locker(&m_lock); - vector cmd; - vector ret; + std::vector cmd; + std::vector ret; cmd.push_back(kAVCControlCommand); cmd.push_back(kAVCSubunitTypeUnit | kAVCSubunitIdIgnore); @@ -103,8 +103,8 @@ FirewireDevice::PowerState FirewireDevice::GetPowerState(void) { QMutexLocker locker(&m_lock); - vector cmd; - vector ret; + std::vector cmd; + std::vector ret; cmd.push_back(kAVCStatusInquiryCommand); cmd.push_back(kAVCSubunitTypeUnit | kAVCSubunitIdIgnore); @@ -176,8 +176,8 @@ bool FirewireDevice::SetChannel(const QString &panel_model, return false; } - vector cmd; - vector ret; + std::vector cmd; + std::vector ret; if ((panel_model.toUpper() == "SA GENERIC") || (panel_model.toUpper() == "SA4200HD") || @@ -362,9 +362,9 @@ QString FirewireDevice::GetModelName(uint vendor_id, uint model_id) return ret; } -vector FirewireDevice::GetSTBList(void) +std::vector FirewireDevice::GetSTBList(void) { - vector list; + std::vector list; #ifdef USING_LINUX_FIREWIRE list = LinuxFirewireDevice::GetSTBList(); diff --git a/mythtv/libs/libmythtv/recorders/firewiredevice.h b/mythtv/libs/libmythtv/recorders/firewiredevice.h index 8b06d63adc1..b972ad6c6e4 100644 --- a/mythtv/libs/libmythtv/recorders/firewiredevice.h +++ b/mythtv/libs/libmythtv/recorders/firewiredevice.h @@ -9,7 +9,6 @@ // C++ headers #include -using namespace std; // Qt headers #include @@ -215,13 +214,13 @@ class FirewireDevice // Statics static bool IsSTBSupported(const QString &model); static QString GetModelName(uint vendor_id, uint model_id); - static vector GetSTBList(void); + static std::vector GetSTBList(void); protected: FirewireDevice(uint64_t guid, uint subunitid, uint speed); - virtual bool SendAVCCommand(const vector &cmd, - vector &result, + virtual bool SendAVCCommand(const std::vector &cmd, + std::vector &result, int retry_cnt) = 0; void SetLastChannel(uint channel); void ProcessPATPacket(const TSPacket &tspacket); @@ -236,7 +235,7 @@ class FirewireDevice bool m_bufferCleared {true}; uint m_openPortCnt {0}; - vector m_listeners; + std::vector m_listeners; mutable QMutex m_lock; /// Vendor ID + Model ID to FirewireDevice STB model string diff --git a/mythtv/libs/libmythtv/recorders/firewirerecorder.h b/mythtv/libs/libmythtv/recorders/firewirerecorder.h index da6752549fa..d75e59759fb 100644 --- a/mythtv/libs/libmythtv/recorders/firewirerecorder.h +++ b/mythtv/libs/libmythtv/recorders/firewirerecorder.h @@ -60,7 +60,7 @@ class FirewireRecorder : private: FirewireChannel *m_channel {nullptr}; bool m_isopen {false}; - vector m_buffer; + std::vector m_buffer; }; #endif // FIREWIRERECORDER_H diff --git a/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.h b/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.h index 94435f1123a..6d07aa57612 100644 --- a/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.h +++ b/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.h @@ -5,7 +5,6 @@ // C++ headers #include -using namespace std; // Qt headers #include @@ -70,7 +69,7 @@ class FirewireSignalMonitor : public DTVSignalMonitor, public TSDataListener MythTimer m_stbWaitForPatTimer; MythTimer m_stbWaitForPowerTimer; - vector m_buffer; + std::vector m_buffer; static QHash s_patKeys; static QMutex s_patKeysLock; diff --git a/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp b/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp index e03c8933430..6ec3bc78576 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp @@ -20,8 +20,6 @@ #include #include -using namespace std; - // MythTV includes #include "mythdbcon.h" #include "mythlogging.h" diff --git a/mythtv/libs/libmythtv/recorders/hdhrchannel.h b/mythtv/libs/libmythtv/recorders/hdhrchannel.h index 39ee6fc525f..dc5c3c422bb 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrchannel.h +++ b/mythtv/libs/libmythtv/recorders/hdhrchannel.h @@ -34,7 +34,7 @@ class HDHRChannel : public DTVChannel bool IsOpen(void) const override; // ChannelBase QString GetDevice(void) const override // ChannelBase { return m_deviceId; } - vector GetTunerTypes(void) const override // DTVChannel + std::vector GetTunerTypes(void) const override // DTVChannel { return m_tunerTypes; } bool IsMaster(void) const override; // DTVChannel @@ -51,7 +51,7 @@ class HDHRChannel : public DTVChannel private: QString m_deviceId; HDHRStreamHandler *m_streamHandler {nullptr}; - vector m_tunerTypes; + std::vector m_tunerTypes; }; #endif diff --git a/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp index d44e51946c2..28f110a1a1e 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp +++ b/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp @@ -250,8 +250,8 @@ bool HDHRStreamHandler::UpdateFilters(void) QString filter = ""; - vector range_min; - vector range_max; + std::vector range_min; + std::vector range_max; for (auto it = m_pidInfo.cbegin(); it != m_pidInfo.cend(); ++it) { diff --git a/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.h b/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.h index 91747ac3e28..4b3dfe69740 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.h @@ -4,7 +4,6 @@ #define HDHRSTREAMHANDLER_H #include -using namespace std; #include #include @@ -60,7 +59,7 @@ class HDHRStreamHandler : public StreamHandler void GetTunerStatus(struct hdhomerun_tuner_status_t *status); bool IsConnected(void) const; - vector GetTunerTypes(void) const { return m_tunerTypes; } + std::vector GetTunerTypes(void) const { return m_tunerTypes; } // Commands bool TuneChannel(const QString &chanid); @@ -90,7 +89,7 @@ class HDHRStreamHandler : public StreamHandler hdhomerun_device_t *m_hdhomerunDevice {nullptr}; hdhomerun_device_selector_t *m_deviceSelector {nullptr}; int m_tuner {-1}; - vector m_tunerTypes; + std::vector m_tunerTypes; HDHRTuneMode m_tuneMode {hdhrTuneModeNone}; // debug self check int m_majorId; diff --git a/mythtv/libs/libmythtv/recorders/hlsstreamhandler.h b/mythtv/libs/libmythtv/recorders/hlsstreamhandler.h index 44320524ba1..d591e0000ce 100644 --- a/mythtv/libs/libmythtv/recorders/hlsstreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/hlsstreamhandler.h @@ -9,7 +9,6 @@ #define HLSSTREAMHANDLER_H #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/httptsstreamhandler.h b/mythtv/libs/libmythtv/recorders/httptsstreamhandler.h index e72e2acdf69..7aa8a9e7a33 100644 --- a/mythtv/libs/libmythtv/recorders/httptsstreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/httptsstreamhandler.h @@ -2,7 +2,6 @@ #define HTTPTSSTREAMHANDLER_H #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp index 30e18314a80..49332b971ad 100644 --- a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp +++ b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.cpp @@ -228,7 +228,7 @@ void IPTVStreamHandler::run(void) "Unable to create socket " + ENO); continue; } - int buf_size = 2 * 1024 * max(tuning.GetBitrate(i)/1000, 500U); + int buf_size = 2 * 1024 * std::max(tuning.GetBitrate(i)/1000, 500U); if (!tuning.GetBitrate(i)) buf_size = 2 * 1024 * 1024; int err = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, diff --git a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.h b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.h index e5bd3c0f7de..c5c73c219d1 100644 --- a/mythtv/libs/libmythtv/recorders/iptvstreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/iptvstreamhandler.h @@ -4,7 +4,6 @@ #define IPTVSTREAMHANDLER_H #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/linuxavcinfo.cpp b/mythtv/libs/libmythtv/recorders/linuxavcinfo.cpp index 5968cfcc64c..aabf6433d0a 100644 --- a/mythtv/libs/libmythtv/recorders/linuxavcinfo.cpp +++ b/mythtv/libs/libmythtv/recorders/linuxavcinfo.cpp @@ -64,8 +64,8 @@ bool LinuxAVCInfo::ClosePort(void) } bool LinuxAVCInfo::SendAVCCommand( - const vector &_cmd, - vector &result, + const std::vector &_cmd, + std::vector &result, int retry_cnt) { retry_cnt = (retry_cnt < 0) ? 2 : retry_cnt; @@ -75,7 +75,7 @@ bool LinuxAVCInfo::SendAVCCommand( if (!m_fwHandle || (m_node < 0)) return false; - vector cmd = _cmd; + std::vector cmd = _cmd; while (cmd.size() & 0x3) cmd.push_back(0x00); diff --git a/mythtv/libs/libmythtv/recorders/linuxavcinfo.h b/mythtv/libs/libmythtv/recorders/linuxavcinfo.h index 4e719d42c0e..710bc09e1a7 100644 --- a/mythtv/libs/libmythtv/recorders/linuxavcinfo.h +++ b/mythtv/libs/libmythtv/recorders/linuxavcinfo.h @@ -12,7 +12,6 @@ // C++ headers #include -using namespace std; // Qt headers #include @@ -32,8 +31,8 @@ class LinuxAVCInfo : public AVCInfo bool ClosePort(void); bool SendAVCCommand( - const vector &cmd, - vector &result, + const std::vector &cmd, + std::vector &result, int retry_cnt) override; // AVCInfo bool IsPortOpen(void) const { return m_fwHandle; } diff --git a/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.cpp b/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.cpp index 03e2b36444f..a1cffc1699b 100644 --- a/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.cpp +++ b/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.cpp @@ -26,7 +26,6 @@ #include // for milliseconds #include #include // for sleep_for -using namespace std; // Qt headers #include @@ -364,8 +363,8 @@ void LinuxFirewireDevice::RemoveListener(TSDataListener *listener) } bool LinuxFirewireDevice::SendAVCCommand( - const vector &cmd, - vector &result, + const std::vector &cmd, + std::vector &result, int retry_cnt) { return GetInfoPtr()->SendAVCCommand(cmd, result, retry_cnt); @@ -712,8 +711,8 @@ bool LinuxFirewireDevice::SetAVStreamBufferSize(uint size_in_bytes) return false; // Set buffered packets size - uint buffer_size = max(size_in_bytes, 50 * TSPacket::kSize); - size_t buffered_packets = min(buffer_size / 4, kMaxBufferedPackets); + uint buffer_size = std::max(size_in_bytes, 50 * TSPacket::kSize); + size_t buffered_packets = std::min(buffer_size / 4, kMaxBufferedPackets); iec61883_mpeg2_set_buffers(m_priv->m_avstream, buffered_packets); @@ -797,9 +796,9 @@ void LinuxFirewireDevice::PrintDropped(uint dropped_packets) } } -vector LinuxFirewireDevice::GetSTBList(void) +std::vector LinuxFirewireDevice::GetSTBList(void) { - vector list; + std::vector list; { LinuxFirewireDevice dev(0,0,0,false); @@ -809,7 +808,7 @@ vector LinuxFirewireDevice::GetSTBList(void) return list; } -vector LinuxFirewireDevice::GetSTBListPrivate(void) +std::vector LinuxFirewireDevice::GetSTBListPrivate(void) { #if 0 LOG(VB_GENERAL, LOG_DEBUG, "GetSTBListPrivate -- begin"); @@ -819,7 +818,7 @@ vector LinuxFirewireDevice::GetSTBListPrivate(void) LOG(VB_GENERAL, LOG_DEBUG, "GetSTBListPrivate -- got lock"); #endif - vector list; + std::vector list; for (const auto & device : qAsConst(m_priv->m_devices)) { @@ -864,7 +863,7 @@ bool LinuxFirewireDevice::UpdateDeviceList(void) return true; } - map guid_online; + std::map guid_online; for (int port = 0; port < numcards; port++) { if (raw1394_set_port(item.m_handle, port) < 0) diff --git a/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.h b/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.h index b40a1982c34..c2c671fbc9c 100644 --- a/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.h +++ b/mythtv/libs/libmythtv/recorders/linuxfirewiredevice.h @@ -42,7 +42,7 @@ class LinuxFirewireDevice : public FirewireDevice, public QRunnable void SignalReset(uint generation); // Statics - static vector GetSTBList(void); + static std::vector GetSTBList(void); // Constants static const uint kBroadcastChannel; @@ -77,10 +77,10 @@ class LinuxFirewireDevice : public FirewireDevice, public QRunnable bool UpdateDeviceList(void); void UpdateDeviceListItem(uint64_t guid, void *pitem); - vector GetSTBListPrivate(void); + std::vector GetSTBListPrivate(void); - bool SendAVCCommand(const vector &cmd, - vector &result, + bool SendAVCCommand(const std::vector &cmd, + std::vector &result, int retry_cnt) override; // FirewireDevice LinuxAVCInfo *GetInfoPtr(void); diff --git a/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp b/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp index 2a7edb5ce0d..c04f1b18505 100644 --- a/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp @@ -9,7 +9,6 @@ #include // for sleep_for #include #include -using namespace std; // System headers #include @@ -556,7 +555,7 @@ bool MpegRecorder::SetRecordingVolume(int chanfd) // calculate volume in card units. int range = qctrl.maximum - qctrl.minimum; int value = (int) ((range * m_audVolume * 0.01F) + qctrl.minimum); - int ctrl_volume = min(qctrl.maximum, max(qctrl.minimum, value)); + int ctrl_volume = std::min(qctrl.maximum, std::max(qctrl.minimum, value)); // Set recording volume struct v4l2_control ctrl {V4L2_CID_AUDIO_VOLUME, ctrl_volume}; @@ -630,7 +629,7 @@ uint MpegRecorder::GetFilteredAudioLayer(void) const { uint layer = (uint) m_audType; - layer = max(min(layer, 3U), 1U); + layer = std::max(std::min(layer, 3U), 1U); layer = (m_driver == "ivtv") ? 2 : layer; @@ -647,8 +646,8 @@ uint MpegRecorder::GetFilteredAudioLayer(void) const uint MpegRecorder::GetFilteredAudioBitRate(uint audio_layer) const { - return ((2 == audio_layer) ? max(m_audBitrateL2, 10) : - ((3 == audio_layer) ? m_audBitrateL3 : max(m_audBitrateL1, 6))); + return ((2 == audio_layer) ? std::max(m_audBitrateL2, 10) : + ((3 == audio_layer) ? m_audBitrateL3 : std::max(m_audBitrateL1, 6))); } static int streamtype_ivtv_to_v4l2(int st) @@ -672,7 +671,7 @@ static int streamtype_ivtv_to_v4l2(int st) } } -static void add_ext_ctrl(vector &ctrl_list, +static void add_ext_ctrl(std::vector &ctrl_list, uint32_t id, int32_t value) { struct v4l2_ext_control tmp_ctrl {}; @@ -681,7 +680,7 @@ static void add_ext_ctrl(vector &ctrl_list, ctrl_list.push_back(tmp_ctrl); } -static void set_ctrls(int fd, vector &ext_ctrls) +static void set_ctrls(int fd, std::vector &ext_ctrls) { static QMutex s_controlDescriptionLock; static QMap s_controlDescription; @@ -731,7 +730,7 @@ static void set_ctrls(int fd, vector &ext_ctrls) bool MpegRecorder::SetV4L2DeviceOptions(int chanfd) { - vector ext_ctrls; + std::vector ext_ctrls; // Set controls if (m_driver != "hdpvr") @@ -809,7 +808,7 @@ bool MpegRecorder::SetV4L2DeviceOptions(int chanfd) if (!ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl)) { - uint audio_enc = max(min(m_audType-1, qctrl.maximum), qctrl.minimum); + uint audio_enc = std::max(std::min(m_audType-1, qctrl.maximum), qctrl.minimum); add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_AUDIO_ENCODING, audio_enc); } else @@ -1458,7 +1457,7 @@ void MpegRecorder::SetBitrate(int bitrate, int maxbitrate, .arg(reason).arg(bitrate).arg(maxbitrate)); } - vector ext_ctrls; + std::vector ext_ctrls; add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_MODE, (maxbitrate == bitrate) ? V4L2_MPEG_VIDEO_BITRATE_MODE_CBR : diff --git a/mythtv/libs/libmythtv/recorders/recorderbase.cpp b/mythtv/libs/libmythtv/recorders/recorderbase.cpp index 6847a1ea42e..c78a4a5479f 100644 --- a/mythtv/libs/libmythtv/recorders/recorderbase.cpp +++ b/mythtv/libs/libmythtv/recorders/recorderbase.cpp @@ -1,6 +1,5 @@ #include // for min #include -using namespace std; #include "firewirerecorder.h" #include "recordingprofile.h" diff --git a/mythtv/libs/libmythtv/recorders/rtp/rtppacketbuffer.cpp b/mythtv/libs/libmythtv/recorders/rtp/rtppacketbuffer.cpp index 838522b2c4e..587549d652f 100644 --- a/mythtv/libs/libmythtv/recorders/rtp/rtppacketbuffer.cpp +++ b/mythtv/libs/libmythtv/recorders/rtp/rtppacketbuffer.cpp @@ -5,7 +5,6 @@ */ #include -using namespace std; #include "rtppacketbuffer.h" #include "rtpdatapacket.h" @@ -21,7 +20,7 @@ void RTPPacketBuffer::PushDataPacket(const UDPPacket &udp_packet) m_largeSequenceNumberSeenRecently = (key > (1U<<15)) ? 500 : m_largeSequenceNumberSeenRecently - 1; m_largeSequenceNumberSeenRecently = - max(m_largeSequenceNumberSeenRecently, 0); + std::max(m_largeSequenceNumberSeenRecently, 0); if (m_largeSequenceNumberSeenRecently > 0) { diff --git a/mythtv/libs/libmythtv/recorders/rtp/rtptsdatapacket.h b/mythtv/libs/libmythtv/recorders/rtp/rtptsdatapacket.h index 5bc622ad709..75d49c71a6f 100644 --- a/mythtv/libs/libmythtv/recorders/rtp/rtptsdatapacket.h +++ b/mythtv/libs/libmythtv/recorders/rtp/rtptsdatapacket.h @@ -7,7 +7,6 @@ #define RTP_TS_DATA_PACKET_H #include -using namespace std; #include "rtpdatapacket.h" @@ -29,7 +28,7 @@ class RTPTSDataPacket : public RTPDataPacket unsigned int GetTSDataSize(void) const { - return max(m_data.size() - (int)GetTSOffset() - (int)GetPaddingSize(), 0); + return std::max(m_data.size() - (int)GetTSOffset() - (int)GetPaddingSize(), 0); } private: diff --git a/mythtv/libs/libmythtv/recorders/signalmonitor.cpp b/mythtv/libs/libmythtv/recorders/signalmonitor.cpp index 5537e2b63a5..281ef99b8b8 100644 --- a/mythtv/libs/libmythtv/recorders/signalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/signalmonitor.cpp @@ -399,7 +399,7 @@ void SignalMonitor::RemoveListener(SignalMonitorListener *listener) { QMutexLocker locker(&m_listenerLock); - vector new_listeners; + std::vector new_listeners; for (auto & entry : m_listeners) { if (entry != listener) diff --git a/mythtv/libs/libmythtv/recorders/signalmonitor.h b/mythtv/libs/libmythtv/recorders/signalmonitor.h index e1f0fe612b9..2e37ef73be9 100644 --- a/mythtv/libs/libmythtv/recorders/signalmonitor.h +++ b/mythtv/libs/libmythtv/recorders/signalmonitor.h @@ -7,7 +7,6 @@ // C++ headers #include #include -using namespace std; // Qt headers #include @@ -109,7 +108,7 @@ class SignalMonitor : protected MThread * \param msec Milliseconds between signal monitoring events. */ void SetUpdateRate(int msec) - { m_updateRate = max(msec, (int)m_minimumUpdateRate); } + { m_updateRate = std::max(msec, (int)m_minimumUpdateRate); } // // // // // // // // // // // // // // // // // // // // // // // // // Listeners // // // // // // // // // // // // // // // // // // // @@ -219,7 +218,7 @@ class SignalMonitor : protected MThread SignalMonitorValue m_signalStrength; SignalMonitorValue m_scriptStatus; - vector m_listeners; + std::vector m_listeners; QMutex m_startStopLock; QWaitCondition m_startStopWait; // protected by startStopLock diff --git a/mythtv/libs/libmythtv/recorders/streamhandler.cpp b/mythtv/libs/libmythtv/recorders/streamhandler.cpp index 26e42f08a86..350b3038f25 100644 --- a/mythtv/libs/libmythtv/recorders/streamhandler.cpp +++ b/mythtv/libs/libmythtv/recorders/streamhandler.cpp @@ -239,7 +239,7 @@ bool StreamHandler::RemoveAllPIDFilters(void) LOG(VB_RECORD, LOG_DEBUG, LOC + "RemoveAllPIDFilters()"); #endif // DEBUG_PID_FILTERS - vector del_pids; + std::vector del_pids; for (auto it = m_pidInfo.begin(); it != m_pidInfo.end(); ++it) del_pids.push_back(it.key()); @@ -252,8 +252,8 @@ bool StreamHandler::RemoveAllPIDFilters(void) void StreamHandler::UpdateListeningForEIT(void) { - vector add_eit; - vector del_eit; + std::vector add_eit; + std::vector del_eit; QMutexLocker read_locker(&m_listenerLock); @@ -294,7 +294,7 @@ bool StreamHandler::UpdateFiltersFromStreamData(void) } QMap add_pids; - vector del_pids; + std::vector del_pids; { QMutexLocker read_locker(&m_pidLock); @@ -341,7 +341,7 @@ PIDPriority StreamHandler::GetPIDPriority(uint pid) const PIDPriority tmp = kPIDPriorityNone; for (auto it = m_streamDataList.cbegin(); it != m_streamDataList.cend(); ++it) - tmp = max(tmp, it.key()->GetPIDPriority(pid)); + tmp = std::max(tmp, it.key()->GetPIDPriority(pid)); return tmp; } diff --git a/mythtv/libs/libmythtv/recorders/streamhandler.h b/mythtv/libs/libmythtv/recorders/streamhandler.h index a7caa6d6de1..2a0cd46c9cd 100644 --- a/mythtv/libs/libmythtv/recorders/streamhandler.h +++ b/mythtv/libs/libmythtv/recorders/streamhandler.h @@ -5,7 +5,6 @@ #include #include -using namespace std; // Qt headers #include @@ -128,7 +127,7 @@ class StreamHandler : protected MThread, public DeviceReaderCB QWaitCondition m_runningStateChanged; mutable QMutex m_pidLock {QMutex::Recursive}; - vector m_eitPids; + std::vector m_eitPids; PIDInfoMap m_pidInfo; uint m_openPidFilters {0}; MythTimer m_cycleTimer; diff --git a/mythtv/libs/libmythtv/recorders/v4l2encstreamhandler.h b/mythtv/libs/libmythtv/recorders/v4l2encstreamhandler.h index 014c86375f8..d325d1e1e0e 100644 --- a/mythtv/libs/libmythtv/recorders/v4l2encstreamhandler.h +++ b/mythtv/libs/libmythtv/recorders/v4l2encstreamhandler.h @@ -6,7 +6,6 @@ #include #include #include -using namespace std; #include #include diff --git a/mythtv/libs/libmythtv/recorders/v4lchannel.cpp b/mythtv/libs/libmythtv/recorders/v4lchannel.cpp index 20e6f52c8f4..406cdbb68b1 100644 --- a/mythtv/libs/libmythtv/recorders/v4lchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/v4lchannel.cpp @@ -14,7 +14,6 @@ // C++ headers #include #include -using namespace std; #include @@ -640,8 +639,8 @@ bool V4LChannel::InitPictureAttribute(const QString &db_col_name) int dfield = m_pictAttrDefault[db_col_name]; int field = (cfield + sfield + dfield) & 0xFFFF; int value0 = (int) ((scl_range * field) + qctrl.minimum); - int value1 = min(value0, qctrl.maximum); - ctrl.value = max(value1, qctrl.minimum); + int value1 = std::min(value0, qctrl.maximum); + ctrl.value = std::max(value1, qctrl.minimum); #if DEBUG_ATTRIB LOG(VB_CHANNEL, LOG_DEBUG, loc + QString(" %1\n\t\t\t" @@ -716,7 +715,7 @@ static int get_v4l2_attribute_value(int videofd, int v4l2_attrib) } float mult = 65535.0 / (qctrl.maximum - qctrl.minimum); - return min(max((int)(mult * (ctrl.value - qctrl.minimum)), 0), 65525); + return std::min(std::max((int)(mult * (ctrl.value - qctrl.minimum)), 0), 65525); } static int set_v4l2_attribute_value(int videofd, int v4l2_attrib, int newvalue) @@ -734,8 +733,8 @@ static int set_v4l2_attribute_value(int videofd, int v4l2_attrib, int newvalue) float mult = (qctrl.maximum - qctrl.minimum) / 65535.0; ctrl.value = (int)(mult * newvalue + qctrl.minimum); - ctrl.value = min(ctrl.value, qctrl.maximum); - ctrl.value = max(ctrl.value, qctrl.minimum); + ctrl.value = std::min(ctrl.value, qctrl.maximum); + ctrl.value = std::max(ctrl.value, qctrl.minimum); if (ioctl(videofd, VIDIOC_S_CTRL, &ctrl) < 0) { @@ -772,7 +771,7 @@ int V4LChannel::ChangePictureAttribute( // make sure we are within bounds (wrap around for hue) if (V4L2_CID_HUE == v4l2_attrib) new_value &= 0xffff; - new_value = min(max(new_value, 0), 65535); + new_value = std::min(std::max(new_value, 0), 65535); #if DEBUG_ATTRIB LOG(VB_CHANNEL, LOG_DEBUG, diff --git a/mythtv/libs/libmythtv/recorders/v4lchannel.h b/mythtv/libs/libmythtv/recorders/v4lchannel.h index d1064951dcf..4ebd9f5f3cb 100644 --- a/mythtv/libs/libmythtv/recorders/v4lchannel.h +++ b/mythtv/libs/libmythtv/recorders/v4lchannel.h @@ -13,8 +13,6 @@ #include #endif -using namespace std; - #define FAKE_VIDEO 0 class TVRec;