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
qlibcamera_videodevices_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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#ifndef QLIBCAMERA_VIDEODEVICES_P_H
4#define QLIBCAMERA_VIDEODEVICES_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtMultimedia/private/qplatformvideodevices_p.h>
18
19#include <memory>
20
22
23class QPlatformMediaIntegration;
24
25namespace QLibCamera {
26
28
30{
32public:
33 // Returns null only when libcamera::CameraManager::start() failed -- not when the camera
34 // list is currently empty. QPlatformMediaIntegration::videoDevices() memoizes its result
35 // under a std::once_flag, so bailing out on an empty list would make libcamera permanently
36 // unreachable for a camera plugged in after this call.
38
40
41protected:
42 QList<QCameraDevice> findVideoInputs() const override;
43
44private:
45 explicit QLibCameraVideoDevices(QPlatformMediaIntegration *,
46 std::shared_ptr<QLibCameraInstance>);
47
48 // Set once in the constructor and never mutated -- safe to read from any thread, satisfying
49 // findVideoInputs()'s "callable from any thread" contract without needing a mutex of our
50 // own. libcamera::CameraManager::cameras()/get() are themselves documented thread-safe.
51 const std::shared_ptr<QLibCameraInstance> m_instance;
52};
53
54} // namespace QLibCamera
55
56QT_END_NAMESPACE
57
58#endif // QLIBCAMERA_VIDEODEVICES_P_H
QPlatformVideoDevices * createVideoDevices(QPlatformMediaIntegration *parent) override
q23::expected< QPlatformCamera *, QString > createCamera(QCamera *camera) override
QList< QCameraDevice > findVideoInputs() const override
Combined button and popup list for selecting options.