diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-15 12:08:00 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2016-01-15 13:56:00 +0000 |
commit | 942ff8229151820eb2a9cb17d7c5ee237019a47d (patch) | |
tree | 44218109c3bc826400aed328e0f152f782f9e924 /src/plugins/wmf | |
parent | 5e126b27465d3b6a3c1bb29f1f5993d31538f035 (diff) | |
download | qtmultimedia-942ff8229151820eb2a9cb17d7c5ee237019a47d.tar.gz |
WMF plugin: replace foreach with range-based for
Change-Id: I041496a88ac26d5db6bb65f61ff88a3aea01e3a4
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/plugins/wmf')
-rw-r--r-- | src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp | 4 | ||||
-rw-r--r-- | src/plugins/wmf/mftvideo.cpp | 2 | ||||
-rw-r--r-- | src/plugins/wmf/player/mfaudioendpointcontrol.cpp | 4 | ||||
-rw-r--r-- | src/plugins/wmf/player/mfvideorenderercontrol.cpp | 10 | ||||
-rw-r--r-- | src/plugins/wmf/samplegrabber.cpp | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp index 55fae7146..62a7f6cb0 100644 --- a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp +++ b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp @@ -340,7 +340,7 @@ void MFAudioDecoderControl::handleSampleAdded() QByteArray abuf; if (m_sourceOutputFormat == m_audioFormat) { //no need for resampling - foreach (IMFSample *s, samples) { + for (IMFSample *s : qAsConst(samples)) { IMFMediaBuffer *buffer; s->ConvertToContiguousBuffer(&buffer); DWORD bufLen = 0; @@ -357,7 +357,7 @@ void MFAudioDecoderControl::handleSampleAdded() s->Release(); } } else { - foreach (IMFSample *s, samples) { + for (IMFSample *s : qAsConst(samples)) { HRESULT hr = m_resampler->ProcessInput(m_mfInputStreamID, s, 0); if (SUCCEEDED(hr)) { MFT_OUTPUT_DATA_BUFFER outputDataBuffer; diff --git a/src/plugins/wmf/mftvideo.cpp b/src/plugins/wmf/mftvideo.cpp index b141d49a2..6faa8604c 100644 --- a/src/plugins/wmf/mftvideo.cpp +++ b/src/plugins/wmf/mftvideo.cpp @@ -490,7 +490,7 @@ STDMETHODIMP MFTransform::ProcessInput(DWORD dwInputStreamID, IMFSample *pSample if (!m_videoProbes.isEmpty()) { QVideoFrame frame = makeVideoFrame(); - foreach (MFVideoProbeControl* probe, m_videoProbes) + for (MFVideoProbeControl* probe : qAsConst(m_videoProbes)) probe->bufferProbed(frame); } diff --git a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp index 7178a75c1..ccd4cdf98 100644 --- a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp +++ b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp @@ -49,8 +49,8 @@ void MFAudioEndpointControl::clear() { m_activeEndpoint.clear(); - foreach (LPWSTR wstrID, m_devices) - CoTaskMemFree(wstrID); + for (auto it = m_devices.cbegin(), end = m_devices.cend(); it != end; ++it) + CoTaskMemFree(it.value()); m_devices.clear(); diff --git a/src/plugins/wmf/player/mfvideorenderercontrol.cpp b/src/plugins/wmf/player/mfvideorenderercontrol.cpp index 32806a852..683dd4b71 100644 --- a/src/plugins/wmf/player/mfvideorenderercontrol.cpp +++ b/src/plugins/wmf/player/mfvideorenderercontrol.cpp @@ -794,8 +794,8 @@ namespace clearMediaTypes(); if (!m_surface) return; - QList<QVideoFrame::PixelFormat> formats = m_surface->supportedPixelFormats(); - foreach (QVideoFrame::PixelFormat format, formats) { + const QList<QVideoFrame::PixelFormat> formats = m_surface->supportedPixelFormats(); + for (QVideoFrame::PixelFormat format : formats) { IMFMediaType *mediaType; if (FAILED(MFCreateMediaType(&mediaType))) { qWarning("Failed to create mf media type!"); @@ -1050,7 +1050,7 @@ namespace void clearMediaTypes() { - foreach (IMFMediaType* mediaType, m_mediaTypes) + for (IMFMediaType* mediaType : qAsConst(m_mediaTypes)) mediaType->Release(); m_mediaTypes.clear(); } @@ -1291,7 +1291,7 @@ namespace bool m_prerolling; void clearSampleQueue() { - foreach (IUnknown* sample, m_sampleQueue) + for (IUnknown* sample : qAsConst(m_sampleQueue)) sample->Release(); m_sampleQueue.clear(); } @@ -1398,7 +1398,7 @@ namespace void clearBufferCache() { - foreach (SampleBuffer sb, m_bufferCache) + for (SampleBuffer sb : qAsConst(m_bufferCache)) sb.m_buffer->Release(); m_bufferCache.clear(); diff --git a/src/plugins/wmf/samplegrabber.cpp b/src/plugins/wmf/samplegrabber.cpp index 35f038891..b4cf68095 100644 --- a/src/plugins/wmf/samplegrabber.cpp +++ b/src/plugins/wmf/samplegrabber.cpp @@ -160,7 +160,7 @@ STDMETHODIMP AudioSampleGrabberCallback::OnProcessSample(REFGUID guidMajorMediaT llSampleTime /= 10; } - foreach (MFAudioProbeControl* probe, m_audioProbes) + for (MFAudioProbeControl* probe : qAsConst(m_audioProbes)) probe->bufferProbed((const char*)pSampleBuffer, dwSampleSize, m_format, llSampleTime); return S_OK; |