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
qpipewire_videostream_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
4#ifndef QPIPEWIRE_VIDEOSTREAM_P_H
5#define QPIPEWIRE_VIDEOSTREAM_P_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/qpipewire_cameracontextmanager_p.h>
19#include <QtMultimedia/private/qtmultimediaglobal_p.h>
20#include <QtMultimedia/qvideoframe.h>
21#include <QtMultimedia/qvideoframeformat.h>
22#include <QtCore/qbytearray.h>
23#include <QtCore/qmutex.h>
24#include <QtCore/qobject.h>
25#include <QtCore/qsize.h>
26
27#include <bitset>
28#include <optional>
29
30#include <spa/buffer/buffer.h>
31#include <spa/param/video/format.h>
32
33#include <pipewire/version.h>
34
35// DMABUF negotiation needs SPA_FORMAT_VIDEO_modifier/SPA_VIDEO_FLAG_MODIFIER(_FIXATION_REQUIRED)
36// and SPA_PARAM_BUFFERS_dataType, none of which older libspa headers declare.
37#if QT_CONFIG(linux_dmabuf) && PW_CHECK_VERSION(0, 3, 76)
38# define QT_PIPEWIRE_HAS_DMABUF_CAMERA 1
39#else
40# define QT_PIPEWIRE_HAS_DMABUF_CAMERA 0
41#endif
42
43QT_BEGIN_NAMESPACE
44
45namespace QtPipeWire {
46
48
49class Q_MULTIMEDIA_EXPORT QPipeWireVideoStream : public QObject
50{
52
53public:
58
60
61 bool start();
62
64
68
69private:
72 void onProcess();
73
75 // Answers a SPA_VIDEO_FLAG_MODIFIER_FIXATION_REQUIRED request with the one
76 // modifier we can read, which makes the server send a fixated format.
78#endif
79
80 static const pw_stream_events &streamEvents();
81
87
90
91 mutable QMutex m_formatMutex;
93
94 // Only meaningful on the event loop thread. A DMABUF buffer is only read when
95 // its layout is known: a compressed byte stream, or raw with a linear modifier.
96 bool m_dmaBufReadable = false;
98};
99
100} // namespace QtPipeWire
101
102QT_END_NAMESPACE
103
104#endif // QPIPEWIRE_VIDEOSTREAM_P_H
Q_STATIC_LOGGING_CATEGORY(lcPipewireAudioSink, "qt.multimedia.pipewire.audiosink")
#define __has_include(x)
#define QT_PIPEWIRE_HAS_DMABUF_CAMERA