GstVideoInfo info;
gboolean has_copy;
+
+ GRecMutex lock;
GstVaFilter *filter;
};
self->has_copy = _has_copy (display);
self->info = *vinfo;
self->filter = NULL;
+ g_rec_mutex_init (&self->lock);
if (gst_va_display_has_vpp (display)) {
self->filter = gst_va_filter_new (display);
gst_va_filter_close (self->filter);
gst_clear_object (&self->filter);
}
+
+ g_rec_mutex_clear (&self->lock);
+
g_slice_free (GstVaSurfaceCopy, self);
}
static gboolean
-_vpp_copy_surface (GstVaFilter * filter, VASurfaceID dst, VASurfaceID src)
+_vpp_copy_surface (GstVaSurfaceCopy * self, VASurfaceID dst, VASurfaceID src)
{
+ gboolean ret;
+
GstVaSample gst_src = {
.surface = src,
};
GstVaSample gst_dst = {
.surface = dst,
};
- return gst_va_filter_process (filter, &gst_src, &gst_dst);
+
+ g_rec_mutex_lock (&self->lock);
+ ret = gst_va_filter_process (self->filter, &gst_src, &gst_dst);
+ g_rec_mutex_unlock (&self->lock);
+
+ return ret;
}
gboolean
return TRUE;
}
- if (self->filter && _vpp_copy_surface (self->filter, dst, src)) {
+ if (self->filter && _vpp_copy_surface (self, dst, src)) {
GST_LOG ("VPP copy of %#x to %#x", src, dst);
return TRUE;
}