mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
va: filter: Shuffle _destroy_filters_unlocked().
In order to put it near to its caller. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
This commit is contained in:
parent
0a7828e9ba
commit
7f2e1e2eb3
1 changed files with 31 additions and 31 deletions
|
@ -1219,37 +1219,6 @@ gst_va_filter_set_video_info (GstVaFilter * self, GstVideoInfo * in_info,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_destroy_filters_unlocked (GstVaFilter * self)
|
||||
{
|
||||
VABufferID buffer;
|
||||
VADisplay dpy;
|
||||
VAStatus status;
|
||||
gboolean ret = TRUE;
|
||||
guint i;
|
||||
|
||||
GST_TRACE_OBJECT (self, "Destroying %u filter buffers", self->filters->len);
|
||||
|
||||
dpy = gst_va_display_get_va_dpy (self->display);
|
||||
|
||||
for (i = 0; i < self->filters->len; i++) {
|
||||
buffer = g_array_index (self->filters, VABufferID, i);
|
||||
|
||||
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_OBJECT (self, "Failed to destroy filter buffer: %s",
|
||||
vaErrorStr (status));
|
||||
}
|
||||
}
|
||||
|
||||
self->filters = g_array_set_size (self->filters, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_va_filter_add_filter_buffer (GstVaFilter * self, gpointer data, gsize size,
|
||||
guint num)
|
||||
|
@ -1285,6 +1254,37 @@ gst_va_filter_add_filter_buffer (GstVaFilter * self, gpointer data, gsize size,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_destroy_filters_unlocked (GstVaFilter * self)
|
||||
{
|
||||
VABufferID buffer;
|
||||
VADisplay dpy;
|
||||
VAStatus status;
|
||||
gboolean ret = TRUE;
|
||||
guint i;
|
||||
|
||||
GST_TRACE_OBJECT (self, "Destroying %u filter buffers", self->filters->len);
|
||||
|
||||
dpy = gst_va_display_get_va_dpy (self->display);
|
||||
|
||||
for (i = 0; i < self->filters->len; i++) {
|
||||
buffer = g_array_index (self->filters, VABufferID, i);
|
||||
|
||||
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_OBJECT (self, "Failed to destroy filter buffer: %s",
|
||||
vaErrorStr (status));
|
||||
}
|
||||
}
|
||||
|
||||
self->filters = g_array_set_size (self->filters, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_va_filter_drop_filter_buffers (GstVaFilter * self)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue