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
qvivantevideobuffer_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 QVIVANTEVIDEOBUFFER_P_H
4#define QVIVANTEVIDEOBUFFER_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/qtmultimediaglobal_p.h>
21
22#include <QtGui/qopenglfunctions.h>
23
24#include <QtCore/qsize.h>
25
26#include <memory>
27
28static_assert(QT_CONFIG(gpu_vivante));
29
30QT_BEGIN_NAMESPACE
31
32class QRhi;
33
34namespace QtMultimediaPrivate {
35
36// An already CPU-mapped, flat view of a Vivante phys-mem buffer, provided
37// by the caller (e.g. after gst_buffer_map() on the GStreamer side).
38// QVivanteVideoBuffer has no fd to mmap itself, so map()/unmap() just hand
39// this view back out.
41{
42 uchar *data = nullptr;
43 int bytesPerLine = 0;
44 int dataSize = 0;
45};
46
47class Q_MULTIMEDIA_EXPORT QVivanteVideoBuffer final : public QHwVideoBuffer
48{
49public:
50 // physicalAddress/logicalAddr describe the Vivante phys-mem allocation
51 // for the zero-copy glTexDirectVIVMap path; physicalAddress is a 32-bit
52 // hardware address (e.g. gst_phys_memory_get_phys_addr()), not a host
53 // pointer. cpuView, if provided, backs the CPU fallback map()/unmap()
54 // (see VivanteCpuView above). keepAlive pins whatever owns this memory
55 // (e.g. a GstBuffer ref) alive for the buffer's lifetime -- there's no
56 // fd here to dup.
59 std::shared_ptr<void> keepAlive = {},
62
64
66 void unmap() override;
67
69 QSize size() const { return m_size; }
70
71private:
73 const QSize m_size;
75 void *const m_logicalAddr;
78
79 const std::shared_ptr<void> m_keepAlive;
80
82};
83
84} // namespace QtMultimediaPrivate
85
86QT_END_NAMESPACE
87
88#endif // QVIVANTEVIDEOBUFFER_P_H
static QRhiValueMapper< VivanteContext > g_vivanteContexts
VivanteContext & vivanteContextForRhi(QRhi &rhi)
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)