42 static std::once_flag s_once;
43 std::call_once(s_once, [] {
45 if (!factory || gst_plugin_feature_check_version(GST_PLUGIN_FEATURE(factory.get()), 1, 24, 10)) {
51 loaded ? gst_element_factory_get_element_type(GST_ELEMENT_FACTORY(loaded.get())) : G_TYPE_INVALID;
52 if (!g_type_is_a(type, GST_TYPE_BASE_SRC)) {
53 qCWarning(GStreamerUdpSrcWorkaroundLog)
54 <<
"udpsrc failed to load; stopping a UDP stream right after it starts may crash";
59 auto*
const klass =
static_cast<GstBaseSrcClass*
>(g_type_class_ref(type));
60 s_udpSrcUnlock = klass->unlock;
61 s_udpSrcUnlockStop = klass->unlock_stop;
62 if (s_udpSrcUnlock && s_udpSrcUnlockStop) {
63 klass->unlock = _udpSrcUnlockSerialized;
64 klass->unlock_stop = _udpSrcUnlockStopSerialized;
65 s_serialized.store(
true, std::memory_order_release);
66 qCDebug(GStreamerUdpSrcWorkaroundLog)
67 <<
"Serialized udpsrc unlock/unlock_stop (gst-plugins-good before 1.24.10)";