Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qandroidcamera_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
5#ifndef QANDROIDCAMERACONTROL_H
6#define QANDROIDCAMERACONTROL_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qplatformcamera_p.h>
20
21#include <qmap.h>
22
24
26class QAndroidCameraVideoRendererControl;
28
30{
32public:
33 explicit QAndroidCamera(QCamera *camera);
34 virtual ~QAndroidCamera();
35
36 bool isActive() const override;
37 void setActive(bool active) override;
38
39 void setCamera(const QCameraDevice &camera) override;
40 bool setCameraFormat(const QCameraFormat &format) override;
41
42 void setCaptureSession(QPlatformMediaCaptureSession *session) override;
43
45 bool isFocusModeSupported(QCamera::FocusMode mode) const override;
46
47 void zoomTo(float factor, float rate) override;
48
50 bool isFlashModeSupported(QCamera::FlashMode mode) const override;
51 bool isFlashReady() const override;
52
54 bool isTorchModeSupported(QCamera::TorchMode mode) const override;
55
58
59 void setExposureCompensation(float bias) override;
60
63
64private Q_SLOTS:
65 void onCameraOpened();
66 void setCameraFocusArea();
67
68private:
69 void reactivateCameraSession();
70
71 QAndroidCameraSession *m_cameraSession = nullptr;
72 QAndroidMediaCaptureSession *m_service = nullptr;
73
74 QList<QCamera::FocusMode> m_supportedFocusModes;
75 bool m_continuousPictureFocusSupported = false;
76 bool m_continuousVideoFocusSupported = false;
77 bool m_focusPointSupported = false;
78
79 QList<int> m_zoomRatios;
80
81 QList<QCamera::ExposureMode> m_supportedExposureModes;
82 int m_minExposureCompensationIndex;
83 int m_maxExposureCompensationIndex;
84 qreal m_exposureCompensationStep;
85
86 bool isFlashSupported = false;
87 bool isFlashAutoSupported = false;
88 bool isTorchSupported = false;
89 bool isPendingSetActive = false;
90 QCameraDevice m_cameraDev;
91
92 QMap<QCamera::WhiteBalanceMode, QString> m_supportedWhiteBalanceModes;
93 QCameraFormat m_cameraFormat;
94};
95
96
98
99#endif // QANDROIDCAMERACONTROL_H
void setCaptureSession(QPlatformMediaCaptureSession *session) override
void setExposureCompensation(float bias) override
void setFocusMode(QCamera::FocusMode mode) override
void setExposureMode(QCamera::ExposureMode mode) override
bool isTorchModeSupported(QCamera::TorchMode mode) const override
QAndroidCamera(QCamera *camera)
void setFlashMode(QCamera::FlashMode mode) override
bool isWhiteBalanceModeSupported(QCamera::WhiteBalanceMode mode) const override
void zoomTo(float factor, float rate) override
void setCamera(const QCameraDevice &camera) override
bool isFocusModeSupported(QCamera::FocusMode mode) const override
bool setCameraFormat(const QCameraFormat &format) override
bool isFlashReady() const override
void setWhiteBalanceMode(QCamera::WhiteBalanceMode mode) override
bool isFlashModeSupported(QCamera::FlashMode mode) const override
virtual ~QAndroidCamera()
void setActive(bool active) override
bool isActive() const override
bool isExposureModeSupported(QCamera::ExposureMode mode) const override
void setTorchMode(QCamera::TorchMode mode) override
The QCameraDevice class provides general information about camera devices.
The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia...
The QCamera class provides interface for system camera devices.
Definition qcamera.h:28
WhiteBalanceMode
\value WhiteBalanceAuto Auto white balance mode.
Definition qcamera.h:112
TorchMode
\value TorchOff Torch is Off.
Definition qcamera.h:84
FocusMode
\value FocusModeAuto Continuous auto focus mode.
Definition qcamera.h:67
FlashMode
\value FlashOff Flash is Off.
Definition qcamera.h:77
ExposureMode
\value ExposureAuto Automatic mode.
Definition qcamera.h:91
QCamera * camera
Definition camera.cpp:19
Combined button and popup list for selecting options.
GLenum mode
GLint GLsizei GLsizei GLenum format
GLfloat bias
GLuint GLenum * rate
#define Q_OBJECT
#define Q_SLOTS
double qreal
Definition qtypes.h:187