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 <QtCore/private/qexpected_p.h>
21
22#include <linux/videodev2.h>
23
24#include <chrono>
25#include <optional>
26
27QT_BEGIN_NAMESPACE
28
29class QSocketNotifier;
30
31namespace QtV4L2 {
32
35
59
60class Q_MULTIMEDIA_EXPORT QV4L2Camera : public QPlatformCamera
61{
63
64public:
65 explicit QV4L2Camera(QCamera *parent);
67
68 bool isActive() const override;
69 void setActive(bool active) override;
70
74
76 void setFocusMode(QCamera::FocusMode /*mode*/) override;
77
78 // void setCustomFocusPoint(const QPointF &/*point*/) override;
79 void setFocusDistance(float) override;
80 void zoomTo(float /*newZoomFactor*/, float /*rate*/ = -1.) override;
81
82 void setFlashMode(QCamera::FlashMode /*mode*/) override;
84 bool isFlashReady() const override;
85
86 void setTorchMode(QCamera::TorchMode /*mode*/) override;
88
92 int isoSensitivity() const override;
95 float exposureTime() const override;
96
99 void setColorTemperature(int /*temperature*/) override;
100
102
103private Q_SLOTS:
104 void readFrame();
105
106private:
107 void setCameraBusy();
108 void initV4L2Controls();
109 void closeV4L2Fd();
112 int getV4L2Parameter(quint32 id) const;
113
116 void startCapturing();
117 void stopCapturing();
118
119private:
120 bool m_active = false;
122
126
128
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.
static std::chrono::microseconds toMicroseconds(const timeval &tv)
Q_STATIC_LOGGING_CATEGORY(qLcV4L2Camera, "qt.multimedia.v4l2.camera")