4#ifndef QANDROIDCAMERA_H
5#define QANDROIDCAMERA_H
18#include <QtMultimedia/private/qplatformcamera_p.h>
20#include <QtCore/qjniobject.h>
21#include <QtCore/qobject.h>
23#include <QtMultimedia/qimagecapture.h>
25#include <QtFFmpegMediaPluginImpl/private/qffmpeghwaccel_p.h>
35class QAndroidVideoFrameFactory;
55 void setCamera(
const QCameraDevice &camera)
override;
102 bool isActivating()
const {
return m_state != State::Closed; }
104 void setState(State newState);
105 QtVideo::Rotation rotation()
const;
106 void updateCameraCharacteristics();
107 void cleanCameraCharacteristics();
108 QSize stillResolution()
const;
109 void applyStillResolution();
111 void restartCamera();
112 void queueCameraRestart();
115 QCameraDevice m_cameraDevice;
116 QtJniCamera2 m_jniCamera;
118 std::unique_ptr<QFFmpeg::HWAccel> m_hwAccel;
120 std::shared_ptr<QAndroidVideoFrameFactory> m_frameFactory;
121 QVideoFrameFormat::PixelFormat m_androidFramePixelFormat;
122 QList<QCamera::FlashMode> m_supportedFlashModes;
125 QList<QCamera::FocusMode> m_supportedFocusModes;
126 bool m_TorchModeSupported =
false;
127 bool m_wasActive =
false;
129 bool m_waitingForFirstFrame =
false;
130 QSize m_videoResolution;
131 QSize m_requestedStillResolution;
132 QSize m_stillReaderSize;
133 std::atomic<
bool> m_restartPending =
false;
void onStillPhotoCaptureFailed()
void setFocusMode(QCamera::FocusMode mode) override
void onCameraDisconnect()
void onImageCaptureFailed(QImageCapture::Error error, const QString &errMsg)
bool isTorchModeSupported(QCamera::TorchMode mode) const override
QVideoFrameFormat frameFormat() const override
void onStillReaderSwapFailed()
QAndroidCamera(QCamera *camera)
void setFlashMode(QCamera::FlashMode mode) override
static bool registerNativeMethods()
void onCaptureSessionFailed(int reason, long frameNumber)
void zoomTo(float factor, float rate) override
~QAndroidCamera() override
void setCamera(const QCameraDevice &camera) override
void onCaptureSessionConfigured()
bool setCameraFormat(const QCameraFormat &format) override
void frameAvailable(QJniObject image, bool takePhoto=false)
bool isFlashReady() const override
bool isActive() const override
void setFocusDistance(float distance) override
void updateExif(const QString &filename)
void setStillCaptureResolution(QSize resolution)
bool isFocusModeSupported(QCamera::FocusMode focusMode) const override
bool isFlashModeSupported(QCamera::FlashMode mode) const override
std::optional< int > ffmpegHWPixelFormat() const override
void onCaptureSessionConfigureFailed()
void setActive(bool active) override
void onCameraError(int error)
void setTorchMode(QCamera::TorchMode mode) override
Q_DECLARE_JNI_CLASS(MotionEvent, "android/view/MotionEvent")