d3d12ipcsink: Handle external fence

Waits external fence before sending frame to peer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6749>
This commit is contained in:
Seungha Yang 2024-04-27 22:02:59 +09:00 committed by GStreamer Marge Bot
parent b7844ef307
commit 19932cf178

View file

@ -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);