![]() |
Qt 6.x
The Qt SDK
|
#include <androidcamera_p.h>
Classes | |
struct | FpsRange |
Public Types | |
enum | CameraFacing { CameraFacingBack = 0 , CameraFacingFront = 1 } |
enum | ImageFormat { UnknownImageFormat = 0 , RGB565 = 4 , NV16 = 16 , NV21 = 17 , YUY2 = 20 , JPEG = 256 , YV12 = 842094169 } |
Signals | |
void | previewSizeChanged () |
void | previewStarted () |
void | previewFailedToStart () |
void | previewStopped () |
void | autoFocusStarted () |
void | autoFocusComplete (bool success) |
void | whiteBalanceChanged () |
void | takePictureFailed () |
void | pictureExposed () |
void | pictureCaptured (const QVideoFrame &frame) |
void | lastPreviewFrameFetched (const QVideoFrame &frame) |
void | newPreviewFrame (const QVideoFrame &frame) |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
~AndroidCamera () | |
int | cameraId () const |
bool | lock () |
bool | unlock () |
bool | reconnect () |
void | release () |
CameraFacing | getFacing () |
int | getNativeOrientation () |
QSize | getPreferredPreviewSizeForVideo () |
QList< QSize > | getSupportedPreviewSizes () |
QList< FpsRange > | getSupportedPreviewFpsRange () |
FpsRange | getPreviewFpsRange () |
void | setPreviewFpsRange (FpsRange) |
ImageFormat | getPreviewFormat () |
void | setPreviewFormat (ImageFormat fmt) |
QList< ImageFormat > | getSupportedPreviewFormats () |
QSize | previewSize () const |
QSize | actualPreviewSize () |
void | setPreviewSize (const QSize &size) |
bool | setPreviewTexture (AndroidSurfaceTexture *surfaceTexture) |
bool | setPreviewDisplay (AndroidSurfaceHolder *surfaceHolder) |
void | setDisplayOrientation (int degrees) |
bool | isZoomSupported () |
int | getMaxZoom () |
QList< int > | getZoomRatios () |
int | getZoom () |
void | setZoom (int value) |
QStringList | getSupportedFlashModes () |
QString | getFlashMode () |
void | setFlashMode (const QString &value) |
QStringList | getSupportedFocusModes () |
QString | getFocusMode () |
void | setFocusMode (const QString &value) |
int | getMaxNumFocusAreas () |
QList< QRect > | getFocusAreas () |
void | setFocusAreas (const QList< QRect > &areas) |
void | autoFocus () |
void | cancelAutoFocus () |
bool | isAutoExposureLockSupported () |
bool | getAutoExposureLock () |
void | setAutoExposureLock (bool toggle) |
bool | isAutoWhiteBalanceLockSupported () |
bool | getAutoWhiteBalanceLock () |
void | setAutoWhiteBalanceLock (bool toggle) |
int | getExposureCompensation () |
void | setExposureCompensation (int value) |
float | getExposureCompensationStep () |
int | getMinExposureCompensation () |
int | getMaxExposureCompensation () |
QStringList | getSupportedSceneModes () |
QString | getSceneMode () |
void | setSceneMode (const QString &value) |
QStringList | getSupportedWhiteBalance () |
QString | getWhiteBalance () |
void | setWhiteBalance (const QString &value) |
void | setRotation (int rotation) |
int | getRotation () const |
QList< QCameraFormat > | getSupportedFormats () |
QList< QSize > | getSupportedPictureSizes () |
QList< QSize > | getSupportedVideoSizes () |
void | setPictureSize (const QSize &size) |
void | setJpegQuality (int quality) |
void | startPreview () |
void | stopPreview () |
void | stopPreviewSynchronous () |
void | takePicture () |
void | setupPreviewFrameCallback () |
void | notifyNewFrames (bool notify) |
void | fetchLastPreviewFrame () |
QJniObject | getCameraObject () |
QJniObject | getParametersObject () |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
QString | objectName |
the name of this object | |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 34 of file androidcamera_p.h.
Enumerator | |
---|---|
CameraFacingBack | |
CameraFacingFront |
Definition at line 38 of file androidcamera_p.h.
Enumerator | |
---|---|
UnknownImageFormat | |
RGB565 | |
NV16 | |
NV21 | |
YUY2 | |
JPEG | |
YV12 |
Definition at line 44 of file androidcamera_p.h.
AndroidCamera::~AndroidCamera | ( | ) |
Definition at line 304 of file androidcamera.cpp.
References cameraId(), d, QThread::exit(), release(), and QThread::wait().
QSize AndroidCamera::actualPreviewSize | ( | ) |
Definition at line 445 of file androidcamera.cpp.
References d.
|
static |
Definition at line 828 of file androidcamera.cpp.
References QVideoFrameFormat::Format_Jpeg, QVideoFrameFormat::Format_NV21, QVideoFrameFormat::Format_YUYV, QVideoFrameFormat::Format_YV12, JPEG, NV21, UnknownImageFormat, YUY2, and YV12.
Referenced by QAndroidCameraSession::setCameraFormat().
void AndroidCamera::autoFocus | ( | ) |
Definition at line 578 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
|
signal |
|
signal |
int AndroidCamera::cameraId | ( | ) | const |
Definition at line 343 of file androidcamera.cpp.
References d.
Referenced by ~AndroidCamera(), and open().
void AndroidCamera::cancelAutoFocus | ( | ) |
Definition at line 584 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Qt::QueuedConnection.
Referenced by QAndroidCamera::setFocusMode().
void AndroidCamera::fetchLastPreviewFrame | ( | ) |
Definition at line 754 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
bool AndroidCamera::getAutoExposureLock | ( | ) |
Definition at line 596 of file androidcamera.cpp.
References d.
bool AndroidCamera::getAutoWhiteBalanceLock | ( | ) |
Definition at line 614 of file androidcamera.cpp.
References d.
|
static |
Definition at line 775 of file androidcamera.cpp.
References arg, QCameraDevice::BackFace, CameraFacingBack, CameraFacingFront, QCameraDevice::FrontFace, info, QByteArray::number(), Q_ASSERT, and QStringLiteral.
QJniObject AndroidCamera::getCameraObject | ( | ) |
Definition at line 760 of file androidcamera.cpp.
References d.
int AndroidCamera::getExposureCompensation | ( | ) |
Definition at line 626 of file androidcamera.cpp.
References d.
float AndroidCamera::getExposureCompensationStep | ( | ) |
Definition at line 638 of file androidcamera.cpp.
References d.
AndroidCamera::CameraFacing AndroidCamera::getFacing | ( | ) |
Definition at line 379 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::currentCameraRotation(), and QAndroidCaptureSession::start().
QString AndroidCamera::getFlashMode | ( | ) |
Definition at line 530 of file androidcamera.cpp.
References d.
Definition at line 566 of file androidcamera.cpp.
References d.
QString AndroidCamera::getFocusMode | ( | ) |
Definition at line 548 of file androidcamera.cpp.
References d.
int AndroidCamera::getMaxExposureCompensation | ( | ) |
Definition at line 650 of file androidcamera.cpp.
References d.
int AndroidCamera::getMaxNumFocusAreas | ( | ) |
Definition at line 560 of file androidcamera.cpp.
References d.
int AndroidCamera::getMaxZoom | ( | ) |
Definition at line 500 of file androidcamera.cpp.
References d.
int AndroidCamera::getMinExposureCompensation | ( | ) |
Definition at line 644 of file androidcamera.cpp.
References d.
int AndroidCamera::getNativeOrientation | ( | ) |
Definition at line 385 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::currentCameraRotation().
|
static |
Definition at line 766 of file androidcamera.cpp.
References qt_androidCheckCameraPermission().
QJniObject AndroidCamera::getParametersObject | ( | ) |
Definition at line 880 of file androidcamera.cpp.
References d.
QSize AndroidCamera::getPreferredPreviewSizeForVideo | ( | ) |
Definition at line 391 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::applyResolution().
AndroidCamera::ImageFormat AndroidCamera::getPreviewFormat | ( | ) |
Definition at line 421 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::applyResolution().
AndroidCamera::FpsRange AndroidCamera::getPreviewFpsRange | ( | ) |
Definition at line 409 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::applyResolution(), and getSupportedFormats().
int AndroidCamera::getRotation | ( | ) | const |
Definition at line 706 of file androidcamera.cpp.
References d.
QString AndroidCamera::getSceneMode | ( | ) |
Definition at line 662 of file androidcamera.cpp.
References d.
QStringList AndroidCamera::getSupportedFlashModes | ( | ) |
Definition at line 524 of file androidcamera.cpp.
References d.
QStringList AndroidCamera::getSupportedFocusModes | ( | ) |
Definition at line 542 of file androidcamera.cpp.
References d.
QList< QCameraFormat > AndroidCamera::getSupportedFormats | ( | ) |
Definition at line 844 of file androidcamera.cpp.
References getPreviewFpsRange(), getSupportedPreviewFormats(), getSupportedVideoSizes(), previewSize(), and QtPixelFormatFromAndroidImageFormat().
Definition at line 712 of file androidcamera.cpp.
References d.
QList< AndroidCamera::ImageFormat > AndroidCamera::getSupportedPreviewFormats | ( | ) |
Definition at line 433 of file androidcamera.cpp.
References d.
Referenced by getSupportedFormats(), and QAndroidCameraSession::getSupportedPixelFormats().
QList< AndroidCamera::FpsRange > AndroidCamera::getSupportedPreviewFpsRange | ( | ) |
Definition at line 403 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::getSupportedPreviewFpsRange().
Definition at line 397 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::applyResolution(), and QAndroidCameraSession::getSupportedPreviewSizes().
QStringList AndroidCamera::getSupportedSceneModes | ( | ) |
Definition at line 656 of file androidcamera.cpp.
References d.
Definition at line 718 of file androidcamera.cpp.
References d.
Referenced by getSupportedFormats().
QStringList AndroidCamera::getSupportedWhiteBalance | ( | ) |
Definition at line 674 of file androidcamera.cpp.
References d.
QString AndroidCamera::getWhiteBalance | ( | ) |
Definition at line 680 of file androidcamera.cpp.
References d.
int AndroidCamera::getZoom | ( | ) |
Definition at line 512 of file androidcamera.cpp.
References d.
QList< int > AndroidCamera::getZoomRatios | ( | ) |
Definition at line 506 of file androidcamera.cpp.
References d.
bool AndroidCamera::isAutoExposureLockSupported | ( | ) |
Definition at line 590 of file androidcamera.cpp.
References d.
bool AndroidCamera::isAutoWhiteBalanceLockSupported | ( | ) |
Definition at line 608 of file androidcamera.cpp.
References d.
bool AndroidCamera::isZoomSupported | ( | ) |
Definition at line 494 of file androidcamera.cpp.
References d.
|
signal |
bool AndroidCamera::lock | ( | ) |
Definition at line 349 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, QMetaObject::invokeMethod(), ok, and Q_RETURN_ARG.
|
signal |
void AndroidCamera::notifyNewFrames | ( | bool | notify | ) |
Definition at line 748 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCameraSession::setPreviewCallback().
|
static |
Definition at line 317 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, cameraId(), QObject::connect(), d, QObject::deleteLater(), QThread::finished(), QMetaObject::invokeMethod(), ok, Q_ARG, Q_RETURN_ARG, qt_androidCheckCameraPermission(), QThread::quit(), QThread::start(), and QThread::wait().
|
signal |
|
signal |
|
signal |
QSize AndroidCamera::previewSize | ( | ) | const |
Definition at line 439 of file androidcamera.cpp.
References d.
Referenced by QAndroidCameraSession::applyResolution(), and getSupportedFormats().
|
signal |
|
signal |
|
signal |
|
static |
Definition at line 812 of file androidcamera.cpp.
References QVideoFrameFormat::Format_Invalid, QVideoFrameFormat::Format_Jpeg, QVideoFrameFormat::Format_NV21, QVideoFrameFormat::Format_YUYV, QVideoFrameFormat::Format_YV12, JPEG, NV21, YUY2, and YV12.
Referenced by getSupportedFormats(), and QAndroidCameraSession::getSupportedPixelFormats().
bool AndroidCamera::reconnect | ( | ) |
Definition at line 365 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, QMetaObject::invokeMethod(), ok, and Q_RETURN_ARG.
|
static |
Definition at line 1772 of file androidcamera.cpp.
References methods, notifyAutoFocusComplete(), notifyFrameAvailable(), notifyNewPreviewFrame(), notifyPictureCaptured(), and notifyPictureExposed().
Referenced by JNI_OnLoad().
void AndroidCamera::release | ( | ) |
Definition at line 373 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, and QMetaObject::invokeMethod().
Referenced by ~AndroidCamera().
|
static |
void AndroidCamera::setAutoExposureLock | ( | bool | toggle | ) |
Definition at line 602 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
void AndroidCamera::setAutoWhiteBalanceLock | ( | bool | toggle | ) |
Definition at line 620 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
void AndroidCamera::setDisplayOrientation | ( | int | degrees | ) |
Definition at line 488 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), Q_ARG, and Qt::QueuedConnection.
void AndroidCamera::setExposureCompensation | ( | int | value | ) |
Definition at line 632 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCamera::setExposureCompensation().
Definition at line 536 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCamera::setFlashMode().
Definition at line 572 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Definition at line 554 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCamera::setFocusMode().
void AndroidCamera::setJpegQuality | ( | int | quality | ) |
Definition at line 730 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Definition at line 724 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
bool AndroidCamera::setPreviewDisplay | ( | AndroidSurfaceHolder * | surfaceHolder | ) |
Definition at line 476 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, QMetaObject::invokeMethod(), ok, Q_ARG, Q_RETURN_ARG, and AndroidSurfaceHolder::surfaceHolder().
void AndroidCamera::setPreviewFormat | ( | ImageFormat | fmt | ) |
Definition at line 427 of file androidcamera.cpp.
References d, fmt, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCameraSession::applyResolution(), and QAndroidCameraSession::setPreviewFormat().
Definition at line 415 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCameraSession::applyResolution().
Definition at line 451 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
Referenced by QAndroidCameraSession::applyResolution().
bool AndroidCamera::setPreviewTexture | ( | AndroidSurfaceTexture * | surfaceTexture | ) |
Definition at line 464 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, QMetaObject::invokeMethod(), ok, Q_ARG, Q_RETURN_ARG, and AndroidSurfaceTexture::surfaceTexture().
void AndroidCamera::setRotation | ( | int | rotation | ) |
Definition at line 692 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
Definition at line 668 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCamera::setExposureMode().
void AndroidCamera::setupPreviewFrameCallback | ( | ) |
Definition at line 742 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
Referenced by QAndroidCaptureSession::start().
Definition at line 686 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
void AndroidCamera::setZoom | ( | int | value | ) |
Definition at line 518 of file androidcamera.cpp.
References d, QMetaObject::invokeMethod(), and Q_ARG.
Referenced by QAndroidCamera::zoomTo().
void AndroidCamera::startPreview | ( | ) |
Definition at line 862 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
Referenced by QAndroidCameraSession::applyResolution().
void AndroidCamera::stopPreview | ( | ) |
Definition at line 868 of file androidcamera.cpp.
References d, and QMetaObject::invokeMethod().
Referenced by QAndroidCameraSession::applyResolution().
void AndroidCamera::stopPreviewSynchronous | ( | ) |
Definition at line 874 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, and QMetaObject::invokeMethod().
Referenced by QAndroidCaptureSession::start().
void AndroidCamera::takePicture | ( | ) |
Definition at line 736 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, and QMetaObject::invokeMethod().
|
signal |
bool AndroidCamera::unlock | ( | ) |
Definition at line 357 of file androidcamera.cpp.
References Qt::BlockingQueuedConnection, d, QMetaObject::invokeMethod(), ok, and Q_RETURN_ARG.
Referenced by QAndroidCaptureSession::start().
|
signal |