43 template <
typename Closure>
48 pw_thread_loop_lock(self->m_eventLoop.get());
49 auto unlock = qScopeGuard([&] {
50 pw_thread_loop_unlock(self->m_eventLoop.get());
72 std::shared_ptr<QPipeWireInstance> m_libraryInstance;
75 PwThreadLoopHandle m_eventLoop;
76 void prepareEventLoop();
77 void startEventLoop();
81 PwContextHandle m_context;
82 void prepareContext();
85 PwCoreConnectionHandle m_coreConnection;
86 void connectToPipewireInstance();
89 PwRegistryHandle m_registry;
90 spa_hook m_registryListener{};
91 std::unique_ptr<QAudioDeviceMonitor> m_deviceMonitor;
93 void startDeviceMonitor();
94 void stopDeviceMonitor();
95 static void objectAddedCb(
void *data, uint32_t id, uint32_t permissions,
const char *type,
96 uint32_t version,
const struct spa_dict *props);
97 static void objectRemovedCb(
void *data, uint32_t id);
98 void objectAdded(ObjectId id, uint32_t permissions, PipewireRegistryType, uint32_t version,
99 const spa_dict &props);
100 void objectRemoved(ObjectId id);
103 void startListenDefaultMetadataObject(ObjectId, uint32_t version);
104 void stopListenDefaultMetadataObject();
105 struct MetadataRecord
112 int handleDefaultMetadataObjectEvent(ObjectId subject,
const MetadataRecord &);
114 PwMetadataHandle m_defaultMetadataObject;
115 spa_hook m_defaultMetadataObjectListener{};
117 QMutex m_activeStreamMutex;
119 void stopActiveStreams();
static bool minimumRequirementMet()
PwNodeHandle bindNode(ObjectId)
static QAudioDeviceMonitor & deviceMonitor()
static QAudioContextManager * instance()
void registerStreamReference(std::shared_ptr< QPipewireAudioStream >)
void unregisterStreamReference(const std::shared_ptr< QPipewireAudioStream > &)
PwMetadataHandle bindMetadata(ObjectId)
static auto withEventLoopLock(Closure &&c)
static bool isInPwThreadLoop()
static pw_loop * getEventLoop()
const PwCoreConnectionHandle & coreConnection() const
bool pw_check_library_version(int major, int minor, int micro)