4#ifndef QPIPEWIRE_INSTANCE_P_H
5#define QPIPEWIRE_INSTANCE_P_H
18#include <QtMultimedia/private/qpipewire_support_p.h>
20#include <QtCore/private/qexpected_p.h>
21#include <QtCore/qglobal.h>
22#include <QtCore/qloggingcategory.h>
23#include <QtCore/private/qexpected_p.h>
25#include <pipewire/pipewire.h>
28#include <system_error>
46 [[nodiscard]]
static bool isLoaded();
50 template <
typename Closure>
53 return m_eventLoop.runWithEventLoopLock(std::forward<Closure>(c));
71 static std::unique_ptr<QPipeWireInstance> create();
74 PWThreadedEventLoop m_eventLoop{
"PwEventLoop" };
75 PwContextHandle m_context;
77 std::optional<
bool> m_hasScreenCastPortal;
bool isInPwThreadLoop() const
PWThreadedEventLoop & pwEventLoop()
q23::expected< PwCoreConnectionHandle, std::error_code > connectToPortal(int fd)
q23::expected< PwCoreConnectionHandle, std::error_code > connectToDaemon()
pw_loop * eventLoop() const
static q23::expected< void, std::error_code > hasSPAFactory(const char *factoryName)
bool hasScreenCastPortal()
auto runWithEventLoopLock(Closure &&c)
static std::shared_ptr< QPipeWireInstance > instance()
static std::optional< uint > portalInterfaceVersion(const QString &interface)
Q_LOGGING_CATEGORY(lcPipewire, "qt.multimedia.pipewire")
Q_DECLARE_LOGGING_CATEGORY(lcPipewire)