Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4l2camera_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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#ifndef QV4L2CAMERA_H
5#define QV4L2CAMERA_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtMultimedia/private/qplatformcamera_p.h>
19
20#include <sys/time.h>
21
22QT_BEGIN_NAMESPACE
23
24class QSocketNotifier;
25
26namespace QtV4L2 {
27
30
54
56uint32_t v4l2FormatForPixelFormat(QVideoFrameFormat::PixelFormat format);
57
58class Q_MULTIMEDIA_EXPORT QV4L2Camera : public QPlatformCamera
59{
61
62public:
63 explicit QV4L2Camera(QCamera *parent);
65
66 bool isActive() const override;
67 void setActive(bool active) override;
68
72
74 void setFocusMode(QCamera::FocusMode /*mode*/) override;
75
76 // void setCustomFocusPoint(const QPointF &/*point*/) override;
77 void setFocusDistance(float) override;
78 void zoomTo(float /*newZoomFactor*/, float /*rate*/ = -1.) override;
79
80 void setFlashMode(QCamera::FlashMode /*mode*/) override;
82 bool isFlashReady() const override;
83
84 void setTorchMode(QCamera::TorchMode /*mode*/) override;
86
90 int isoSensitivity() const override;
93 float exposureTime() const override;
94
97 void setColorTemperature(int /*temperature*/) override;
98
100
101private Q_SLOTS:
102 void readFrame();
103
104private:
105 void setCameraBusy();
106 void initV4L2Controls();
107 void closeV4L2Fd();
110 int getV4L2Parameter(quint32 id) const;
111
112 void setV4L2CameraFormat();
114 void startCapturing();
115 void stopCapturing();
116
117private:
118 bool m_active = false;
120
124
126
127 timeval m_firstFrameTime = { -1, -1 };
132 bool m_cameraBusy = false;
133};
134
135} // namespace QtV4L2
136
137QT_END_NAMESPACE
138
139#endif // QV4L2CAMERA_H
Combined button and popup list for selecting options.
uint32_t v4l2FormatForPixelFormat(QVideoFrameFormat::PixelFormat format)
QVideoFrameFormat::PixelFormat fmt
QVideoFrameFormat::PixelFormat formatForV4L2Format(uint32_t v4l2Format)
Q_STATIC_LOGGING_CATEGORY(qLcV4L2Camera, "qt.multimedia.v4l2.camera")
uint32_t v4l2Format