QCameraControl Class

The QCameraControl class is an abstract base class for classes that control still cameras or video cameras. 更多...

頭: #include <QCameraControl>
qmake: QT += multimedia
繼承: QMediaControl

該類已過時。 提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

公共類型

enum PropertyChangeType { CaptureMode, ImageEncodingSettings, VideoEncodingSettings, Viewfinder, ViewfinderSettings }

公共函數

virtual ~QCameraControl ()
virtual bool canChangeProperty (QCameraControl::PropertyChangeType changeType , QCamera::Status status ) const = 0
virtual QCamera::CaptureModes captureMode () const = 0
virtual bool isCaptureModeSupported (QCamera::CaptureModes mode ) const = 0
virtual void setCaptureMode (QCamera::CaptureModes mode ) = 0
virtual void setState (QCamera::State state ) = 0
virtual QCamera::State state () const = 0
virtual QCamera::Status status () const = 0

信號

void captureModeChanged (QCamera::CaptureModes mode )
void error (int error , const QString & errorString )
void stateChanged (QCamera::State state )
void statusChanged (QCamera::Status status )

保護函數

QCameraControl (QObject * parent = nullptr)

QCameraControl_iid

詳細描述

此服務的提供是通過 QMediaService 對象憑藉 QMediaService::control()。它被用於 QCamera .

The interface name of QCameraControl is org.qt-project.qt.cameracontrol/5.0 作為定義在 QCameraControl_iid .

另請參閱 QMediaService::requestControl () 和 QCamera .

成員類型文檔編製

enum QCameraControl:: PropertyChangeType

常量 描述
QCameraControl::CaptureMode 1 Indicates the capture mode is changed.
QCameraControl::ImageEncodingSettings 2 Image encoder settings are changed, including resolution.
QCameraControl::VideoEncodingSettings 3 Video encoder settings are changed, including audio, video and container settings.
QCameraControl::Viewfinder 4 Viewfinder is changed.
QCameraControl::ViewfinderSettings 5 Viewfinder settings are changed.

成員函數文檔編製

[protected] QCameraControl:: QCameraControl ( QObject * parent = nullptr)

Constructs a camera control object with parent .

[signal] void QCameraControl:: captureModeChanged ( QCamera::CaptureModes mode )

Signal emitted when the camera capture mode 改變。

[signal] void QCameraControl:: error ( int error , const QString & errorString )

Signal emitted when an error occurs with error code error and a description of the error errorString .

[signal] void QCameraControl:: stateChanged ( QCamera::State state )

Signal emitted when the camera state 改變。

In most cases the state chage is caused by QCameraControl::setState (), but if critical error has occurred the state changes to QCamera::UnloadedState .

[signal] void QCameraControl:: statusChanged ( QCamera::Status status )

Signal emitted when the camera status 改變。

[虛擬] QCameraControl:: ~QCameraControl ()

Destruct the camera control object.

[pure virtual] bool QCameraControl:: canChangeProperty ( QCameraControl::PropertyChangeType changeType , QCamera::Status status ) const

Returns true if backend can effectively apply changing camera properties of changeType type while the camera state is QCamera::Active and camera status matches status 參數。

If backend doesn't support applying this change in the active state, it will be stopped before the settings are changed and restarted after. Otherwise the backend should apply the change in the current state, with the camera status indicating the progress, if necessary.

[pure virtual] QCamera::CaptureModes QCameraControl:: captureMode () const

Returns the current capture mode.

另請參閱 setCaptureMode ().

[pure virtual] bool QCameraControl:: isCaptureModeSupported ( QCamera::CaptureModes mode ) const

Returns true if the capture mode is suported.

[pure virtual] void QCameraControl:: setCaptureMode ( QCamera::CaptureModes mode )

Sets the current capture mode .

The capture mode changes are synchronous and allowed in any camera state.

If the capture mode is changed while camera is active, it's recommended to change status to QCamera::LoadedStatus and start activating the camera in the next event loop with the status changed to QCamera::StartingStatus . This allows the capture settings to be applied before camera is started. Than change the status to QCamera::StartedStatus when the capture mode change is done.

另請參閱 captureMode ().

[pure virtual] void QCameraControl:: setState ( QCamera::State state )

Sets the camera state .

State changes are synchronous and indicate user intention, while camera status is used as a feedback mechanism to inform application about backend status. Status changes are reported asynchronously with QCameraControl::statusChanged () 信號。

另請參閱 state () 和 QCamera::State .

[pure virtual] QCamera::State QCameraControl:: state () const

Returns the state of the camera service.

另請參閱 setState () 和 QCamera::state .

[pure virtual] QCamera::Status QCameraControl:: status () const

Returns the status of the camera service.

另請參閱 QCamera::state .

宏文檔編製

QCameraControl_iid

org.qt-project.qt.cameracontrol/5.0

定義接口名為 QCameraControl 類。