d3d11: Rename native handle getter and context utils functions

Make them consistent with cuda context utils functions.
Put in-only parameter before all in-out parameters, and add _handle()
suffix to native handle getter functions.
This commit is contained in:
Seungha Yang 2019-08-18 20:56:06 +09:00 committed by GStreamer Merge Bot
parent d3426cf15b
commit 494ec13316
6 changed files with 14 additions and 14 deletions

View file

@ -592,7 +592,7 @@ gst_d3d11_device_new (gint adapter)
} }
/** /**
* gst_d3d11_device_get_device: * gst_d3d11_device_get_device_handle:
* @device: a #GstD3D11Device * @device: a #GstD3D11Device
* *
* Used for various D3D11 APIs directly. * Used for various D3D11 APIs directly.
@ -601,7 +601,7 @@ gst_d3d11_device_new (gint adapter)
* Returns: (transfer none): the ID3D11Device * Returns: (transfer none): the ID3D11Device
*/ */
ID3D11Device * ID3D11Device *
gst_d3d11_device_get_device (GstD3D11Device * device) gst_d3d11_device_get_device_handle (GstD3D11Device * device)
{ {
g_return_val_if_fail (GST_IS_D3D11_DEVICE (device), NULL); g_return_val_if_fail (GST_IS_D3D11_DEVICE (device), NULL);
@ -609,7 +609,7 @@ gst_d3d11_device_get_device (GstD3D11Device * device)
} }
/** /**
* gst_d3d11_device_get_device_context: * gst_d3d11_device_get_device_context_handle:
* @device: a #GstD3D11Device * @device: a #GstD3D11Device
* *
* Used for various D3D11 APIs directly. * Used for various D3D11 APIs directly.
@ -618,7 +618,7 @@ gst_d3d11_device_get_device (GstD3D11Device * device)
* Returns: (transfer none): the ID3D11DeviceContext * Returns: (transfer none): the ID3D11DeviceContext
*/ */
ID3D11DeviceContext * ID3D11DeviceContext *
gst_d3d11_device_get_device_context (GstD3D11Device * device) gst_d3d11_device_get_device_context_handle (GstD3D11Device * device)
{ {
g_return_val_if_fail (GST_IS_D3D11_DEVICE (device), NULL); g_return_val_if_fail (GST_IS_D3D11_DEVICE (device), NULL);

View file

@ -79,9 +79,9 @@ GType gst_d3d11_device_get_type (void);
GstD3D11Device * gst_d3d11_device_new (gint adapter); GstD3D11Device * gst_d3d11_device_new (gint adapter);
ID3D11Device * gst_d3d11_device_get_device (GstD3D11Device * device); ID3D11Device * gst_d3d11_device_get_device_handle (GstD3D11Device * device);
ID3D11DeviceContext * gst_d3d11_device_get_device_context (GstD3D11Device * device); ID3D11DeviceContext * gst_d3d11_device_get_device_context_handle (GstD3D11Device * device);
GstD3D11DXGIFactoryVersion gst_d3d11_device_get_chosen_dxgi_factory_version (GstD3D11Device * device); GstD3D11DXGIFactoryVersion gst_d3d11_device_get_chosen_dxgi_factory_version (GstD3D11Device * device);

View file

@ -137,7 +137,7 @@ _map_cpu_access_data (GstD3D11Device * device, gpointer data)
ID3D11Resource *texture = (ID3D11Resource *) dmem->texture; ID3D11Resource *texture = (ID3D11Resource *) dmem->texture;
ID3D11Resource *staging = (ID3D11Resource *) dmem->staging; ID3D11Resource *staging = (ID3D11Resource *) dmem->staging;
ID3D11DeviceContext *device_context = ID3D11DeviceContext *device_context =
gst_d3d11_device_get_device_context (device); gst_d3d11_device_get_device_context_handle (device);
ID3D11DeviceContext_CopySubresourceRegion (device_context, ID3D11DeviceContext_CopySubresourceRegion (device_context,
staging, 0, 0, 0, 0, texture, 0, NULL); staging, 0, 0, 0, 0, texture, 0, NULL);
@ -190,7 +190,7 @@ _unmap_cpu_access_data (GstD3D11Device * device, gpointer data)
ID3D11Resource *texture = (ID3D11Resource *) dmem->texture; ID3D11Resource *texture = (ID3D11Resource *) dmem->texture;
ID3D11Resource *staging = (ID3D11Resource *) dmem->staging; ID3D11Resource *staging = (ID3D11Resource *) dmem->staging;
ID3D11DeviceContext *device_context = ID3D11DeviceContext *device_context =
gst_d3d11_device_get_device_context (device); gst_d3d11_device_get_device_context_handle (device);
ID3D11DeviceContext_Unmap (device_context, staging, 0); ID3D11DeviceContext_Unmap (device_context, staging, 0);
@ -315,7 +315,7 @@ _calculate_buffer_size (GstD3D11Device * device, CalculateSizeData * data)
HRESULT hr; HRESULT hr;
D3D11_MAPPED_SUBRESOURCE map; D3D11_MAPPED_SUBRESOURCE map;
ID3D11DeviceContext *device_context = ID3D11DeviceContext *device_context =
gst_d3d11_device_get_device_context (device); gst_d3d11_device_get_device_context_handle (device);
hr = ID3D11DeviceContext_Map (device_context, hr = ID3D11DeviceContext_Map (device_context,
(ID3D11Resource *) data->staging, 0, GST_MAP_READWRITE, 0, &map); (ID3D11Resource *) data->staging, 0, GST_MAP_READWRITE, 0, &map);

View file

@ -108,7 +108,7 @@ gst_d3d11_device_get_supported_caps_internal (GstD3D11Device * device,
GValue v_list = G_VALUE_INIT; GValue v_list = G_VALUE_INIT;
GstCaps *supported_caps; GstCaps *supported_caps;
d3d11_device = gst_d3d11_device_get_device (device); d3d11_device = gst_d3d11_device_get_device_handle (device);
g_value_init (&v_list, GST_TYPE_LIST); g_value_init (&v_list, GST_TYPE_LIST);
for (i = 0; i < G_N_ELEMENTS (gst_dxgi_format_map); i++) { for (i = 0; i < G_N_ELEMENTS (gst_dxgi_format_map); i++) {

View file

@ -587,7 +587,7 @@ _upload_frame (GstD3D11Device * device, gpointer data)
self = upload_data->sink; self = upload_data->sink;
device_context = gst_d3d11_device_get_device_context (device); device_context = gst_d3d11_device_get_device_context_handle (device);
hr = ID3D11DeviceContext_Map (device_context, hr = ID3D11DeviceContext_Map (device_context,
upload_data->resource, 0, D3D11_MAP_WRITE, 0, &d3d11_map); upload_data->resource, 0, D3D11_MAP_WRITE, 0, &d3d11_map);

View file

@ -495,8 +495,8 @@ gst_d3d11_window_on_resize (GstD3D11Device * device, GstD3D11Window * window)
if (!window->swap_chain) if (!window->swap_chain)
return; return;
d3d11_dev = gst_d3d11_device_get_device (device); d3d11_dev = gst_d3d11_device_get_device_handle (device);
d3d11_context = gst_d3d11_device_get_device_context (device); d3d11_context = gst_d3d11_device_get_device_context_handle (device);
if (window->backbuffer) { if (window->backbuffer) {
ID3D11Texture2D_Release (window->backbuffer); ID3D11Texture2D_Release (window->backbuffer);
@ -1057,7 +1057,7 @@ _present_on_device_thread (GstD3D11Device * device, FramePresentData * data)
src_box.front = 0; src_box.front = 0;
src_box.back = 1; src_box.back = 1;
device_context = gst_d3d11_device_get_device_context (device); device_context = gst_d3d11_device_get_device_context_handle (device);
if (data->resource) { if (data->resource) {
ID3D11DeviceContext_ClearRenderTargetView (device_context, self->rtv, ID3D11DeviceContext_ClearRenderTargetView (device_context, self->rtv,