CopperSpice API  1.9.1
QCameraControl Class Referenceabstract

Abstract base class for classes which control still cameras or video cameras. More...

Inheritance diagram for QCameraControl:
QMediaControl QObject

Public Types

enum  PropertyChangeType
 

Public Signals

void captureModeChanged (QCamera::CaptureModes mode)
 
void error (int error, const QString &errorString)
 
void stateChanged (QCamera::State state)
 
void statusChanged (QCamera::Status status)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Methods

 ~QCameraControl ()
 
virtual bool canChangeProperty (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
 
- Public Methods inherited from QMediaControl
 ~QMediaControl ()
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Protected Methods

 QCameraControl (QObject *parent=nullptr)
 
- Protected Methods inherited from QMediaControl
 QMediaControl (QObject *parent=nullptr)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Properties inherited from QObject
 objectName
 

Detailed Description

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

The interface name of QCameraControl is "com.copperspice.CS.cameraControl/1.0" as defined in QCameraControl_iid.

See also
QMediaService::requestControl(), QCamera

Member Enumeration Documentation

Specifies a property of the camera control.

Constant Value Description
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.

Constructor & Destructor Documentation

QCameraControl::~QCameraControl ( )

Destruct the camera control object.

QCameraControl::QCameraControl ( QObject parent = nullptr)
explicitprotected

Constructs a camera control object with parent.

Method Documentation

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

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 parameter.

If backend does not 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.

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

Returns the current capture mode.

See also
setCaptureMode()
void QCameraControl::captureModeChanged ( QCamera::CaptureModes  mode)
signal

Signal emitted when the camera capture mode changes.

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

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

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

Returns true if the capture mode is supported.

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

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 is 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.

See also
captureMode()
void QCameraControl::setState ( QCamera::State  state)
pure virtual

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() signal.

See also
state(), QCamera::State
QCamera::State QCameraControl::state ( ) const
pure virtual

Returns the state of the camera service.

See also
setState(), QCamera::state
void QCameraControl::stateChanged ( QCamera::State  state)
signal

Signal emitted when the camera state changes.

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

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

Returns the status of the camera service.

See also
QCamera::state
void QCameraControl::statusChanged ( QCamera::Status  status)
signal

Signal emitted when the camera status changes.