1
0
mirror of https://invent.kde.org/network/krfb synced 2024-07-03 00:18:36 +00:00
krfb/framebuffers/pipewire/pw_framebuffer.h

64 lines
2.0 KiB
C
Raw Normal View History

/* This file is part of the KDE project
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
Copyright (C) 2018-2020 Jan Grulich <jgrulich@redhat.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
*/
#ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
#define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
#include "framebuffer.h"
#include <QWidget>
#include <QVariantMap>
/**
* @brief The PWFrameBuffer class - framebuffer implementation based on XDG Desktop Portal ScreenCast interface.
* The design relies heavily on a presence of XDG D-Bus service and PipeWire daemon.
*
* @author Oleg Chernovskiy <kanedias@xaker.ru>
*/
class PWFrameBuffer: public FrameBuffer
{
Q_OBJECT
public:
2021-07-09 06:53:04 +00:00
using Stream = struct {
uint nodeId;
QVariantMap map;
2021-07-09 06:53:04 +00:00
};
using Streams = QList<Stream>;
PWFrameBuffer(QObject *parent = nullptr);
virtual ~PWFrameBuffer() override;
void initDBus();
void startVirtualMonitor(const QString &name, const QSize &resolution, qreal dpr);
int depth() override;
int height() override;
int width() override;
int paddedWidth() override;
void getServerFormat(rfbPixelFormat &format) override;
void startMonitor() override;
void stopMonitor() override;
2021-10-29 15:31:53 +00:00
QPoint cursorPosition() override;
QVariant customProperty(const QString &property) const override;
bool isValid() const;
private Q_SLOTS:
void handleXdpSessionCreated(quint32 code, const QVariantMap &results);
void handleXdpDevicesSelected(quint32 code, const QVariantMap &results);
void handleXdpSourcesSelected(quint32 code, const QVariantMap &results);
void handleXdpRemoteDesktopStarted(quint32 code, const QVariantMap &results);
private:
class Private;
const QScopedPointer<Private> d;
};
#endif