File indexing completed on 2024-11-10 04:57:06

0001 /*
0002     SPDX-FileCopyrightText: 2018-2020 Red Hat Inc
0003     SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
0004     SPDX-FileContributor: Jan Grulich <jgrulich@redhat.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include "plugin.h"
0012 
0013 #include "wayland/screencast_v1.h"
0014 
0015 namespace KWin
0016 {
0017 class Output;
0018 class ScreenCastStream;
0019 class PipeWireCore;
0020 
0021 class ScreencastManager : public Plugin
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit ScreencastManager();
0027 
0028 private:
0029     void streamWindow(ScreencastStreamV1Interface *stream,
0030                       const QString &winid,
0031                       ScreencastV1Interface::CursorMode mode);
0032     void streamWaylandOutput(ScreencastStreamV1Interface *stream,
0033                              OutputInterface *output,
0034                              ScreencastV1Interface::CursorMode mode);
0035     void
0036     streamOutput(ScreencastStreamV1Interface *stream, Output *output, ScreencastV1Interface::CursorMode mode);
0037     void streamVirtualOutput(ScreencastStreamV1Interface *stream,
0038                              const QString &name,
0039                              const QSize &size,
0040                              double scale,
0041                              ScreencastV1Interface::CursorMode mode);
0042     void streamRegion(ScreencastStreamV1Interface *stream,
0043                       const QRect &geometry,
0044                       qreal scale,
0045                       ScreencastV1Interface::CursorMode mode);
0046 
0047     void integrateStreams(ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream);
0048 
0049     ScreencastV1Interface *m_screencast;
0050     std::shared_ptr<PipeWireCore> m_core;
0051 };
0052 
0053 } // namespace KWin