4#ifndef QSYNTHETICPIPEWIREVIDEOSOURCE_P_H
5#define QSYNTHETICPIPEWIREVIDEOSOURCE_P_H
18#include <QtMultimedia/private/qpipewire_support_p.h>
19#include <QtCore/qobject.h>
20#include <QtCore/qstring.h>
21#include <QtCore/private/qexpected_p.h>
23#include <private/qsyntheticvideoscene_p.h>
30
31
32
33
34
35
36struct QSyntheticPipeWireVideoSourceConfig
38 QByteArray loopName = QByteArrayLiteral(
"qt-fake-sc");
39 QByteArray nodeName = QByteArrayLiteral(
"qt-fake-screencast");
40 QByteArray nodeDescription = QByteArrayLiteral(
"Qt Multimedia synthetic screen cast source");
41 QByteArray mediaClass = QByteArrayLiteral(
"Stream/Output/Video");
42 QByteArray mediaRole = QByteArrayLiteral(
"Screen");
43 QByteArray mediaCategory = QByteArrayLiteral(
"Capture");
46 [[nodiscard]]
static QSyntheticPipeWireVideoSourceConfig screenCast();
49
50
51
52
53
54 [[nodiscard]]
static QSyntheticPipeWireVideoSourceConfig camera(
int index = 0);
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
94
95
96
106 void setScene(
const SyntheticVideoScene &scene);
113 std::unique_ptr<Private> d;
QSyntheticPipeWireVideoSourceConfig config
spa_hook registryListener
std::vector< QtPipeWire::PwProxyHandle > links
std::unordered_set< uint32_t > mismatchWarned
SyntheticVideoScene scene
static void onStateChanged(void *userData, pw_stream_state, pw_stream_state state, const char *error)
QtPipeWire::PwCoreConnectionHandle core
static void onParamChanged(void *userData, uint32_t id, const spa_pod *param)
QtPipeWire::PwContextHandle context
QtPipeWire::PwStreamHandle stream
void considerPort(ObjectId port, uint32_t consumerNode)
Decides whether port, belonging to consumerNode, is meant for us, and links it if so.
QtPipeWire::PwRegistryHandle registry
void linkTo(ObjectId inputPort)
QHash< uint32_t, QByteArray > consumerRoles
static void onRegistryGlobal(void *userData, uint32_t id, uint32_t permissions, const char *type, uint32_t version, const spa_dict *props)
std::optional< QtPipeWire::PWThreadedEventLoop > threadLoop
static void onProcess(void *userData)
QtPipeWire::ObjectId nodeId() const
The PipeWire node id to hand to a consumer. Valid only after a successful start().
QSyntheticPipeWireVideoSource()
~QSyntheticPipeWireVideoSource()
void setScene(const SyntheticVideoScene &scene)
Replaces the published content. Safe to call from any thread.
void renderNextFrame()
Renders and publishes the next frame. Safe to call from any thread.