summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput.cpp3
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp9
2 files changed, 7 insertions, 5 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
index cae6cf002..d3e8c32ee 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
@@ -231,7 +231,8 @@ bool QDeclarativeVideoOutput::createBackend(QMediaService *service)
{
bool backendAvailable = false;
- foreach (QObject *instance, videoBackendFactoryLoader()->instances(QLatin1String("declarativevideobackend"))) {
+ const auto instances = videoBackendFactoryLoader()->instances(QLatin1String("declarativevideobackend"));
+ for (QObject *instance : instances) {
if (QDeclarativeVideoBackendFactoryInterface *plugin = qobject_cast<QDeclarativeVideoBackendFactoryInterface*>(instance)) {
m_backend.reset(plugin->create(this));
if (m_backend && m_backend->init(service)) {
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index 70d48dd97..36572f613 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -64,7 +64,8 @@ QDeclarativeVideoRendererBackend::QDeclarativeVideoRendererBackend(QDeclarativeV
// Prioritize the plugin requested by the environment
QString requestedVideoNode = QString::fromLatin1(qgetenv("QT_VIDEONODE"));
- foreach (const QString &key, videoNodeFactoryLoader()->keys()) {
+ const auto keys = videoNodeFactoryLoader()->keys();
+ for (const QString &key : keys) {
QObject *instance = videoNodeFactoryLoader()->instance(key);
QSGVideoNodeFactoryInterface* plugin = qobject_cast<QSGVideoNodeFactoryInterface*>(instance);
if (plugin) {
@@ -124,7 +125,7 @@ class FilterRunnableDeleter : public QRunnable
public:
FilterRunnableDeleter(const QList<QVideoFilterRunnable *> &runnables) : m_runnables(runnables) { }
void run() Q_DECL_OVERRIDE {
- foreach (QVideoFilterRunnable *runnable, m_runnables)
+ for (QVideoFilterRunnable *runnable : qAsConst(m_runnables))
delete runnable;
}
private:
@@ -335,7 +336,7 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
}
if (!videoNode) {
- foreach (QSGVideoNodeFactoryInterface* factory, m_videoNodeFactories) {
+ for (QSGVideoNodeFactoryInterface* factory : qAsConst(m_videoNodeFactories)) {
// Get a node that supports our frame. The surface is irrelevant, our
// QSGVideoItemSurface supports (logically) anything.
videoNode = factory->createNode(QVideoSurfaceFormat(m_frame.size(), m_frame.pixelFormat(), m_frame.handleType()));
@@ -437,7 +438,7 @@ QList<QVideoFrame::PixelFormat> QSGVideoItemSurface::supportedPixelFormats(
return formats;
}
- foreach (QSGVideoNodeFactoryInterface* factory, m_backend->m_videoNodeFactories)
+ for (QSGVideoNodeFactoryInterface* factory : qAsConst(m_backend->m_videoNodeFactories))
formats.append(factory->supportedPixelFormats(handleType));
return formats;