From d301324652b732dc263968d717cca646e519833a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 19 Aug 2024 14:34:28 +0200 Subject: [PATCH] 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: --- subprojects/gst-plugins-bad/sys/va/gstvabasedec.c | 3 +-- subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c | 3 +-- subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c | 3 +-- subprojects/gst-plugins-bad/sys/va/gstvacompositor.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c b/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c index bb3ef37d9a..adfbbfa3af 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c @@ -658,8 +658,7 @@ gst_va_base_dec_set_context (GstElement * element, GstContext * context) if (!ret || (old_display && new_display && old_display != new_display && base->decoder)) { - GST_ELEMENT_WARNING (base, RESOURCE, BUSY, - ("Can't replace VA display while operating"), (NULL)); + GST_WARNING_OBJECT (base, "Can't replace VA display while operating"); } gst_clear_object (&old_display); diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c index 7a4f2d67c0..025e9811d7 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c @@ -919,8 +919,7 @@ gst_va_base_enc_set_context (GstElement * element, GstContext * context) if (!ret || (old_display && new_display && old_display != new_display && base->encoder)) { - GST_ELEMENT_WARNING (element, RESOURCE, BUSY, - ("Can't replace VA display while operating"), (NULL)); + GST_WARNING_OBJECT (element, "Can't replace VA display while operating"); } gst_clear_object (&old_display); diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c b/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c index ab8b7a3781..8ac2f08c30 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c @@ -610,8 +610,7 @@ gst_va_base_transform_set_context (GstElement * element, GstContext * context) if (!ret || (old_display && new_display && old_display != new_display && self->filter)) { - GST_ELEMENT_WARNING (element, RESOURCE, BUSY, - ("Can't replace VA display while operating"), (NULL)); + GST_WARNING_OBJECT (element, "Can't replace VA display while operating"); } gst_clear_object (&old_display); diff --git a/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c b/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c index 5397268ab0..ccbc4763f5 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c @@ -420,8 +420,7 @@ gst_va_compositor_set_context (GstElement * element, GstContext * context) if (!ret || (old_display && new_display && old_display != new_display && self->filter)) { - GST_ELEMENT_WARNING (element, RESOURCE, BUSY, - ("Can't replace VA display while operating"), (NULL)); + GST_WARNING_OBJECT (element, "Can't replace VA display while operating"); } gst_clear_object (&old_display);