Changeset View
Changeset View
Standalone View
Standalone View
src/client/videostreaming.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | | ||||
4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL | ||||
5 | */ | ||||
6 | | ||||
7 | #pragma once | ||||
8 | | ||||
9 | #include <QVector> | ||||
10 | #include <QObject> | ||||
11 | #include <QSharedPointer> | ||||
12 | #include <optional> | ||||
13 | | ||||
14 | #include <KWayland/Client/kwaylandclient_export.h> | ||||
15 | | ||||
16 | struct org_kde_kwin_remote_access_manager; | ||||
17 | struct org_kde_kwin_remote_buffer; | ||||
18 | struct wl_output; | ||||
19 | | ||||
20 | namespace KWayland | ||||
21 | { | ||||
22 | namespace Client | ||||
23 | { | ||||
24 | class EventQueue; | ||||
25 | class VideoStreamingPrivate; | ||||
26 | class VideoStreamSourcePrivate; | ||||
27 | | ||||
28 | class KWAYLANDCLIENT_EXPORT VideoStreamSource | ||||
29 | { | ||||
30 | Q_GADGET | ||||
31 | public: | ||||
32 | VideoStreamSource(); | ||||
33 | VideoStreamSource(const VideoStreamSource& other); | ||||
34 | virtual ~VideoStreamSource(); | ||||
35 | | ||||
36 | quint32 sourceId() const; | ||||
37 | QString iconName() const; | ||||
38 | QString description() const; | ||||
39 | bool isOutput() const; | ||||
40 | QRect geometry() const; | ||||
41 | | ||||
42 | bool operator!=(const VideoStreamSource& other) const; | ||||
43 | | ||||
44 | protected: | ||||
45 | VideoStreamSource(quint32 sourceId, const QString &description, const QString &iconName, bool isOutput, const QRect &geometry); | ||||
46 | | ||||
47 | private: | ||||
48 | friend class VideoStreamingPrivate; | ||||
49 | QSharedPointer<const VideoStreamSourcePrivate> d; | ||||
50 | }; | ||||
51 | | ||||
52 | class KWAYLANDCLIENT_EXPORT VideoStreaming : public QObject | ||||
53 | { | ||||
54 | Q_OBJECT | ||||
55 | public: | ||||
56 | explicit VideoStreaming(QObject *parent = nullptr); | ||||
57 | ~VideoStreaming() override; | ||||
58 | | ||||
59 | QVector<VideoStreamSource> sources() const; | ||||
60 | | ||||
61 | void create(const VideoStreamSource& source); | ||||
62 | void close(quint32 nodeid); | ||||
63 | | ||||
64 | Q_SIGNALS: | ||||
65 | void initialized(); | ||||
66 | void created(const VideoStreamSource& source, quint32 nodeid); | ||||
67 | void failed(const VideoStreamSource& source, const QString &error); | ||||
68 | void closed(quint32 nodeid); | ||||
69 | void sourcesChanged(); | ||||
70 | | ||||
71 | private: | ||||
72 | QScopedPointer<VideoStreamingPrivate> d; | ||||
73 | }; | ||||
74 | | ||||
75 | } | ||||
76 | } | ||||
77 | | ||||
78 | Q_DECLARE_METATYPE(KWayland::Client::VideoStreamSource); |