2020-07-22 17:29:23 +00:00
|
|
|
/*
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2018-2020 Red Hat Inc
|
|
|
|
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
|
|
|
SPDX-FileContributor: Jan Grulich <jgrulich@redhat.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
*/
|
2020-07-22 17:29:23 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDebug>
|
2020-07-28 13:37:04 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
2020-07-22 17:29:23 +00:00
|
|
|
#include <pipewire/pipewire.h>
|
2020-07-28 13:37:04 +00:00
|
|
|
#include <spa/utils/hook.h>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2020-07-22 17:29:23 +00:00
|
|
|
|
|
|
|
class PipeWireCore : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PipeWireCore();
|
|
|
|
|
|
|
|
static void onCoreError(void *data, uint32_t id, int seq, int res, const char *message);
|
|
|
|
|
|
|
|
~PipeWireCore();
|
|
|
|
|
|
|
|
bool init();
|
|
|
|
|
|
|
|
static QSharedPointer<PipeWireCore> self();
|
|
|
|
|
|
|
|
struct pw_core *pwCore = nullptr;
|
|
|
|
struct pw_context *pwContext = nullptr;
|
|
|
|
struct pw_loop *pwMainLoop = nullptr;
|
|
|
|
spa_hook coreListener;
|
|
|
|
QString m_error;
|
|
|
|
|
|
|
|
pw_core_events pwCoreEvents = {};
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void pipewireFailed(const QString &message);
|
|
|
|
};
|
2020-07-28 13:37:04 +00:00
|
|
|
|
|
|
|
} // namespace KWin
|