From 494ec13316e10803e6b53f07c490da4265bb56f3 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 18 Aug 2019 20:56:06 +0900 Subject: [PATCH] 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. --- sys/d3d11/gstd3d11device.c | 8 ++++---- sys/d3d11/gstd3d11device.h | 4 ++-- sys/d3d11/gstd3d11memory.c | 6 +++--- sys/d3d11/gstd3d11utils.c | 2 +- sys/d3d11/gstd3d11videosink.c | 2 +- sys/d3d11/gstd3d11window.c | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/d3d11/gstd3d11device.c b/sys/d3d11/gstd3d11device.c index a5d8834cd9..c288425d15 100644 --- a/sys/d3d11/gstd3d11device.c +++ b/sys/d3d11/gstd3d11device.c @@ -592,7 +592,7 @@ gst_d3d11_device_new (gint adapter) } /** - * gst_d3d11_device_get_device: + * gst_d3d11_device_get_device_handle: * @device: a #GstD3D11Device * * Used for various D3D11 APIs directly. @@ -601,7 +601,7 @@ gst_d3d11_device_new (gint adapter) * Returns: (transfer none): the 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); @@ -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 * * Used for various D3D11 APIs directly. @@ -618,7 +618,7 @@ gst_d3d11_device_get_device (GstD3D11Device * device) * Returns: (transfer none): the 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); diff --git a/sys/d3d11/gstd3d11device.h b/sys/d3d11/gstd3d11device.h index 43449039ba..680ddfda9b 100644 --- a/sys/d3d11/gstd3d11device.h +++ b/sys/d3d11/gstd3d11device.h @@ -79,9 +79,9 @@ GType gst_d3d11_device_get_type (void); 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); diff --git a/sys/d3d11/gstd3d11memory.c b/sys/d3d11/gstd3d11memory.c index 6dcc52c953..0350d0f5e0 100644 --- a/sys/d3d11/gstd3d11memory.c +++ b/sys/d3d11/gstd3d11memory.c @@ -137,7 +137,7 @@ _map_cpu_access_data (GstD3D11Device * device, gpointer data) ID3D11Resource *texture = (ID3D11Resource *) dmem->texture; ID3D11Resource *staging = (ID3D11Resource *) dmem->staging; ID3D11DeviceContext *device_context = - gst_d3d11_device_get_device_context (device); + gst_d3d11_device_get_device_context_handle (device); ID3D11DeviceContext_CopySubresourceRegion (device_context, 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 *staging = (ID3D11Resource *) dmem->staging; ID3D11DeviceContext *device_context = - gst_d3d11_device_get_device_context (device); + gst_d3d11_device_get_device_context_handle (device); ID3D11DeviceContext_Unmap (device_context, staging, 0); @@ -315,7 +315,7 @@ _calculate_buffer_size (GstD3D11Device * device, CalculateSizeData * data) HRESULT hr; D3D11_MAPPED_SUBRESOURCE map; ID3D11DeviceContext *device_context = - gst_d3d11_device_get_device_context (device); + gst_d3d11_device_get_device_context_handle (device); hr = ID3D11DeviceContext_Map (device_context, (ID3D11Resource *) data->staging, 0, GST_MAP_READWRITE, 0, &map); diff --git a/sys/d3d11/gstd3d11utils.c b/sys/d3d11/gstd3d11utils.c index 0c8d49a763..a9d2259d18 100644 --- a/sys/d3d11/gstd3d11utils.c +++ b/sys/d3d11/gstd3d11utils.c @@ -108,7 +108,7 @@ gst_d3d11_device_get_supported_caps_internal (GstD3D11Device * device, GValue v_list = G_VALUE_INIT; 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); for (i = 0; i < G_N_ELEMENTS (gst_dxgi_format_map); i++) { diff --git a/sys/d3d11/gstd3d11videosink.c b/sys/d3d11/gstd3d11videosink.c index 8bdfcc78c4..9d55894313 100644 --- a/sys/d3d11/gstd3d11videosink.c +++ b/sys/d3d11/gstd3d11videosink.c @@ -587,7 +587,7 @@ _upload_frame (GstD3D11Device * device, gpointer data) 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, upload_data->resource, 0, D3D11_MAP_WRITE, 0, &d3d11_map); diff --git a/sys/d3d11/gstd3d11window.c b/sys/d3d11/gstd3d11window.c index 07aab264e1..d38a6ecfc6 100644 --- a/sys/d3d11/gstd3d11window.c +++ b/sys/d3d11/gstd3d11window.c @@ -495,8 +495,8 @@ gst_d3d11_window_on_resize (GstD3D11Device * device, GstD3D11Window * window) if (!window->swap_chain) return; - d3d11_dev = gst_d3d11_device_get_device (device); - d3d11_context = gst_d3d11_device_get_device_context (device); + d3d11_dev = gst_d3d11_device_get_device_handle (device); + d3d11_context = gst_d3d11_device_get_device_context_handle (device); if (window->backbuffer) { ID3D11Texture2D_Release (window->backbuffer); @@ -1057,7 +1057,7 @@ _present_on_device_thread (GstD3D11Device * device, FramePresentData * data) src_box.front = 0; 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) { ID3D11DeviceContext_ClearRenderTargetView (device_context, self->rtv,