Revert "base: videosink: Avoid positing message on the bus before being constructed"

This reverts commit 893e4ed0dd.

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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5006>
This commit is contained in:
Tim-Philipp Müller 2023-07-10 18:48:53 +01:00 committed by GStreamer Marge Bot
parent 424a78c9b9
commit 15957bcdc9

View file

@ -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;