From 15957bcdc9239c583dbdb68ae15fb67c8210aee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 10 Jul 2023 18:48:53 +0100 Subject: [PATCH] Revert "base: videosink: Avoid positing message on the bus before being constructed" This reverts commit 893e4ed0ddfefd8e9f6664f70ef08eec4027c3f9. This caused regressions in existing elements which override/set things like QoS and such in their own init functions. If the base class does this in ::constructed() now it will override the subclass settings again with its own, which can have unintended side-effects. Case in point is gdkpixbufsink which disabled QoS there, and this patch would reliably make the unit test fail in valgrind because now frames are dropped because of QoS (when QoS should really be disabled). Fixes #2794 Part-of: --- .../gst-libs/gst/video/gstvideosink.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 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 31f185ad10..8450a429c6 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c @@ -165,23 +165,18 @@ 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); } @@ -194,7 +189,6 @@ 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;