d3d11: Rename native handle getter and context utils functions
authorSeungha Yang <seungha.yang@navercorp.com>
Sun, 18 Aug 2019 11:56:06 +0000 (20:56 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 5 Dec 2019 02:29:18 +0000 (02:29 +0000)
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
sys/d3d11/gstd3d11device.h
sys/d3d11/gstd3d11memory.c
sys/d3d11/gstd3d11utils.c
sys/d3d11/gstd3d11videosink.c
sys/d3d11/gstd3d11window.c

index a5d8834..c288425 100644 (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
  *
  * 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);
 
index 4344903..680ddfd 100644 (file)
@@ -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);
 
index 6dcc52c..0350d0f 100644 (file)
@@ -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);
index 0c8d49a..a9d2259 100644 (file)
@@ -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++) {
index 8bdfcc7..9d55894 100644 (file)
@@ -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);
index 07aab26..d38a6ec 100644 (file)
@@ -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,