Lines Matching refs:device
96 GstVulkanDevice *device; in gst_vulkan_device_new() local
100 device = g_object_new (GST_TYPE_VULKAN_DEVICE, "physical-device", in gst_vulkan_device_new()
102 gst_object_ref_sink (device); in gst_vulkan_device_new()
104 return device; in gst_vulkan_device_new()
121 GstVulkanDevice *device; in gst_vulkan_device_new_with_index() local
126 device = gst_vulkan_device_new (physical); in gst_vulkan_device_new_with_index()
128 return device; in gst_vulkan_device_new_with_index()
135 GstVulkanDevice *device = GST_VULKAN_DEVICE (object); in gst_vulkan_device_set_property() local
139 device->physical_device = g_value_dup_object (value); in gst_vulkan_device_set_property()
151 GstVulkanDevice *device = GST_VULKAN_DEVICE (object); in gst_vulkan_device_get_property() local
155 g_value_set_object (value, device->instance); in gst_vulkan_device_get_property()
158 g_value_set_object (value, device->physical_device); in gst_vulkan_device_get_property()
167 gst_vulkan_device_init (GstVulkanDevice * device) in gst_vulkan_device_init() argument
169 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_init()
178 GstVulkanDevice *device = GST_VULKAN_DEVICE (object); in gst_vulkan_device_constructed() local
180 g_object_get (device->physical_device, "instance", &device->instance, NULL); in gst_vulkan_device_constructed()
184 gst_vulkan_device_enable_extension (device, VK_KHR_SWAPCHAIN_EXTENSION_NAME); in gst_vulkan_device_constructed()
214 GstVulkanDevice *device = GST_VULKAN_DEVICE (object); in gst_vulkan_device_dispose() local
215 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_dispose()
222 priv->fence_cache->parent.device = NULL; in gst_vulkan_device_dispose()
232 GstVulkanDevice *device = GST_VULKAN_DEVICE (object); in gst_vulkan_device_finalize() local
233 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_finalize()
235 if (device->device) { in gst_vulkan_device_finalize()
236 vkDeviceWaitIdle (device->device); in gst_vulkan_device_finalize()
237 vkDestroyDevice (device->device, NULL); in gst_vulkan_device_finalize()
239 device->device = VK_NULL_HANDLE; in gst_vulkan_device_finalize()
241 gst_clear_object (&device->physical_device); in gst_vulkan_device_finalize()
242 gst_clear_object (&device->instance); in gst_vulkan_device_finalize()
265 gst_vulkan_device_open (GstVulkanDevice * device, GError ** error) in gst_vulkan_device_open() argument
267 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_open()
272 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), FALSE); in gst_vulkan_device_open()
274 GST_OBJECT_LOCK (device); in gst_vulkan_device_open()
277 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_open()
281 gpu = gst_vulkan_device_get_physical_device (device); in gst_vulkan_device_open()
284 for (i = 0; i < device->physical_device->n_queue_families; i++) { in gst_vulkan_device_open()
285 if (device->physical_device-> in gst_vulkan_device_open()
289 if (i >= device->physical_device->n_queue_families) { in gst_vulkan_device_open()
297 GST_INFO_OBJECT (device, "Creating a device from physical %" GST_PTR_FORMAT in gst_vulkan_device_open()
298 " with %u layers and %u extensions", device->physical_device, in gst_vulkan_device_open()
302 GST_DEBUG_OBJECT (device, "layer %u: %s", i, in gst_vulkan_device_open()
305 GST_DEBUG_OBJECT (device, "extension %u: %s", i, in gst_vulkan_device_open()
331 err = vkCreateDevice (gpu, &device_info, NULL, &device->device); in gst_vulkan_device_open()
337 priv->fence_cache = gst_vulkan_fence_cache_new (device); in gst_vulkan_device_open()
339 gst_object_unref (device); in gst_vulkan_device_open()
342 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_open()
347 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_open()
363 gst_vulkan_device_get_queue (GstVulkanDevice * device, guint32 queue_family, in gst_vulkan_device_get_queue() argument
366 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_get_queue()
369 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), NULL); in gst_vulkan_device_get_queue()
370 g_return_val_if_fail (device->device != NULL, NULL); in gst_vulkan_device_get_queue()
374 device->physical_device->queue_family_props[queue_family].queueCount, in gst_vulkan_device_get_queue()
379 ret->device = gst_object_ref (device); in gst_vulkan_device_get_queue()
383 vkGetDeviceQueue (device->device, queue_family, queue_i, &ret->queue); in gst_vulkan_device_get_queue()
399 gst_vulkan_device_foreach_queue (GstVulkanDevice * device, in gst_vulkan_device_foreach_queue() argument
402 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_foreach_queue()
408 gst_vulkan_device_get_queue (device, priv->queue_family_id, i); in gst_vulkan_device_foreach_queue()
410 if (!func (device, queue, user_data)) in gst_vulkan_device_foreach_queue()
432 gst_vulkan_device_get_proc_address (GstVulkanDevice * device, in gst_vulkan_device_get_proc_address() argument
435 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), NULL); in gst_vulkan_device_get_proc_address()
436 g_return_val_if_fail (device->device != NULL, NULL); in gst_vulkan_device_get_proc_address()
439 GST_TRACE_OBJECT (device, "%s", name); in gst_vulkan_device_get_proc_address()
441 return vkGetDeviceProcAddr (device->device, name); in gst_vulkan_device_get_proc_address()
453 gst_vulkan_device_get_instance (GstVulkanDevice * device) in gst_vulkan_device_get_instance() argument
455 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), NULL); in gst_vulkan_device_get_instance()
457 return device->instance ? gst_object_ref (device->instance) : NULL; in gst_vulkan_device_get_instance()
469 gst_vulkan_device_get_physical_device (GstVulkanDevice * device) in gst_vulkan_device_get_physical_device() argument
471 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), NULL); in gst_vulkan_device_get_physical_device()
473 return gst_vulkan_physical_device_get_handle (device->physical_device); in gst_vulkan_device_get_physical_device()
486 gst_context_set_vulkan_device (GstContext * context, GstVulkanDevice * device) in gst_context_set_vulkan_device() argument
493 if (device) in gst_context_set_vulkan_device()
496 GST_PTR_FORMAT ")", device, context); in gst_context_set_vulkan_device()
500 GST_TYPE_VULKAN_DEVICE, device, NULL); in gst_context_set_vulkan_device()
513 gst_context_get_vulkan_device (GstContext * context, GstVulkanDevice ** device) in gst_context_get_vulkan_device() argument
518 g_return_val_if_fail (device != NULL, FALSE); in gst_context_get_vulkan_device()
523 GST_TYPE_VULKAN_DEVICE, device, NULL); in gst_context_get_vulkan_device()
526 ") from context(%" GST_PTR_FORMAT ")", *device, context); in gst_context_get_vulkan_device()
548 GstVulkanDevice * device) in gst_vulkan_device_handle_context_query() argument
558 if (!device) in gst_vulkan_device_handle_context_query()
571 gst_context_set_vulkan_device (context, device); in gst_vulkan_device_handle_context_query()
575 res = device != NULL; in gst_vulkan_device_handle_context_query()
595 GstVulkanDevice ** device) in gst_vulkan_device_run_context_query() argument
600 g_return_val_if_fail (device != NULL, FALSE); in gst_vulkan_device_run_context_query()
604 if (*device && GST_IS_VULKAN_DEVICE (*device)) in gst_vulkan_device_run_context_query()
614 gst_context_get_vulkan_device (context, device); in gst_vulkan_device_run_context_query()
619 GST_DEBUG_OBJECT (element, "found device %p", *device); in gst_vulkan_device_run_context_query()
621 if (*device) in gst_vulkan_device_run_context_query()
637 gst_vulkan_device_create_fence (GstVulkanDevice * device, GError ** error) in gst_vulkan_device_create_fence() argument
641 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), NULL); in gst_vulkan_device_create_fence()
642 priv = GET_PRIV (device); in gst_vulkan_device_create_fence()
667 gst_vulkan_device_is_extension_enabled_unlocked (GstVulkanDevice * device, in gst_vulkan_device_is_extension_enabled_unlocked() argument
670 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_is_extension_enabled_unlocked()
685 gst_vulkan_device_is_extension_enabled (GstVulkanDevice * device, in gst_vulkan_device_is_extension_enabled() argument
690 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), FALSE); in gst_vulkan_device_is_extension_enabled()
693 GST_OBJECT_LOCK (device); in gst_vulkan_device_is_extension_enabled()
694 ret = gst_vulkan_device_is_extension_enabled_unlocked (device, name, NULL); in gst_vulkan_device_is_extension_enabled()
695 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_is_extension_enabled()
701 gst_vulkan_device_enable_extension_unlocked (GstVulkanDevice * device, in gst_vulkan_device_enable_extension_unlocked() argument
704 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_enable_extension_unlocked()
706 if (gst_vulkan_device_is_extension_enabled_unlocked (device, name, NULL)) in gst_vulkan_device_enable_extension_unlocked()
710 if (!gst_vulkan_physical_device_get_extension_info (device->physical_device, in gst_vulkan_device_enable_extension_unlocked()
732 gst_vulkan_device_enable_extension (GstVulkanDevice * device, in gst_vulkan_device_enable_extension() argument
737 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), FALSE); in gst_vulkan_device_enable_extension()
740 GST_OBJECT_LOCK (device); in gst_vulkan_device_enable_extension()
741 ret = gst_vulkan_device_enable_extension_unlocked (device, name); in gst_vulkan_device_enable_extension()
742 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_enable_extension()
748 gst_vulkan_device_disable_extension_unlocked (GstVulkanDevice * device, in gst_vulkan_device_disable_extension_unlocked() argument
751 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_disable_extension_unlocked()
754 if (!gst_vulkan_physical_device_get_extension_info (device->physical_device, in gst_vulkan_device_disable_extension_unlocked()
758 if (!gst_vulkan_device_is_extension_enabled_unlocked (device, name, &i)) in gst_vulkan_device_disable_extension_unlocked()
780 gst_vulkan_device_disable_extension (GstVulkanDevice * device, in gst_vulkan_device_disable_extension() argument
785 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), FALSE); in gst_vulkan_device_disable_extension()
788 GST_OBJECT_LOCK (device); in gst_vulkan_device_disable_extension()
789 ret = gst_vulkan_device_disable_extension_unlocked (device, name); in gst_vulkan_device_disable_extension()
790 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_disable_extension()
796 gst_vulkan_device_is_layer_enabled_unlocked (GstVulkanDevice * device, in gst_vulkan_device_is_layer_enabled_unlocked() argument
799 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_is_layer_enabled_unlocked()
814 gst_vulkan_device_is_layer_enabled (GstVulkanDevice * device, in gst_vulkan_device_is_layer_enabled() argument
819 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), FALSE); in gst_vulkan_device_is_layer_enabled()
822 GST_OBJECT_LOCK (device); in gst_vulkan_device_is_layer_enabled()
823 ret = gst_vulkan_device_is_layer_enabled_unlocked (device, name); in gst_vulkan_device_is_layer_enabled()
824 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_is_layer_enabled()
830 gst_vulkan_device_enable_layer_unlocked (GstVulkanDevice * device, in gst_vulkan_device_enable_layer_unlocked() argument
833 GstVulkanDevicePrivate *priv = GET_PRIV (device); in gst_vulkan_device_enable_layer_unlocked()
835 if (gst_vulkan_device_is_layer_enabled_unlocked (device, name)) in gst_vulkan_device_enable_layer_unlocked()
839 if (!gst_vulkan_physical_device_get_layer_info (device->physical_device, in gst_vulkan_device_enable_layer_unlocked()
861 gst_vulkan_device_enable_layer (GstVulkanDevice * device, const gchar * name) in gst_vulkan_device_enable_layer() argument
865 g_return_val_if_fail (GST_IS_VULKAN_DEVICE (device), FALSE); in gst_vulkan_device_enable_layer()
868 GST_OBJECT_LOCK (device); in gst_vulkan_device_enable_layer()
869 ret = gst_vulkan_device_enable_layer_unlocked (device, name); in gst_vulkan_device_enable_layer()
870 GST_OBJECT_UNLOCK (device); in gst_vulkan_device_enable_layer()