Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp (280291 => 280292)
--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp 2021-07-26 07:48:44 UTC (rev 280291)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp 2021-07-26 09:50:44 UTC (rev 280292)
@@ -72,7 +72,7 @@
static_cast<GDBusProxyFlags>(G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES), nullptr,
"org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", "org.freedesktop.portal.ScreenCast", nullptr, &error.outPtr()));
if (error) {
- WTFLogAlways("Unable to connect to the Deskop portal: %s\n", error->message);
+ WTFLogAlways("Unable to connect to the Deskop portal: %s", error->message);
return { };
}
@@ -86,7 +86,7 @@
auto result = adoptGRef(g_dbus_proxy_call_sync(m_proxy.get(), "CreateSession", g_variant_new("(a{sv})", &options),
G_DBUS_CALL_FLAGS_NONE, s_dbusCallTimeout.millisecondsAs<int>(), nullptr, &error.outPtr()));
if (error) {
- WTFLogAlways("Unable to create a Deskop portal session: %s\n", error->message);
+ WTFLogAlways("Unable to create a Deskop portal session: %s", error->message);
return { };
}
@@ -121,7 +121,7 @@
result = adoptGRef(g_dbus_proxy_call_sync(m_proxy.get(), "SelectSources",
g_variant_new("(oa{sv})", sessionPath.ascii().data(), &options), G_DBUS_CALL_FLAGS_NONE, s_dbusCallTimeout.millisecondsAs<int>(), nullptr, &error.outPtr()));
if (error) {
- WTFLogAlways("SelectSources error: %s\n", error->message);
+ WTFLogAlways("SelectSources error: %s", error->message);
return { };
}
g_variant_get(result.get(), "(o)", &objectPath.outPtr());
@@ -133,7 +133,7 @@
result = adoptGRef(g_dbus_proxy_call_sync(m_proxy.get(), "Start",
g_variant_new("(osa{sv})", sessionPath.ascii().data(), "", &options), G_DBUS_CALL_FLAGS_NONE, s_dbusCallTimeout.millisecondsAs<int>(), nullptr, &error.outPtr()));
if (error) {
- WTFLogAlways("Start error: %s\n", error->message);
+ WTFLogAlways("Start error: %s", error->message);
return { };
}
@@ -167,13 +167,14 @@
static_cast<GDBusProxyFlags>(G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES), nullptr,
"org.freedesktop.portal.Desktop", session->path.ascii().data(), "org.freedesktop.portal.Session", nullptr, &error.outPtr()));
if (error) {
- WTFLogAlways("Unable to connect to the Deskop portal: %s\n", error->message);
+ WTFLogAlways("Unable to connect to the Deskop portal: %s", error->message);
return;
}
+ auto dbusCallTimeout = 100_ms;
auto result = adoptGRef(g_dbus_proxy_call_sync(proxy.get(), "Close", nullptr, G_DBUS_CALL_FLAGS_NONE,
- s_dbusCallTimeout.millisecondsAs<int>(), nullptr, &error.outPtr()));
+ dbusCallTimeout.millisecondsAs<int>(), nullptr, &error.outPtr()));
if (error)
- WTFLogAlways("Portal session could not be closed: %s\n", error->message);
+ WTFLogAlways("Portal session could not be closed: %s", error->message);
}
void GStreamerDisplayCaptureDeviceManager::waitResponseSignal(const char* objectPath)
Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp (280291 => 280292)
--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp 2021-07-26 07:48:44 UTC (rev 280291)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp 2021-07-26 09:50:44 UTC (rev 280292)
@@ -144,6 +144,11 @@
return;
g_signal_handlers_disconnect_by_func(m_capturer->sink(), reinterpret_cast<gpointer>(newSampleCallback), this);
m_capturer->stop();
+
+ if (auto fd = m_capturer->pipewireFD()) {
+ auto& manager = GStreamerDisplayCaptureDeviceManager::singleton();
+ manager.stopSource(persistentID());
+ }
}
void GStreamerVideoCaptureSource::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag> settings)
@@ -204,11 +209,6 @@
{
GST_INFO("Reset height and width after stopping source");
setSize({ 0, 0 });
-
- if (auto fd = m_capturer->pipewireFD()) {
- auto& manager = GStreamerDisplayCaptureDeviceManager::singleton();
- manager.stopSource(persistentID());
- }
}
const RealtimeMediaSourceCapabilities& GStreamerVideoCaptureSource::capabilities()