mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
d3d12decoder: Fix d3d12 resource copy
It was copying to self resource Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6753>
This commit is contained in:
parent
84f4068036
commit
cb20a371c2
1 changed files with 10 additions and 9 deletions
|
@ -1447,7 +1447,6 @@ gst_d3d12_decoder_process_output (GstD3D12Decoder * self,
|
||||||
|
|
||||||
frame->output_buffer = gst_buffer_ref (buffer);
|
frame->output_buffer = gst_buffer_ref (buffer);
|
||||||
} else {
|
} else {
|
||||||
GstMemory *mem;
|
|
||||||
ID3D12Resource *out_resource = nullptr;
|
ID3D12Resource *out_resource = nullptr;
|
||||||
UINT out_subresource[2];
|
UINT out_subresource[2];
|
||||||
|
|
||||||
|
@ -1457,17 +1456,19 @@ gst_d3d12_decoder_process_output (GstD3D12Decoder * self,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
mem = gst_buffer_peek_memory (frame->output_buffer, 0);
|
auto out_mem = gst_buffer_peek_memory (frame->output_buffer, 0);
|
||||||
if (gst_is_d3d12_memory (mem)) {
|
if (gst_is_d3d12_memory (out_mem)) {
|
||||||
dmem = GST_D3D12_MEMORY_CAST (mem);
|
auto out_dmem = GST_D3D12_MEMORY_CAST (out_mem);
|
||||||
if (gst_d3d12_device_is_equal (dmem->device, self->device)) {
|
if (gst_d3d12_device_is_equal (dmem->device, self->device)) {
|
||||||
out_resource = gst_d3d12_memory_get_resource_handle (dmem);
|
out_resource = gst_d3d12_memory_get_resource_handle (out_dmem);
|
||||||
gst_d3d12_memory_get_subresource_index (dmem, 0, &out_subresource[0]);
|
gst_d3d12_memory_get_subresource_index (out_dmem, 0,
|
||||||
gst_d3d12_memory_get_subresource_index (dmem, 1, &out_subresource[1]);
|
&out_subresource[0]);
|
||||||
|
gst_d3d12_memory_get_subresource_index (out_dmem, 1,
|
||||||
|
&out_subresource[1]);
|
||||||
|
|
||||||
GST_MINI_OBJECT_FLAG_SET (dmem,
|
GST_MINI_OBJECT_FLAG_SET (out_dmem,
|
||||||
GST_D3D12_MEMORY_TRANSFER_NEED_DOWNLOAD);
|
GST_D3D12_MEMORY_TRANSFER_NEED_DOWNLOAD);
|
||||||
GST_MINI_OBJECT_FLAG_UNSET (dmem,
|
GST_MINI_OBJECT_FLAG_UNSET (out_dmem,
|
||||||
GST_D3D12_MEMORY_TRANSFER_NEED_UPLOAD);
|
GST_D3D12_MEMORY_TRANSFER_NEED_UPLOAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue