Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
17
#
include
"qhwvideobuffer_p.h"
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
28
static_assert
(QT_CONFIG(gpu_vivante));
29
30
QT_BEGIN_NAMESPACE
31
32
class
QRhi;
33
34
namespace
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.
40
struct
VivanteCpuView
41
{
42
uchar
*
data
=
nullptr
;
43
int
bytesPerLine
= 0;
44
int
dataSize
= 0;
45
};
46
47
class
Q_MULTIMEDIA_EXPORT QVivanteVideoBuffer
final
:
public
QHwVideoBuffer
48
{
49
public
:
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.
57
QVivanteVideoBuffer
(
QVideoFrameFormat
::
PixelFormat
format
,
QSize
,
quint32
physicalAddress
,
58
void
*
logicalAddr
,
GLenum
vivFormatToken
,
59
std
::
shared_ptr
<
void
>
keepAlive
= {},
60
VivanteCpuView
cpuView
= {});
61
~
QVivanteVideoBuffer
()
override
;
62
63
QVideoFrameTexturesUPtr
mapTextures
(
QRhi
&)
override
;
64
65
MapData
map
(
QVideoFrame
::
MapMode
mode
)
override
;
66
void
unmap
()
override
;
67
68
QVideoFrameFormat
::
PixelFormat
pixelFormat
()
const
{
return
m_format
; }
69
QSize
size
()
const
{
return
m_size
; }
70
71
private
:
72
const
QVideoFrameFormat
::
PixelFormat
m_format
;
73
const
QSize
m_size
;
74
const
quint32
m_physicalAddress
;
75
void
*
const
m_logicalAddr
;
76
const
GLenum
m_vivFormatToken
;
77
const
VivanteCpuView
m_cpuView
;
78
79
const
std
::
shared_ptr
<
void
>
m_keepAlive
;
80
81
QVideoFrame
::
MapMode
m_mapMode
=
QVideoFrame
::
NotMapped
;
82
};
83
84
}
// namespace QtMultimediaPrivate
85
86
QT_END_NAMESPACE
87
88
#
endif
// QVIVANTEVIDEOBUFFER_P_H
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
QtMultimediaPrivate::g_vivanteContexts
static QRhiValueMapper< VivanteContext > g_vivanteContexts
Definition
qvivantevideobuffer.cpp:20
QtMultimediaPrivate::vivanteContextForRhi
VivanteContext & vivanteContextForRhi(QRhi &rhi)
Definition
qvivantevideobuffer.cpp:21
Q_STATIC_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
QtMultimediaPrivate::VivanteCpuView
Definition
qvivantevideobuffer_p.h:41
QtMultimediaPrivate::VivanteCpuView::dataSize
int dataSize
Definition
qvivantevideobuffer_p.h:44
QtMultimediaPrivate::VivanteCpuView::data
uchar * data
Definition
qvivantevideobuffer_p.h:42
QtMultimediaPrivate::VivanteCpuView::bytesPerLine
int bytesPerLine
Definition
qvivantevideobuffer_p.h:43
qtmultimedia
src
multimedia
video
qvivantevideobuffer_p.h
Generated on
for Qt by
1.18.0