mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-21 22:58:16 +00:00
d3d12decoder: Fix d3d12 resource copy
It was copying to self resource Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6755>
This commit is contained in:
parent
17ede2149b
commit
4a7f3d0b75
1 changed files with 10 additions and 9 deletions
|
@ -1420,7 +1420,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];
|
||||||
|
|
||||||
|
@ -1430,17 +1429,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 (dmem->device == self->device) {
|
if (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