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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4975>
This commit is contained in:
Thibault Saunier 2023-07-05 14:28:34 -04:00 committed by GStreamer Marge Bot
parent 8d603b3e1d
commit 893e4ed0dd

View file

@ -165,18 +165,23 @@ gst_video_center_rect (const GstVideoRectangle * src,
/* Initing stuff */ /* 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 static void
gst_video_sink_init (GstVideoSink * videosink) gst_video_sink_init (GstVideoSink * videosink)
{ {
videosink->width = 0; videosink->width = 0;
videosink->height = 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); 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); 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->set_property = gst_video_sink_set_property;
gobject_class->get_property = gst_video_sink_get_property; gobject_class->get_property = gst_video_sink_get_property;