Improved QDeclarativeCameraRecorder errors reporting
Added QDeclarativeCameraRecorder::Error enum to allow specify error codes as CameraRecorder.FormatError. Added QDeclarativeCameraRecorder::errorCode property. Change-Id: Iac5522c3110591493b98e59db18dbfc2d3b7496f Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com> Reviewed-by: Ling Hu <ling.hu@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
25d95a0e63
commit
112820ef46
@@ -344,10 +344,30 @@ void QDeclarativeCameraRecorder::setVideoEncodingMode(QDeclarativeCameraRecorder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX todo
|
/*!
|
||||||
QMediaRecorder::Error QDeclarativeCameraRecorder::error() const
|
\qmlproperty enumeration QtMultimedia5::CameraRecorder::errorCode
|
||||||
|
|
||||||
|
The current error code, if any.
|
||||||
|
|
||||||
|
\table
|
||||||
|
\header \li Value \li Description
|
||||||
|
\row \li NoError
|
||||||
|
\li No Errors
|
||||||
|
|
||||||
|
\row \li ResourceError
|
||||||
|
\li Device is not ready or not available.
|
||||||
|
|
||||||
|
\row \li FormatError
|
||||||
|
\li Current format is not supported.
|
||||||
|
|
||||||
|
\row \li OutOfSpaceError
|
||||||
|
\li No space left on device.
|
||||||
|
|
||||||
|
\endtable
|
||||||
|
*/
|
||||||
|
QDeclarativeCameraRecorder::Error QDeclarativeCameraRecorder::errorCode() const
|
||||||
{
|
{
|
||||||
return m_recorder->error();
|
return QDeclarativeCameraRecorder::Error(m_recorder->error());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -541,7 +561,7 @@ void QDeclarativeCameraRecorder::updateRecorderState(QMediaRecorder::State state
|
|||||||
void QDeclarativeCameraRecorder::updateRecorderError(QMediaRecorder::Error errorCode)
|
void QDeclarativeCameraRecorder::updateRecorderError(QMediaRecorder::Error errorCode)
|
||||||
{
|
{
|
||||||
qWarning() << "QMediaRecorder error:" << errorString();
|
qWarning() << "QMediaRecorder error:" << errorString();
|
||||||
emit error(errorCode);
|
emit error(Error(errorCode), errorString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDeclarativeCameraRecorder::updateActualLocation(const QUrl &url)
|
void QDeclarativeCameraRecorder::updateActualLocation(const QUrl &url)
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class QDeclarativeCameraRecorder : public QObject
|
|||||||
Q_ENUMS(RecorderState)
|
Q_ENUMS(RecorderState)
|
||||||
Q_ENUMS(RecorderStatus)
|
Q_ENUMS(RecorderStatus)
|
||||||
Q_ENUMS(EncodingMode)
|
Q_ENUMS(EncodingMode)
|
||||||
|
Q_ENUMS(Error)
|
||||||
|
|
||||||
Q_PROPERTY(RecorderState recorderState READ recorderState WRITE setRecorderState NOTIFY recorderStateChanged)
|
Q_PROPERTY(RecorderState recorderState READ recorderState WRITE setRecorderState NOTIFY recorderStateChanged)
|
||||||
Q_PROPERTY(RecorderStatus recorderStatus READ recorderStatus NOTIFY recorderStatusChanged)
|
Q_PROPERTY(RecorderStatus recorderStatus READ recorderStatus NOTIFY recorderStatusChanged)
|
||||||
@@ -92,6 +93,7 @@ class QDeclarativeCameraRecorder : public QObject
|
|||||||
Q_PROPERTY(QString actualLocation READ actualLocation NOTIFY actualLocationChanged)
|
Q_PROPERTY(QString actualLocation READ actualLocation NOTIFY actualLocationChanged)
|
||||||
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
|
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
|
||||||
Q_PROPERTY(QString errorString READ errorString NOTIFY error)
|
Q_PROPERTY(QString errorString READ errorString NOTIFY error)
|
||||||
|
Q_PROPERTY(QString errorCode READ errorCode NOTIFY error)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum RecorderState
|
enum RecorderState
|
||||||
@@ -119,6 +121,13 @@ public:
|
|||||||
AverageBitRateEncoding = QtMultimedia::AverageBitRateEncoding
|
AverageBitRateEncoding = QtMultimedia::AverageBitRateEncoding
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum Error {
|
||||||
|
NoError = QMediaRecorder::NoError,
|
||||||
|
ResourceError = QMediaRecorder::ResourceError,
|
||||||
|
FormatError = QMediaRecorder::FormatError,
|
||||||
|
OutOfSpaceError = QMediaRecorder::OutOfSpaceError
|
||||||
|
};
|
||||||
|
|
||||||
~QDeclarativeCameraRecorder();
|
~QDeclarativeCameraRecorder();
|
||||||
|
|
||||||
RecorderState recorderState() const;
|
RecorderState recorderState() const;
|
||||||
@@ -136,7 +145,7 @@ public:
|
|||||||
QString videoCodec() const;
|
QString videoCodec() const;
|
||||||
QString mediaContainer() const;
|
QString mediaContainer() const;
|
||||||
|
|
||||||
QMediaRecorder::Error error() const;
|
Error errorCode() const;
|
||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
|
|
||||||
qreal frameRate() const;
|
qreal frameRate() const;
|
||||||
@@ -180,7 +189,7 @@ Q_SIGNALS:
|
|||||||
void outputLocationChanged(const QString &location);
|
void outputLocationChanged(const QString &location);
|
||||||
void actualLocationChanged(const QString &location);
|
void actualLocationChanged(const QString &location);
|
||||||
|
|
||||||
void error(QMediaRecorder::Error errorCode);
|
void error(QDeclarativeCameraRecorder::Error errorCode, const QString &errorString);
|
||||||
|
|
||||||
void metaDataChanged(const QString &key, const QVariant &value);
|
void metaDataChanged(const QString &key, const QVariant &value);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user