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_dmabufregistry_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_DMABUFREGISTRY_P_H
4#define QLIBCAMERA_DMABUFREGISTRY_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
18
19#include <QtMultimedia/qvideoframeformat.h>
20#include <QtMultimedia/private/qcaptureslotregistry_p.h>
21#include <QtMultimedia/private/qdmabufallocator_p.h>
22#include <QtMultimedia/private/qdmabufsource_p.h>
23#include <QtMultimedia/private/qtmultimediaglobal_p.h>
24
25#include <QtCore/qspan.h>
26
27#include <memory>
28#include <optional>
29#include <vector>
30
31namespace libcamera {
32class Camera;
33class Request;
34class Stream;
35} // namespace libcamera
36
37QT_BEGIN_NAMESPACE
38
39namespace QLibCamera {
40
41#if QT_CONFIG(linux_dmabuf)
42
43// Owns the DMA-BUFs behind the request buffers of a stream. A frame that wraps a buffer holds
44// the buffer's request as a capture slot, which keeps the request out of the camera queue until
45// the frame releases it.
49{
50public:
53
54 // Returns nullptr when the buffers cannot be shared as DMA-BUFs; frames are then copied.
58 const QVideoFrameFormat &, int bytesPerLine);
59
61
62 // Plane placement shared by all buffers; nullopt for formats without a zero-copy layout.
63 const std::optional<DmaBufLayout> &layout() const { return m_layout; }
64
66
67private:
68 struct Buffer
69 {
72 };
73
77
80 const std::vector<Buffer> m_buffers; // CHECK: Should this be a (flat)map for faster lookup?
82};
83
84#endif // QT_CONFIG(linux_dmabuf)
85
86} // namespace QLibCamera
87
88QT_END_NAMESPACE
89
90#endif // QLIBCAMERA_DMABUFREGISTRY_P_H