diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-01-15 10:42:16 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2016-01-15 13:59:28 +0000 |
commit | 84aaa48fdfc1f35c9870518a3d4b6f08a1f99449 (patch) | |
tree | 69adff0bbc9bbf8ce191368f0abc97a6e6c5be72 /src/gsttools/qvideosurfacegstsink.cpp | |
parent | f1453e0f51cf60773eddc37d9451375e806bf4ce (diff) | |
download | qtmultimedia-84aaa48fdfc1f35c9870518a3d4b6f08a1f99449.tar.gz |
QGstTools: replace foreach with range-based for
Change-Id: I4e93978fc41788ac7f524c7c290a9ce25452f04e
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/gsttools/qvideosurfacegstsink.cpp')
-rw-r--r-- | src/gsttools/qvideosurfacegstsink.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index d59709723..2f61770ce 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -65,7 +65,8 @@ QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate( , m_startCanceled(false) { if (m_surface) { - foreach (QObject *instance, bufferPoolLoader()->instances(QGstBufferPoolPluginKey)) { + const auto instances = bufferPoolLoader()->instances(QGstBufferPoolPluginKey); + for (QObject *instance : instances) { QGstBufferPoolInterface* plugin = qobject_cast<QGstBufferPoolInterface*>(instance); if (plugin) { @@ -302,7 +303,7 @@ void QVideoSurfaceGstDelegate::queuedRender() void QVideoSurfaceGstDelegate::updateSupportedFormats() { QGstBufferPoolInterface *newPool = 0; - foreach (QGstBufferPoolInterface *pool, m_pools) { + for (QGstBufferPoolInterface *pool : qAsConst(m_pools)) { if (!m_surface->supportedPixelFormats(pool->handleType()).isEmpty()) { newPool = pool; break; @@ -503,7 +504,8 @@ GstCaps *QVideoSurfaceGstSink::get_caps(GstBaseSink *base) sink->delegate->poolMutex()->unlock(); supportedFormats = poolHandleFormats; - foreach (QVideoFrame::PixelFormat format, sink->delegate->supportedPixelFormats()) { + const auto supportedPixelFormats = sink->delegate->supportedPixelFormats(); + for (QVideoFrame::PixelFormat format : supportedPixelFormats) { if (!poolHandleFormats.contains(format)) supportedFormats.append(format); } |