diff options
author | Seungha Yang <seungha@centricular.com> | 2024-04-27 22:02:59 +0900 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2024-04-28 12:49:07 +0000 |
commit | 19932cf178a13d784af4a370e4d7576f1cc72f6d (patch) | |
tree | 99462b8c23b3f18e4f916003540177f572059940 | |
parent | b7844ef307e25b4f3a21f1895fe93dd549a2210a (diff) |
d3d12ipcsink: Handle external fence
Waits external fence before sending frame to peer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
-rw-r--r-- | subprojects/gst-plugins-bad/sys/d3d12/gstd3d12ipcsink.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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); |