nvdecoder: Use own CUDA stream in GL output path
authorSeungha Yang <seungha@centricular.com>
Tue, 20 Dec 2022 15:20:17 +0000 (00:20 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 20 Dec 2022 17:14:10 +0000 (17:14 +0000)
Use the same CUDA stream passed to CuvidMapVideoFrame()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3611>

subprojects/gst-plugins-bad/sys/nvcodec/gstnvdecoder.c

index e9c7baf..6fa86d8 100644 (file)
@@ -667,13 +667,13 @@ gst_nv_decoder_copy_frame_to_gl_internal (GstGLContext * context,
     copy_params.dstDevice = dst_ptr;
     copy_params.Height = GST_VIDEO_INFO_COMP_HEIGHT (info, i);
 
-    if (!gst_cuda_result (CuMemcpy2DAsync (&copy_params, NULL))) {
+    if (!gst_cuda_result (CuMemcpy2DAsync (&copy_params, self->cuda_stream))) {
       GST_WARNING_OBJECT (self, "memcpy to mapped array failed");
       data->ret = FALSE;
     }
   }
 
-  gst_cuda_result (CuStreamSynchronize (NULL));
+  gst_cuda_result (CuStreamSynchronize (self->cuda_stream));
 
 unmap_video_frame:
   for (i = 0; i < num_resources; i++) {