64 void onCoreEventDone(uint32_t
id,
int seq);
65 void onRegistryEventGlobal(uint32_t
id, uint32_t permissions,
const char *
type, uint32_t version,
const spa_dict *
props);
66 void onStateChanged(pw_stream_state old, pw_stream_state
state,
const char *
error);
68 void onParamChanged(uint32_t
id,
const struct spa_pod *
param);
70 void updateCoreInitSeq();
72 void recreateStream();
73 void destroyStream(
bool forceDrain);
75 void signalLoop(
bool onProcessDone,
bool err);
81 int generateRequestToken();
82 void createInterface();
84 void selectSources(
const QString &sessionHandle);
87 void openPipeWireRemote();
94 std::shared_ptr<QtPipeWire::Pipewire> m_pipewire;
101 pw_thread_loop *m_threadLoop =
nullptr;
102 pw_context *m_context =
nullptr;
104 pw_core *m_core =
nullptr;
105 spa_hook m_coreListener = {};
107 pw_registry *m_registry =
nullptr;
108 spa_hook m_registryListener = {};
110 pw_stream *m_stream =
nullptr;
111 spa_hook m_streamListener = {};
113 spa_video_info m_format;
116 bool m_hasSource =
false;
117 bool m_initDone =
false;
118 bool m_ignoreStateChange =
false;
119 bool m_streamPaused =
false;
120 bool m_silence =
false;
121 bool m_processed =
false;
123 int m_coreInitSeq = 0;
125 int m_requestToken = -1;
135 QVector<StreamInfo> m_streams = {};
137 int m_pipewireFd = -1;
139 std::unique_ptr<QDBusInterface> m_screenCastInterface;
141 enum OperationState { NoOperation, CreateSession, SelectSources, StartStream, OpenPipeWireRemote };
142 OperationState m_operationState = NoOperation;
144 enum State { NoState, Starting, Streaming, Stopping };
145 State m_state = NoState;