Skip to content

Commit 0622ba6

Browse files
committed
[GStreamer][1.28] Ensure synchronous initialization of the device monitor
https://bugs.webkit.org/show_bug.cgi?id=308961 Reviewed by Xabier Rodriguez-Calvar. In GStreamer 1.28 device providers start asynchronously and the monitor posts a message on the bus once it has finished starting-up. We need the initial list of devices right away after starting, so wait for the message to be posted on the bus before attempting to get the list of devices. * Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices): Canonical link: https://commits.webkit.org/308531@main
1 parent 7f0510e commit 0622ba6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,14 @@ void GStreamerCaptureDeviceManager::refreshCaptureDevices()
339339
return;
340340
}
341341

342+
#if GST_CHECK_VERSION(1, 28, 0)
343+
{
344+
auto bus = adoptGRef(gst_device_monitor_get_bus(m_deviceMonitor.get()));
345+
[[maybe_unused]] auto message = adoptGRef(gst_bus_poll(bus.get(), GST_MESSAGE_DEVICE_MONITOR_STARTED, GST_CLOCK_TIME_NONE));
346+
GST_DEBUG_OBJECT(m_deviceMonitor.get(), "Device provider(s) successfully started");
347+
}
348+
#endif
349+
342350
monitorBus = true;
343351
}
344352

0 commit comments

Comments
 (0)