amfencoder: Do shared resource copy only if texture belongs to other device

Staging texture from the same d3d11device can be copied without
shared resource handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2165>
This commit is contained in:
Seungha Yang 2022-04-13 01:39:43 +09:00
parent 2548014dfc
commit 097919f79b

View file

@ -781,7 +781,7 @@ gst_amf_encoder_upload_buffer (GstAmfEncoder * self, GstBuffer * buffer)
if (desc.Usage != D3D11_USAGE_DEFAULT) {
GST_TRACE_OBJECT (self, "Not a default usage texture, d3d11 copy");
gst_d3d11_device_lock (priv->device);
ret = gst_amf_encoder_copy_d3d11 (self, buffer, TRUE);
ret = gst_amf_encoder_copy_d3d11 (self, buffer, FALSE);
gst_d3d11_device_unlock (priv->device);
return ret;