va: don't use GST_ELEMENT_WARNING in set_context() vmethod

Since bins can set the context of their children elements, the set_context()
vmethod shouldn't call bus messages post methods, since it locks the parent
object, the bin, which might be already locked, leading to a deadlock.

Fixes: #3706
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7379>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-08-19 14:34:28 +02:00 committed by Backport Bot
parent bfcd23db61
commit 85fee9738e
4 changed files with 4 additions and 8 deletions

View file

@ -658,8 +658,7 @@ gst_va_base_dec_set_context (GstElement * element, GstContext * context)
if (!ret if (!ret
|| (old_display && new_display && old_display != new_display || (old_display && new_display && old_display != new_display
&& base->decoder)) { && base->decoder)) {
GST_ELEMENT_WARNING (base, RESOURCE, BUSY, GST_WARNING_OBJECT (base, "Can't replace VA display while operating");
("Can't replace VA display while operating"), (NULL));
} }
gst_clear_object (&old_display); gst_clear_object (&old_display);

View file

@ -850,8 +850,7 @@ gst_va_base_enc_set_context (GstElement * element, GstContext * context)
if (!ret || (old_display && new_display && old_display != new_display if (!ret || (old_display && new_display && old_display != new_display
&& base->encoder)) { && base->encoder)) {
GST_ELEMENT_WARNING (element, RESOURCE, BUSY, GST_WARNING_OBJECT (element, "Can't replace VA display while operating");
("Can't replace VA display while operating"), (NULL));
} }
gst_clear_object (&old_display); gst_clear_object (&old_display);

View file

@ -610,8 +610,7 @@ gst_va_base_transform_set_context (GstElement * element, GstContext * context)
if (!ret if (!ret
|| (old_display && new_display && old_display != new_display || (old_display && new_display && old_display != new_display
&& self->filter)) { && self->filter)) {
GST_ELEMENT_WARNING (element, RESOURCE, BUSY, GST_WARNING_OBJECT (element, "Can't replace VA display while operating");
("Can't replace VA display while operating"), (NULL));
} }
gst_clear_object (&old_display); gst_clear_object (&old_display);

View file

@ -420,8 +420,7 @@ gst_va_compositor_set_context (GstElement * element, GstContext * context)
if (!ret if (!ret
|| (old_display && new_display && old_display != new_display || (old_display && new_display && old_display != new_display
&& self->filter)) { && self->filter)) {
GST_ELEMENT_WARNING (element, RESOURCE, BUSY, GST_WARNING_OBJECT (element, "Can't replace VA display while operating");
("Can't replace VA display while operating"), (NULL));
} }
gst_clear_object (&old_display); gst_clear_object (&old_display);