From 893e4ed0ddfefd8e9f6664f70ef08eec4027c3f9 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 5 Jul 2023 14:28:34 -0400 Subject: [PATCH] base: videosink: Avoid positing message on the bus before being constructed `gst_base_sink_set_processing_deadline` can post messages on the bus which triggers traces for not constructed objects which fails in rust tracers as object should have names in all traces. Part-of: --- .../gst-libs/gst/video/gstvideosink.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c index 8450a429c6..31f185ad10 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c @@ -165,18 +165,23 @@ gst_video_center_rect (const GstVideoRectangle * src, /* Initing stuff */ +static void +gst_video_sink_constructed (GObject * obj) +{ + /* 20ms is more than enough, 80-130ms is noticeable */ + gst_base_sink_set_processing_deadline (GST_BASE_SINK (obj), 15 * GST_MSECOND); + gst_base_sink_set_max_lateness (GST_BASE_SINK (obj), 5 * GST_MSECOND); + gst_base_sink_set_qos_enabled (GST_BASE_SINK (obj), TRUE); + + G_OBJECT_CLASS (parent_class)->constructed (obj); +} + static void gst_video_sink_init (GstVideoSink * videosink) { videosink->width = 0; videosink->height = 0; - /* 20ms is more than enough, 80-130ms is noticeable */ - gst_base_sink_set_processing_deadline (GST_BASE_SINK (videosink), - 15 * GST_MSECOND); - gst_base_sink_set_max_lateness (GST_BASE_SINK (videosink), 5 * GST_MSECOND); - gst_base_sink_set_qos_enabled (GST_BASE_SINK (videosink), TRUE); - videosink->priv = gst_video_sink_get_instance_private (videosink); } @@ -189,6 +194,7 @@ gst_video_sink_class_init (GstVideoSinkClass * klass) parent_class = g_type_class_peek_parent (klass); + gobject_class->constructed = gst_video_sink_constructed; gobject_class->set_property = gst_video_sink_set_property; gobject_class->get_property = gst_video_sink_get_property;