mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
cudabasetransform: Update CUDA stream on context update
CUDA stream must be associated with updated CUDA context Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3618>
This commit is contained in:
parent
ad0ba3ab7d
commit
15b2cd6565
1 changed files with 11 additions and 0 deletions
|
@ -340,9 +340,20 @@ gst_cuda_base_transform_before_transform (GstBaseTransform * trans,
|
|||
GST_INFO_OBJECT (self, "Updating device %" GST_PTR_FORMAT " -> %"
|
||||
GST_PTR_FORMAT, self->context, cmem->context);
|
||||
|
||||
if (self->cuda_stream) {
|
||||
gst_cuda_context_push (self->context);
|
||||
CuStreamDestroy (self->cuda_stream);
|
||||
gst_cuda_context_pop (NULL);
|
||||
self->cuda_stream = NULL;
|
||||
}
|
||||
|
||||
gst_object_unref (self->context);
|
||||
self->context = gst_object_ref (cmem->context);
|
||||
|
||||
gst_cuda_context_push (self->context);
|
||||
CuStreamCreate (&self->cuda_stream, CU_STREAM_DEFAULT);
|
||||
gst_cuda_context_pop (NULL);
|
||||
|
||||
/* subclass will update internal object.
|
||||
* Note that gst_base_transform_reconfigure() might not trigger this
|
||||
* unless caps was changed meanwhile */
|
||||
|
|
Loading…
Reference in a new issue