summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-02-02 16:23:28 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-02-05 16:54:07 +0100
commit6ae24948878a2fbe26dee8612af7eb28e0072460 (patch)
treee7126ec7f0fd485b50cee85676d3b8181d012a6b /sys
parent599e16fde8b485aad1800e79f4425824c65f4c51 (diff)
downloadgstreamer-plugins-bad-6ae24948878a2fbe26dee8612af7eb28e0072460.tar.gz
va: filter: don't destroy pipeline buffer
This was only required by i915 driver before libva-2.0 because it didn't conform. Also changes the way _destroy_filters() is called, now inside a locked block, so it must not lock in it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2006>
Diffstat (limited to 'sys')
-rw-r--r--sys/va/gstvafilter.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/sys/va/gstvafilter.c b/sys/va/gstvafilter.c
index 5e0820ee8..03243f580 100644
--- a/sys/va/gstvafilter.c
+++ b/sys/va/gstvafilter.c
@@ -902,7 +902,7 @@ fail:
}
static gboolean
-_destroy_filters (GstVaFilter * self)
+_destroy_filters_unlocked (GstVaFilter * self)
{
VABufferID buffer;
VADisplay dpy;
@@ -910,14 +910,10 @@ _destroy_filters (GstVaFilter * self)
gboolean ret = TRUE;
guint i;
- if (!self->filters)
- return TRUE;
-
GST_TRACE_OBJECT (self, "Destroy filter buffers");
dpy = gst_va_display_get_va_dpy (self->display);
- GST_OBJECT_LOCK (self);
for (i = 0; i < self->filters->len; i++) {
buffer = g_array_index (self->filters, VABufferID, i);
@@ -926,12 +922,12 @@ _destroy_filters (GstVaFilter * self)
gst_va_display_unlock (self->display);
if (status != VA_STATUS_SUCCESS) {
ret = FALSE;
- GST_WARNING ("Failed to destroy filter buffer: %s", vaErrorStr (status));
+ GST_WARNING_OBJECT (self, "Failed to destroy filter buffer: %s",
+ vaErrorStr (status));
}
}
self->filters = g_array_set_size (self->filters, 0);
- GST_OBJECT_UNLOCK (self);
return ret;
}
@@ -1102,22 +1098,13 @@ gst_va_filter_convert_surface (GstVaFilter * self, VASurfaceID in_surface,
ret = TRUE;
bail:
- gst_va_display_lock (self->display);
- status = vaDestroyBuffer (dpy, buffer);
- gst_va_display_unlock (self->display);
- if (status != VA_STATUS_SUCCESS) {
- ret = FALSE;
- GST_WARNING ("Failed to destroy filter buffer: %s", vaErrorStr (status));
- }
-
GST_OBJECT_LOCK (self);
- if (self->filters)
+ if (self->filters) {
g_array_unref (self->filters);
+ _destroy_filters_unlocked (self);
+ }
GST_OBJECT_UNLOCK (self);
- if (!_destroy_filters (self))
- return FALSE;
-
return ret;
fail_end_pic: