summaryrefslogtreecommitdiffstats
path: root/src/gsttools/qvideosurfacegstsink.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-15 10:42:16 +0300
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-01-15 13:59:28 +0000
commit84aaa48fdfc1f35c9870518a3d4b6f08a1f99449 (patch)
tree69adff0bbc9bbf8ce191368f0abc97a6e6c5be72 /src/gsttools/qvideosurfacegstsink.cpp
parentf1453e0f51cf60773eddc37d9451375e806bf4ce (diff)
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.cpp8
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);
}