#include <QtMultimedia/qmediaobject.h>
#include <QtMultimedia/qmediaservice.h>
#include <private/qmediapluginloader_p.h>
-
-//#define DEBUG_VIDEOITEM
+#include <QtCore/qloggingcategory.h>
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qLcVideo, "qt.multimedia.video")
+
/*!
\qmltype VideoOutput
\instantiates QDeclarativeVideoOutput
void QDeclarativeVideoOutput::setSource(QObject *source)
{
-#ifdef DEBUG_VIDEOITEM
- qDebug() << Q_FUNC_INFO << source;
-#endif
+ qCDebug(qLcVideo) << "source is" << source;
if (source == m_source.data())
return;
if (m_source)
mediaObject = qobject_cast<QMediaObject*>(m_source.data()->property("mediaObject").value<QObject*>());
-#ifdef DEBUG_VIDEOITEM
- qDebug() << Q_FUNC_INFO << mediaObject;
-#endif
+ qCDebug(qLcVideo) << "media object is" << mediaObject;
if (m_mediaObject.data() == mediaObject)
return;
#include "qdeclarativevideooutput_p.h"
#include <QtMultimedia/qvideorenderercontrol.h>
#include <QtMultimedia/qmediaservice.h>
+#include <QtCore/qloggingcategory.h>
#include <private/qmediapluginloader_p.h>
#include <private/qsgvideonode_p.h>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qLcVideo)
+
Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, videoNodeFactoryLoader,
(QSGVideoNodeFactoryInterface_iid, QLatin1String("video/videonode"), Qt::CaseInsensitive))
m_videoNodeFactories.prepend(plugin);
else
m_videoNodeFactories.append(plugin);
-#ifdef DEBUG_VIDEOITEM
- qDebug() << "found videonode plugin" << key << plugin;
-#endif
+ qCDebug(qLcVideo) << "found videonode plugin" << key << plugin;
}
}
if (m_frameChanged) {
if (videoNode && videoNode->pixelFormat() != m_frame.pixelFormat()) {
-#ifdef DEBUG_VIDEOITEM
- qDebug() << "updatePaintNode: deleting old video node because frame format changed...";
-#endif
+ qCDebug(qLcVideo) << "updatePaintNode: deleting old video node because frame format changed";
delete videoNode;
videoNode = 0;
}
if (!m_frame.isValid()) {
-#ifdef DEBUG_VIDEOITEM
- qDebug() << "updatePaintNode: no frames yet... aborting...";
-#endif
+ qCDebug(qLcVideo) << "updatePaintNode: no frames yet";
m_frameChanged = false;
return 0;
}
foreach (QSGVideoNodeFactoryInterface* factory, m_videoNodeFactories) {
videoNode = factory->createNode(m_surface->surfaceFormat());
if (videoNode) {
-#ifdef DEBUG_VIDEOITEM
- qDebug() << "using video node from factory" << factory;
-#endif
+ qCDebug(qLcVideo) << "updatePaintNode: Video node created. Handle type:" << m_frame.handleType()
+ << " Supported formats for the handle by this node:"
+ << factory->supportedPixelFormats(m_frame.handleType());
break;
}
}
bool QSGVideoItemSurface::start(const QVideoSurfaceFormat &format)
{
-#ifdef DEBUG_VIDEOITEM
- qDebug() << Q_FUNC_INFO << format << supportedPixelFormats(format.handleType());
-#endif
+ qCDebug(qLcVideo) << "Video surface format:" << format << "all supported formats:" << supportedPixelFormats(format.handleType());
if (!supportedPixelFormats(format.handleType()).contains(format.pixelFormat()))
return false;