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#include <system_error>
27
28QT_BEGIN_NAMESPACE
29
30class QSocketNotifier;
31
32namespace QtV4L2 {
33
36
58
59class Q_MULTIMEDIA_EXPORT QV4L2Camera : public QPlatformCamera
60{
62
63public:
64 explicit QV4L2Camera(QCamera *parent);
66
67 bool isActive() const override;
68 void setActive(bool active) override;
69
73
75 void setFocusMode(QCamera::FocusMode /*mode*/) override;
76
77 // void setCustomFocusPoint(const QPointF &/*point*/) override;
78 void setFocusDistance(float) override;
79 void zoomTo(float /*newZoomFactor*/, float /*rate*/ = -1.) override;
80
81 void setFlashMode(QCamera::FlashMode /*mode*/) override;
83 bool isFlashReady() const override;
84
85 void setTorchMode(QCamera::TorchMode /*mode*/) override;
87
91 int isoSensitivity() const override;
94 float exposureTime() const override;
95
98 void setColorTemperature(int /*temperature*/) override;
99
101
102private Q_SLOTS:
103 void readFrame();
104
105private:
107 void closeV4L2Fd();
111
115 void resetCaptureState();
116 void stopCapturing();
118
120
121private:
122 struct NegotiatedFormat
123 {
126 };
127
128 bool m_active = false;
130
134
137
141};
142
143} // namespace QtV4L2
144
145QT_END_NAMESPACE
146
147#endif // QV4L2CAMERA_H
Combined button and popup list for selecting options.
static QString v4l2ErrorMessage(std::error_code error)
static std::chrono::microseconds toMicroseconds(const timeval &tv)
Q_STATIC_LOGGING_CATEGORY(qLcV4L2Camera, "qt.multimedia.v4l2.camera")