summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin/camerabinsession.h
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-01-21 14:11:42 +0100
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-02-18 13:14:59 +0000
commitd9354b2299a9a521854c5c6e6ab29163376f8ebc (patch)
tree2914442ba45110e6bd93f01a226e5be4869726a8 /src/plugins/gstreamer/camerabin/camerabinsession.h
parente49d92959c59f7d9650a37b1860c556e5d0cf2a3 (diff)
GStreamer: fix camerabin state and status changes.
Not all status changes where reported and setting the QCamera to LoadedState was not actually loading anything. State and status changes have been refactored. Camera status is now reported directly by the camera session. Setting the camera state to LoadedState now sets the camerabin to GST_STATE_READY, that allows to query for camera capabilities without having to start the camera (and have a valid viewfinder). Change-Id: I249b1ad32690679ff34a427410bc709ed3ab461c Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinsession.h')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.h b/src/plugins/gstreamer/camerabin/camerabinsession.h
index 723759b6a..d4214a620 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.h
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.h
@@ -148,7 +148,7 @@ public:
void captureImage(int requestId, const QString &fileName);
- QCamera::State state() const;
+ QCamera::Status status() const;
QCamera::State pendingState() const;
bool isBusy() const;
@@ -163,7 +163,7 @@ public:
bool processBusMessage(const QGstreamerMessage &message);
signals:
- void stateChanged(QCamera::State state);
+ void statusChanged(QCamera::Status status);
void pendingStateChanged(QCamera::State state);
void durationChanged(qint64 duration);
void error(int error, const QString &errorString);
@@ -185,6 +185,15 @@ private slots:
void handleViewfinderChange();
private:
+ void load();
+ void unload();
+ void start();
+ void stop();
+
+ void setStatus(QCamera::Status status);
+ void setStateHelper(QCamera::State state);
+ void setError(int error, const QString &errorString);
+
bool setupCameraBin();
void setupCaptureResolution();
void setAudioCaptureCaps();
@@ -197,7 +206,7 @@ private:
QUrl m_actualSink;
bool m_recordingActive;
QString m_captureDevice;
- QCamera::State m_state;
+ QCamera::Status m_status;
QCamera::State m_pendingState;
QString m_inputDevice;
bool m_muted;