mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
qsvencoder: Handle d3d12 context
GstD3D12Device objetct's internal resources are singletons per adapter already though, the object itself is not a singleton. Due to the singleton design (unlike other APIs such as d3d11), d3d12 device context sharing is not a strict requirement for zero-copy, but handles context ones to make things less noisy. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6513>
This commit is contained in:
parent
ad6670ba81
commit
b9ebe979ee
1 changed files with 14 additions and 3 deletions
|
@ -362,6 +362,10 @@ gst_qsv_encoder_set_context (GstElement * element, GstContext * context)
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gst_d3d11_handle_set_context_for_adapter_luid (element,
|
gst_d3d11_handle_set_context_for_adapter_luid (element,
|
||||||
context, klass->adapter_luid, (GstD3D11Device **) & priv->device);
|
context, klass->adapter_luid, (GstD3D11Device **) & priv->device);
|
||||||
|
#ifdef HAVE_GST_D3D12
|
||||||
|
gst_d3d12_handle_set_context_for_adapter_luid (element,
|
||||||
|
context, klass->adapter_luid, (GstD3D12Device **) & priv->device12);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
gst_va_handle_set_context (element, context, klass->display_path,
|
gst_va_handle_set_context (element, context, klass->display_path,
|
||||||
(GstVaDisplay **) & priv->device);
|
(GstVaDisplay **) & priv->device);
|
||||||
|
@ -1429,13 +1433,20 @@ gst_qsv_encoder_flush (GstVideoEncoder * encoder)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_qsv_encoder_handle_context_query (GstQsvEncoder * self, GstQuery * query)
|
gst_qsv_encoder_handle_context_query (GstQsvEncoder * self, GstQuery * query)
|
||||||
{
|
{
|
||||||
GstQsvEncoderPrivate *priv = self->priv;
|
auto priv = self->priv;
|
||||||
|
auto elem = GST_ELEMENT_CAST (self);
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
return gst_d3d11_handle_context_query (GST_ELEMENT (self), query,
|
#ifdef HAVE_GST_D3D12
|
||||||
|
if (gst_d3d12_handle_context_query (elem, query,
|
||||||
|
(GstD3D12Device *) priv->device12)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return gst_d3d11_handle_context_query (elem, query,
|
||||||
(GstD3D11Device *) priv->device);
|
(GstD3D11Device *) priv->device);
|
||||||
#else
|
#else
|
||||||
return gst_va_handle_context_query (GST_ELEMENT (self), query,
|
return gst_va_handle_context_query (elem, query,
|
||||||
(GstVaDisplay *) priv->device);
|
(GstVaDisplay *) priv->device);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue