From 19932cf178a13d784af4a370e4d7576f1cc72f6d Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 27 Apr 2024 22:02:59 +0900 Subject: [PATCH] d3d12ipcsink: Handle external fence Waits external fence before sending frame to peer. Part-of: --- .../gst-plugins-bad/sys/d3d12/gstd3d12ipcsink.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12ipcsink.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12ipcsink.cpp index 03d3f53b4a..665ee86857 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12ipcsink.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12ipcsink.cpp @@ -632,6 +632,17 @@ gst_d3d12_ipc_sink_prepare (GstBaseSink * sink, GstBuffer * buf) gst_video_frame_unmap (&frame); + GstD3D12Frame d3d12_frame; + if (!gst_d3d12_frame_map (&d3d12_frame, &priv->info, uploaded, GST_MAP_D3D12, + GST_D3D12_FRAME_MAP_FLAG_NONE)) { + GST_ERROR_OBJECT (self, "Couldn't map frame"); + gst_buffer_unref (uploaded); + return GST_FLOW_ERROR; + } + + gst_d3d12_frame_fence_cpu_wait (&d3d12_frame); + gst_d3d12_frame_unmap (&d3d12_frame); + if (!gst_d3d12_memory_get_nt_handle (dmem, &nt_handle)) { GST_ERROR_OBJECT (self, "Couldn't get NT handle"); gst_buffer_unref (uploaded);