diff options
author | Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> | 2016-04-15 07:36:34 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-04-22 11:44:40 +0000 |
commit | 65c9e24c10c7fe715c897572d8f3e5210ea13e07 (patch) | |
tree | 63806484d3b2bd1bf7dc1e0cafecb98e1dc58e27 | |
parent | 5206d3783645ad4caf189ab77ce82f360d1e45bc (diff) | |
download | qtmultimedia-65c9e24c10c7fe715c897572d8f3e5210ea13e07.tar.gz |
winrt: Add categorized logging to camera control
Change-Id: I6d823ac07950212d766905c9409469f2b1b84954
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
-rw-r--r-- | src/plugins/winrt/qwinrtcameracontrol.cpp | 10 | ||||
-rw-r--r-- | src/plugins/winrt/qwinrtcameracontrol.h | 3 | ||||
-rw-r--r-- | src/plugins/winrt/qwinrtcameraimagecapturecontrol.cpp | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index b0446cd57..63428fd84 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -81,6 +81,8 @@ QT_BEGIN_NAMESPACE #define FOCUS_RECT_POSITION_MAX 0.995f // FOCUS_RECT_BOUNDARY - FOCUS_RECT_HALF_SIZE #define ASPECTRATIO_EPSILON 0.01f +Q_LOGGING_CATEGORY(lcMMCamera, "qt.mm.camera") + HRESULT getMediaStreamResolutions(IMediaDeviceController *device, MediaStreamType type, IVectorView<IMediaEncodingProperties *> **propertiesList, @@ -532,6 +534,7 @@ public: QWinRTCameraControl::QWinRTCameraControl(QObject *parent) : QCameraControl(parent), d_ptr(new QWinRTCameraControlPrivate) { + qCDebug(lcMMCamera) << __FUNCTION__ << parent; Q_D(QWinRTCameraControl); d->delayClose = nullptr; @@ -568,6 +571,7 @@ QCamera::State QWinRTCameraControl::state() const void QWinRTCameraControl::setState(QCamera::State state) { + qCDebug(lcMMCamera) << __FUNCTION__ << state; Q_D(QWinRTCameraControl); if (d->state == state) @@ -713,6 +717,7 @@ QCamera::CaptureModes QWinRTCameraControl::captureMode() const void QWinRTCameraControl::setCaptureMode(QCamera::CaptureModes mode) { + qCDebug(lcMMCamera) << __FUNCTION__ << mode; Q_D(QWinRTCameraControl); if (d->captureMode == mode) @@ -791,6 +796,7 @@ void QWinRTCameraControl::onBufferRequested() void QWinRTCameraControl::onApplicationStateChanged(Qt::ApplicationState state) { + qCDebug(lcMMCamera) << __FUNCTION__ << state; Q_D(QWinRTCameraControl); static QCamera::State savedState = d->state; switch (state) { @@ -810,6 +816,7 @@ void QWinRTCameraControl::onApplicationStateChanged(Qt::ApplicationState state) HRESULT QWinRTCameraControl::initialize() { + qCDebug(lcMMCamera) << __FUNCTION__; Q_D(QWinRTCameraControl); if (d->status != QCamera::LoadingStatus) { @@ -1284,6 +1291,7 @@ void QWinRTCameraControl::frameUnmapped() HRESULT QWinRTCameraControl::onCaptureFailed(IMediaCapture *, IMediaCaptureFailedEventArgs *args) { + qCDebug(lcMMCamera) << __FUNCTION__ << args; HRESULT hr; UINT32 code; hr = args->get_Code(&code); @@ -1300,6 +1308,7 @@ HRESULT QWinRTCameraControl::onCaptureFailed(IMediaCapture *, IMediaCaptureFaile HRESULT QWinRTCameraControl::onRecordLimitationExceeded(IMediaCapture *) { + qCDebug(lcMMCamera) << __FUNCTION__; emit error(QCamera::CameraError, QStringLiteral("Recording limit exceeded.")); setState(QCamera::LoadedState); return S_OK; @@ -1307,6 +1316,7 @@ HRESULT QWinRTCameraControl::onRecordLimitationExceeded(IMediaCapture *) void QWinRTCameraControl::emitError(int errorCode, const QString &errorString) { + qCDebug(lcMMCamera) << __FUNCTION__ << errorString << errorCode; emit error(errorCode, errorString); } diff --git a/src/plugins/winrt/qwinrtcameracontrol.h b/src/plugins/winrt/qwinrtcameracontrol.h index 1c0cbd808..c657d5935 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.h +++ b/src/plugins/winrt/qwinrtcameracontrol.h @@ -38,6 +38,7 @@ #define QWINRTCAMERACONTROL_H #include <QtMultimedia/QCameraControl> +#include <QtCore/QLoggingCategory> #include <QtCore/qt_windows.h> #include <wrl.h> @@ -59,6 +60,8 @@ namespace ABI { QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcMMCamera) + class QVideoRendererControl; class QVideoDeviceSelectorControl; class QCameraImageCaptureControl; diff --git a/src/plugins/winrt/qwinrtcameraimagecapturecontrol.cpp b/src/plugins/winrt/qwinrtcameraimagecapturecontrol.cpp index 67f12f264..8ae7f37a9 100644 --- a/src/plugins/winrt/qwinrtcameraimagecapturecontrol.cpp +++ b/src/plugins/winrt/qwinrtcameraimagecapturecontrol.cpp @@ -118,6 +118,7 @@ public: QWinRTCameraImageCaptureControl::QWinRTCameraImageCaptureControl(QWinRTCameraControl *parent) : QCameraImageCaptureControl(parent), d_ptr(new QWinRTCameraImageCaptureControlPrivate) { + qCDebug(lcMMCamera) << __FUNCTION__ << parent; Q_D(QWinRTCameraImageCaptureControl); d->cameraControl = parent; @@ -144,6 +145,7 @@ void QWinRTCameraImageCaptureControl::setDriveMode(QCameraImageCapture::DriveMod int QWinRTCameraImageCaptureControl::capture(const QString &fileName) { + qCDebug(lcMMCamera) << __FUNCTION__ << fileName; Q_D(QWinRTCameraImageCaptureControl); ++d->currentCaptureId; @@ -191,6 +193,7 @@ int QWinRTCameraImageCaptureControl::capture(const QString &fileName) void QWinRTCameraImageCaptureControl::cancelCapture() { + qCDebug(lcMMCamera) << __FUNCTION__; Q_D(QWinRTCameraImageCaptureControl); QHash<IAsyncAction *, CaptureRequest>::iterator it = d->requests.begin(); @@ -205,6 +208,7 @@ void QWinRTCameraImageCaptureControl::cancelCapture() HRESULT QWinRTCameraImageCaptureControl::onCaptureCompleted(IAsyncAction *asyncInfo, AsyncStatus status) { + qCDebug(lcMMCamera) << __FUNCTION__; Q_D(QWinRTCameraImageCaptureControl); if (status == Canceled || !d->requests.contains(asyncInfo)) |