Changeset View
Changeset View
Standalone View
Standalone View
framebuffers/pipewire/pw_framebuffer.h
- This file was added.
1 | /* This file is part of the KDE project | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru> | ||||
3 | Copyright (C) 2018 Jan Grulich <jgrulich@redhat.com> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public | ||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 3 of the License, or (at your option) any later version. | ||||
9 | */ | ||||
10 | #ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H | ||||
11 | #define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H | ||||
12 | | ||||
13 | #include "framebuffer.h" | ||||
14 | #include <QWidget> | ||||
15 | #include <QVariantMap> | ||||
16 | | ||||
17 | /** | ||||
18 | * @brief The PWFrameBuffer class - framebuffer implementation based on XDG Desktop Portal ScreenCast interface. | ||||
19 | * The design relies heavily on a presence of XDG D-Bus service and PipeWire daemon. | ||||
20 | * | ||||
21 | * @author Oleg Chernovskiy <kanedias@xaker.ru> | ||||
22 | */ | ||||
23 | class PWFrameBuffer: public FrameBuffer | ||||
24 | { | ||||
25 | Q_OBJECT | ||||
26 | public: | ||||
27 | typedef struct { | ||||
28 | uint nodeId; | ||||
29 | QVariantMap map; | ||||
30 | } Stream; | ||||
31 | typedef QList<Stream> Streams; | ||||
32 | | ||||
33 | PWFrameBuffer(WId winid, QObject *parent = nullptr); | ||||
34 | virtual ~PWFrameBuffer() override; | ||||
35 | | ||||
36 | int depth() override; | ||||
37 | int height() override; | ||||
38 | int width() override; | ||||
39 | int paddedWidth() override; | ||||
40 | void getServerFormat(rfbPixelFormat &format) override; | ||||
41 | void startMonitor() override; | ||||
42 | void stopMonitor() override; | ||||
43 | | ||||
44 | QVariant customProperty(const QString &property) const override; | ||||
45 | | ||||
46 | bool isValid() const; | ||||
47 | | ||||
48 | private Q_SLOTS: | ||||
49 | void handleXdpSessionCreated(quint32 code, QVariantMap results); | ||||
50 | void handleXdpDevicesSelected(quint32 code, QVariantMap results); | ||||
51 | void handleXdpSourcesSelected(quint32 code, QVariantMap results); | ||||
52 | void handleXdpRemoteDesktopStarted(quint32 code, QVariantMap results); | ||||
53 | | ||||
54 | private: | ||||
55 | class Private; | ||||
56 | const QScopedPointer<Private> d; | ||||
57 | }; | ||||
58 | | ||||
59 | #endif |