-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Hello, I appear to be unable to create a ScreenCast session using xdp_portal_create_screencast_session. On KDE, using C++.
Relevant part of the code:
void WaylandVideoCapture::xdpInit() {
if (this->xdpPortal == NULL) this->xdpPortal = xdp_portal_initable_new(NULL);
if (this->xdpPortal == NULL) { std::cout << "Portal is null\n"; return; }
// Async, uses callback
xdp_portal_create_screencast_session(
this->xdpPortal,
static_cast<XdpOutputType>(XDP_OUTPUT_MONITOR | XDP_OUTPUT_WINDOW),
XDP_SCREENCAST_FLAG_NONE,
XDP_CURSOR_MODE_EMBEDDED,
XDP_PERSIST_MODE_TRANSIENT,
NULL,
NULL,
WaylandVideoCapture::xdpInitComplete,
this // Pass WaylandVideoCapture to the static function so that it may modify the object
);
}When running the program, it hangs here and WaylandVideoCapture::xdpInitComplete is never called. Checking the DBus logs, it looks like the version of ScreenCast is queried, but nothing happens past that:
method call time=1764477848.336983 sender=:1.662 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1764477848.337032 sender=org.freedesktop.DBus -> destination=:1.662 serial=4294967295 reply_serial=1
string ":1.662"
signal time=1764477848.337060 sender=org.freedesktop.DBus -> destination=(null destination) serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.662"
string ""
string ":1.662"
signal time=1764477848.337067 sender=org.freedesktop.DBus -> destination=:1.662 serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.662"
method call time=1764477848.337087 sender=:1.662 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
string "org.freedesktop.portal.Desktop"
method return time=1764477848.337091 sender=org.freedesktop.DBus -> destination=:1.662 serial=4294967295 reply_serial=2
boolean true
method call time=1764477848.337422 sender=:1.662 -> destination=org.freedesktop.portal.Desktop serial=3 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=Get
string "org.freedesktop.portal.Realtime"
string "MaxRealtimePriority"
method return time=1764477848.337699 sender=:1.9 -> destination=:1.662 serial=30294 reply_serial=3
variant int32 20
method call time=1764477848.337761 sender=:1.662 -> destination=org.freedesktop.portal.Desktop serial=4 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=Get
string "org.freedesktop.portal.Realtime"
string "MinNiceLevel"
method return time=1764477848.337847 sender=:1.9 -> destination=:1.662 serial=30295 reply_serial=4
variant int32 -15
method call time=1764477848.337909 sender=:1.662 -> destination=org.freedesktop.portal.Desktop serial=5 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=Get
string "org.freedesktop.portal.Realtime"
string "RTTimeUSecMax"
method return time=1764477848.338008 sender=:1.9 -> destination=:1.662 serial=30296 reply_serial=5
variant int64 200000
method call time=1764477848.341755 sender=:1.663 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1764477848.341761 sender=org.freedesktop.DBus -> destination=:1.663 serial=4294967295 reply_serial=1
string ":1.663"
signal time=1764477848.341765 sender=org.freedesktop.DBus -> destination=(null destination) serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.663"
string ""
string ":1.663"
signal time=1764477848.341770 sender=org.freedesktop.DBus -> destination=:1.663 serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.663"
method call time=1764477848.341868 sender=:1.663 -> destination=org.freedesktop.portal.Desktop serial=2 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.DBus.Properties; member=Get
string "org.freedesktop.portal.ScreenCast"
string "version"
method return time=1764477848.342168 sender=:1.9 -> destination=:1.663 serial=30297 reply_serial=2
variant uint32 5
I thought it might be that I don't have a parent window (trying to just set up a PipeWire source for now), but cannot find a reference to an XdpParent anywhere in the source code nor examples for ScreenCast.
I also tried creating new references to XdpPortal with g_object_ref in case the pointer was getting auto cleared anywhere, however nothing changed.
I am unsure what to do here, I can see no errors and any breakpoints in the callback function are never reached.