From 6d83673132795ca8e68ed2d494fc10d0b1e24491 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 24 Feb 2025 12:17:55 -0300 Subject: [PATCH] tracer: dots: Check that `pipeline-snapshot::dots-viewer-ws-url` exists It is a very new property and the tracer should still be usable if that property doesn't exist Part-of: --- subprojects/gstreamer/plugins/tracers/gstdots.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subprojects/gstreamer/plugins/tracers/gstdots.c b/subprojects/gstreamer/plugins/tracers/gstdots.c index aa00ac8d10..8899b2dd92 100644 --- a/subprojects/gstreamer/plugins/tracers/gstdots.c +++ b/subprojects/gstreamer/plugins/tracers/gstdots.c @@ -199,9 +199,17 @@ Please ensure GStreamer is properly installed."); return FALSE; } - self->pipeline_snapshot_tracer = g_object_new (gst_tracer_factory_get_tracer_type (factory), "dot-dir", self->output_dir, "dots-viewer-ws-url", "ws://127.0.0.1:3000/snapshot/", "folder-mode", 1, /*numbered */ - NULL); + GType tracer_type = gst_tracer_factory_get_tracer_type (factory); + GObjectClass *tracer_class = g_type_class_ref (tracer_type); + + if (g_object_class_find_property (tracer_class, "dots-viewer-ws-url")) + self->pipeline_snapshot_tracer = g_object_new (gst_tracer_factory_get_tracer_type (factory), "dot-dir", self->output_dir, "dots-viewer-ws-url", "ws://127.0.0.1:3000/snapshot/", "folder-mode", 1, /*numbered */ + NULL); + else + self->pipeline_snapshot_tracer = + g_object_new (gst_tracer_factory_get_tracer_type (factory), NULL); gst_object_unref (factory); + g_type_class_unref (tracer_class); if (!self->pipeline_snapshot_tracer) { GST_WARNING ("Could not create pipeline-snapshot tracer instance");