mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-13 17:55:30 +00:00
d3d11: Add a helper method for GstContext creation
Add gst_d3d11_context_new() method for application to create GstContext using GstD3D11Device. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>
This commit is contained in:
parent
06b7b240af
commit
eee0f97c18
2 changed files with 27 additions and 0 deletions
|
@ -491,6 +491,30 @@ gst_d3d11_ensure_element_data_for_adapter_luid (GstElement * element,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_d3d11_context_new:
|
||||||
|
* @device: (transfer none): a #GstD3D11Device
|
||||||
|
*
|
||||||
|
* Creates a new #GstContext object with @device
|
||||||
|
*
|
||||||
|
* Returns: a #GstContext object
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
|
||||||
|
GstContext *
|
||||||
|
gst_d3d11_context_new (GstD3D11Device * device)
|
||||||
|
{
|
||||||
|
GstContext *context;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GST_IS_D3D11_DEVICE (device), nullptr);
|
||||||
|
|
||||||
|
context = gst_context_new (GST_D3D11_DEVICE_HANDLE_CONTEXT_TYPE, TRUE);
|
||||||
|
context_set_d3d11_device (context, device);
|
||||||
|
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_d3d11_luid_to_int64:
|
* gst_d3d11_luid_to_int64:
|
||||||
* @luid: A pointer to LUID struct
|
* @luid: A pointer to LUID struct
|
||||||
|
|
|
@ -51,6 +51,9 @@ gboolean gst_d3d11_ensure_element_data_for_adapter_luid (GstElement * ele
|
||||||
gint64 adapter_luid,
|
gint64 adapter_luid,
|
||||||
GstD3D11Device ** device);
|
GstD3D11Device ** device);
|
||||||
|
|
||||||
|
GST_D3D11_API
|
||||||
|
GstContext * gst_d3d11_context_new (GstD3D11Device * device);
|
||||||
|
|
||||||
GST_D3D11_API
|
GST_D3D11_API
|
||||||
gint64 gst_d3d11_luid_to_int64 (const LUID * luid);
|
gint64 gst_d3d11_luid_to_int64 (const LUID * luid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue