Hello community,
here is the log from the commit of package xdg-desktop-portal-kde for
openSUSE:Factory checked in at 2018-07-12 09:21:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xdg-desktop-portal-kde (Old)
and /work/SRC/openSUSE:Factory/.xdg-desktop-portal-kde.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xdg-desktop-portal-kde"
Thu Jul 12 09:21:14 2018 rev:26 rq:622139 version:5.13.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/xdg-desktop-portal-kde/xdg-desktop-portal-kde.changes
2018-07-09 13:31:21.366488762 +0200
+++
/work/SRC/openSUSE:Factory/.xdg-desktop-portal-kde.new/xdg-desktop-portal-kde.changes
2018-07-12 09:22:42.242715575 +0200
@@ -1,0 +2,10 @@
+Tue Jul 10 14:02:53 CEST 2018 - [email protected]
+
+- Update to 5.13.3
+ * New bugfix release
+ * For more details please see:
+ * https://www.kde.org/announcements/plasma-5.13.3.php
+- Changes since 5.13.2:
+ * Create stream once we are supposed to start a stream
+
+-------------------------------------------------------------------
Old:
----
xdg-desktop-portal-kde-5.13.2.tar.xz
New:
----
xdg-desktop-portal-kde-5.13.3.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xdg-desktop-portal-kde.spec ++++++
--- /var/tmp/diff_new_pack.4C5Zq2/_old 2018-07-12 09:22:42.650716146 +0200
+++ /var/tmp/diff_new_pack.4C5Zq2/_new 2018-07-12 09:22:42.650716146 +0200
@@ -25,7 +25,7 @@
%define kf5_version 5.45.0
Name: xdg-desktop-portal-kde
-Version: 5.13.2
+Version: 5.13.3
Release: 0
Summary: QT/KF5 backend for xdg-desktop-portal
License: LGPL-2.1-or-later
++++++ xdg-desktop-portal-kde-5.13.2.tar.xz ->
xdg-desktop-portal-kde-5.13.3.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-kde-5.13.2/CMakeLists.txt
new/xdg-desktop-portal-kde-5.13.3/CMakeLists.txt
--- old/xdg-desktop-portal-kde-5.13.2/CMakeLists.txt 2018-06-26
14:01:55.000000000 +0200
+++ new/xdg-desktop-portal-kde-5.13.3/CMakeLists.txt 2018-07-10
12:18:44.000000000 +0200
@@ -3,7 +3,7 @@
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.4.0")
-set(PROJECT_VERSION "5.13.2")
+set(PROJECT_VERSION "5.13.3")
set(PROJECT_VERSION_MAJOR 5)
################# set KDE specific information #################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-kde-5.13.2/po/zh_CN/xdg-desktop-portal-kde.po
new/xdg-desktop-portal-kde-5.13.3/po/zh_CN/xdg-desktop-portal-kde.po
--- old/xdg-desktop-portal-kde-5.13.2/po/zh_CN/xdg-desktop-portal-kde.po
2018-06-26 14:01:55.000000000 +0200
+++ new/xdg-desktop-portal-kde-5.13.3/po/zh_CN/xdg-desktop-portal-kde.po
2018-07-10 12:18:44.000000000 +0200
@@ -3,7 +3,7 @@
"Project-Id-Version: kdeorg\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2018-05-05 03:41+0200\n"
-"PO-Revision-Date: 2018-06-19T17:12:48+0000\n"
+"PO-Revision-Date: 2018-07-03 17:39\n"
"Last-Translator: guoyunhebrave <[email protected]>\n"
"Language-Team: Chinese Simplified\n"
"Language: zh_CN\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-kde-5.13.2/src/screencast.cpp
new/xdg-desktop-portal-kde-5.13.3/src/screencast.cpp
--- old/xdg-desktop-portal-kde-5.13.2/src/screencast.cpp 2018-06-26
14:01:23.000000000 +0200
+++ new/xdg-desktop-portal-kde-5.13.3/src/screencast.cpp 2018-07-10
12:18:37.000000000 +0200
@@ -136,7 +136,6 @@
{
initDrm();
initEGL();
- initPipewire();
initWayland();
qDBusRegisterMetaType<ScreenCastPortal::Stream>();
@@ -156,6 +155,42 @@
m_stream->deleteLater();
}
+void ScreenCastPortal::createPipeWireStream(const QSize &resolution)
+{
+ m_stream = new ScreenCastStream(resolution);
+ m_stream->init();
+
+ connect(m_stream, &ScreenCastStream::streamReady, this, [] (uint nodeId) {
+ qCDebug(XdgDesktopPortalKdeScreenCast) << "Pipewire stream is ready: "
<< nodeId;
+ });
+
+ connect(m_stream, &ScreenCastStream::startStreaming, this, [this] {
+ qCDebug(XdgDesktopPortalKdeScreenCast) << "Start streaming";
+ m_streamingEnabled = true;
+
+ if (!m_registryInitialized) {
+ qCWarning(XdgDesktopPortalKdeScreenCast) << "Cannot start stream
because registry is not initialized yet";
+ return;
+ }
+ if
(m_registry->hasInterface(KWayland::Client::Registry::Interface::RemoteAccessManager))
{
+ KWayland::Client::Registry::AnnouncedInterface interface =
m_registry->interface(KWayland::Client::Registry::Interface::RemoteAccessManager);
+ if (!interface.name && !interface.version) {
+ qCWarning(XdgDesktopPortalKdeScreenCast) << "Cannot start
stream because remote access interface is not initialized yet";
+ return;
+ }
+ m_remoteAccessManager =
m_registry->createRemoteAccessManager(interface.name, interface.version);
+ connect(m_remoteAccessManager,
&KWayland::Client::RemoteAccessManager::bufferReady, this, [this] (const void
*output, const KWayland::Client::RemoteBuffer * rbuf) {
+ Q_UNUSED(output);
+ connect(rbuf,
&KWayland::Client::RemoteBuffer::parametersObtained, this, [this, rbuf] {
+ processBuffer(rbuf);
+ });
+ });
+ }
+ });
+
+ connect(m_stream, &ScreenCastStream::stopStreaming, this,
&ScreenCastPortal::stopStreaming);
+}
+
void ScreenCastPortal::initDrm()
{
m_drmFd = open("/dev/dri/renderD128", O_RDWR);
@@ -211,42 +246,6 @@
qCDebug(XdgDesktopPortalKdeScreenCast) << QString("EGL version:
%1.%2").arg(major).arg(minor);
}
-void ScreenCastPortal::initPipewire()
-{
- m_stream = new ScreenCastStream;
- m_stream->init();
-
- connect(m_stream, &ScreenCastStream::streamReady, this, [] (uint nodeId) {
- qCDebug(XdgDesktopPortalKdeScreenCast) << "Pipewire stream is ready: "
<< nodeId;
- });
-
- connect(m_stream, &ScreenCastStream::startStreaming, this, [this] {
- qCDebug(XdgDesktopPortalKdeScreenCast) << "Start streaming";
- m_streamingEnabled = true;
-
- if (!m_registryInitialized) {
- qCWarning(XdgDesktopPortalKdeScreenCast) << "Cannot start stream
because registry is not initialized yet";
- return;
- }
- if
(m_registry->hasInterface(KWayland::Client::Registry::Interface::RemoteAccessManager))
{
- KWayland::Client::Registry::AnnouncedInterface interface =
m_registry->interface(KWayland::Client::Registry::Interface::RemoteAccessManager);
- if (!interface.name && !interface.version) {
- qCWarning(XdgDesktopPortalKdeScreenCast) << "Cannot start
stream because remote access interface is not initialized yet";
- return;
- }
- m_remoteAccessManager =
m_registry->createRemoteAccessManager(interface.name, interface.version);
- connect(m_remoteAccessManager,
&KWayland::Client::RemoteAccessManager::bufferReady, this, [this] (const void
*output, const KWayland::Client::RemoteBuffer * rbuf) {
- Q_UNUSED(output);
- connect(rbuf,
&KWayland::Client::RemoteBuffer::parametersObtained, this, [this, rbuf] {
- processBuffer(rbuf);
- });
- });
- }
- });
-
- connect(m_stream, &ScreenCastStream::stopStreaming, this,
&ScreenCastPortal::stopStreaming);
-}
-
void ScreenCastPortal::initWayland()
{
m_thread = new QThread(this);
@@ -390,6 +389,9 @@
if (screenDialog->exec()) {
ScreenCastPortalOutput selectedOutput =
m_outputMap.value(screenDialog->selectedScreens().first());
+ // Initialize PipeWire
+ createPipeWireStream(selectedOutput.resolution);
+
// HACK wait for stream to be ready
bool streamReady = false;
QEventLoop loop;
@@ -398,11 +400,6 @@
streamReady = true;
});
- if (!m_stream->createStream(selectedOutput.resolution)) {
- qCWarning(XdgDesktopPortalKdeScreenCast) << "Failed to create
pipewire stream";
- return 2;
- }
-
QTimer::singleShot(3000, &loop, &QEventLoop::quit);
loop.exec();
@@ -571,9 +568,11 @@
m_remoteAccessManager->destroy();
m_streamingEnabled = false;
- m_stream->removeStream();
qDeleteAll(m_bindOutputs);
m_bindOutputs.clear();
+
+ delete m_stream;
+ m_stream = nullptr;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-kde-5.13.2/src/screencast.h
new/xdg-desktop-portal-kde-5.13.3/src/screencast.h
--- old/xdg-desktop-portal-kde-5.13.2/src/screencast.h 2018-06-26
14:01:23.000000000 +0200
+++ new/xdg-desktop-portal-kde-5.13.3/src/screencast.h 2018-07-10
12:18:37.000000000 +0200
@@ -123,9 +123,9 @@
void stopStreaming();
private:
+ void createPipeWireStream(const QSize &resolution);
void initDrm();
void initEGL();
- void initPipewire();
void initWayland();
bool m_registryInitialized;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-kde-5.13.2/src/screencaststream.cpp
new/xdg-desktop-portal-kde-5.13.3/src/screencaststream.cpp
--- old/xdg-desktop-portal-kde-5.13.2/src/screencaststream.cpp 2018-06-26
14:01:23.000000000 +0200
+++ new/xdg-desktop-portal-kde-5.13.3/src/screencaststream.cpp 2018-07-10
12:18:37.000000000 +0200
@@ -141,10 +141,11 @@
return fraction;
}
-static void onStateChanged(void *_data, pw_remote_state old, pw_remote_state
state, const char *error)
+static void onStateChanged(void *data, pw_remote_state old, pw_remote_state
state, const char *error)
{
Q_UNUSED(old);
- Q_UNUSED(_data);
+
+ ScreenCastStream *pw = static_cast<ScreenCastStream*>(data);
switch (state) {
case PW_REMOTE_STATE_ERROR:
@@ -154,6 +155,9 @@
case PW_REMOTE_STATE_CONNECTED:
// TODO notify error
qCDebug(XdgDesktopPortalKdeScreenCastStream) << "Remote state: " <<
pw_remote_state_as_string(state);
+ if (!pw->createStream()) {
+ pw->stopStreaming();
+ }
break;
default:
qCDebug(XdgDesktopPortalKdeScreenCastStream) << "Remote state: " <<
pw_remote_state_as_string(state);
@@ -245,8 +249,9 @@
.need_buffer = nullptr,
};
-ScreenCastStream::ScreenCastStream(QObject *parent)
- : QObject(parent)
+ScreenCastStream::ScreenCastStream(const QSize &resolution, QObject *parent)
+ : resolution(resolution)
+ , QObject(parent)
{
}
@@ -304,7 +309,7 @@
return 0;
}
-bool ScreenCastStream::createStream(const QSize &resolution)
+bool ScreenCastStream::createStream()
{
if (pw_remote_get_state(pwRemote, nullptr) != PW_REMOTE_STATE_CONNECTED) {
qCWarning(XdgDesktopPortalKdeScreenCastStream) << "Cannot create
pipewire stream";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-kde-5.13.2/src/screencaststream.h
new/xdg-desktop-portal-kde-5.13.3/src/screencaststream.h
--- old/xdg-desktop-portal-kde-5.13.2/src/screencaststream.h 2018-06-26
14:01:23.000000000 +0200
+++ new/xdg-desktop-portal-kde-5.13.3/src/screencaststream.h 2018-07-10
12:18:37.000000000 +0200
@@ -53,7 +53,7 @@
{
Q_OBJECT
public:
- explicit ScreenCastStream(QObject *parent = nullptr);
+ explicit ScreenCastStream(const QSize &resolution, QObject *parent =
nullptr);
~ScreenCastStream();
// Public
@@ -61,7 +61,7 @@
uint nodeId();
// Public because we need access from static functions
- bool createStream(const QSize &resolution);
+ bool createStream();
bool recordFrame(uint8_t *screenData);
void removeStream();
@@ -88,6 +88,7 @@
spa_hook remoteListener;
spa_hook streamListener;
+ QSize resolution;
QScopedPointer<QSocketNotifier> socketNotifier;
spa_video_info_raw videoFormat;