7#include "screencastingrequest.h"
9#include <QCoreApplication>
12ScreencastingRequest::ScreencastingRequest(
QObject *parent)
17ScreencastingRequest::~ScreencastingRequest() =
default;
24void ScreencastingRequest::resetUuid()
29void ScreencastingRequest::setUuid(
const QString &uuid)
40 if (!m_screenCasting) {
41 m_screenCasting = std::make_unique<Screencasting>();
43 setStream(m_screenCasting->createWindowStream(m_uuid, Screencasting::pointer_hidden));
47void ScreencastingRequest::resetOutputName()
52void ScreencastingRequest::setOutputName(
const QString &outputName)
63 if (!m_screenCasting) {
64 m_screenCasting = std::make_unique<Screencasting>();
66 setStream(m_screenCasting->createOutputStream(m_outputName, Screencasting::pointer_hidden));
70void ScreencastingRequest::setStream(std::unique_ptr<ScreencastingStream> stream)
73 m_stream = std::move(stream);
75 connect(m_stream.get(), &ScreencastingStream::created,
this, &ScreencastingRequest::setNodeid);
76 connect(m_stream.get(), &ScreencastingStream::closed,
this, [
this]() {
79 connect(m_stream.get(), &ScreencastingStream::failed,
this, [](
const QString &error) {
80 qWarning() <<
"error creating screencast" << error;
88void ScreencastingRequest::setNodeid(uint nodeId)
QML_ELEMENTQString uuid
The unique identifier of the window we want to cast.
quint32 nodeId
The offered nodeId to give to a source.
QString outputName
The output name as define in Screen.name.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool isEmpty() const const