54 QVideoFrameFormat::ColorRange colorRange)
const override;
70 void clearAvCaptureSessionInputDevice();
71 [[nodiscard]] q23::expected<
void, QString> setupAvCaptureSessionInputDevice(AVCaptureDevice *);
72 void clearAvCaptureVideoDataOutput();
73 [[nodiscard]] q23::expected<
void, QString> setupAvCaptureVideoDataOutput(AVCaptureDevice *);
74 [[nodiscard]] q23::expected<
void, QString> tryApplyFormatToCaptureSession(
76 AVCaptureDeviceFormat *,
77 const QCameraFormat &);
78 void clearRotationTracking();
79 void setupRotationTracking(AVCaptureDevice *);
80 void clearCaptureSessionConfiguration();
81 [[nodiscard]] q23::expected<
void, QString> tryConfigureCaptureSession(
82 const QCameraDevice &,
83 const QCameraFormat &);
84 [[nodiscard]] q23::expected<
void, QString> tryConfigureCaptureSession(
86 const QCameraFormat &);
87 [[nodiscard]] q23::expected<
void, QString> tryConfigureCaptureSession(
89 AVCaptureDeviceFormat *,
90 const QCameraFormat &);
92 void onStillPhotoDelegateSucceeded(
const QVideoFrame &image);
93 void onStillPhotoDelegateFailed(QImageCapture::Error errType,
const QString &errMsg);
95 [[nodiscard]] QSize adjustedResolution(
const QCameraFormat& format)
const;
97 [[nodiscard]]
int getCurrentRotationAngleDegrees()
const;
99 QMediaCaptureSession *m_qMediaCaptureSession =
nullptr;
100 AVFScopedPointer<AVCaptureSession> m_avCaptureSession;
101 AVFScopedPointer<AVCapturePhotoOutput> m_avCapturePhotoOutput;
102 AVFScopedPointer<AVCaptureDeviceInput> m_avCaptureDeviceVideoInput;
103 AVFScopedPointer<AVCaptureVideoDataOutput> m_avCaptureVideoDataOutput;
104 AVFScopedPointer<QAVFSampleBufferDelegate> m_qAvfSampleBufferDelegate;
109 uint32_t m_cvPixelFormat = 0;
111 std::optional<QFFmpeg::AvfCameraRotationTracker> m_qAvfCameraRotationTracker;
119 AVFScopedPointer<QAVFCapturePhotoOutputDelegate> m_qAvfCapturePhotoOutputDelegate;
120 [[nodiscard]]
bool stillPhotoCaptureInProgress()
const
122 return m_qAvfCapturePhotoOutputDelegate.data();
125 AVFScopedPointer<dispatch_queue_t> m_delegateQueue;