vulkan: Add/fix various annotations

And fix a memory leak in gst_vulkan_display_wayland_new() in error
cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
This commit is contained in:
Sebastian Dröge 2022-10-17 11:29:02 +03:00
parent b57c07d5a7
commit 2f0e195709
12 changed files with 28 additions and 24 deletions

View file

@ -64,7 +64,7 @@ gst_vulkan_display_android_finalize (GObject * object)
*
* Create a new #GstVulkanDisplayAndroid.
*
* Returns: (transfer full): a new #GstVulkanDisplayAndroid or %NULL
* Returns: (transfer full): a new #GstVulkanDisplayAndroid
*/
GstVulkanDisplayAndroid *
gst_vulkan_display_android_new (void)

View file

@ -221,7 +221,7 @@ gst_vulkan_display_cocoa_finalize (GObject * object)
*
* Create a new #GstVulkanDisplayCocoa.
*
* Returns: (transfer full): a new #GstVulkanDisplayCocoa or %NULL
* Returns: (transfer full): a new #GstVulkanDisplayCocoa
*/
GstVulkanDisplayCocoa *
gst_vulkan_display_cocoa_new (void)

View file

@ -424,7 +424,7 @@ gst_vulkan_device_foreach_queue (GstVulkanDevice * device,
*
* Performs `vkGetDeviceProcAddr()` with @device and @name
*
* Returns: the function pointer for @name or %NULL
* Returns: (nullable): the function pointer for @name or %NULL
*
* Since: 1.18
*/
@ -445,7 +445,7 @@ gst_vulkan_device_get_proc_address (GstVulkanDevice * device,
* gst_vulkan_device_get_instance:
* @device: a #GstVulkanDevice
*
* Returns: (transfer full): the #GstVulkanInstance used to create this @device
* Returns: (transfer full) (nullable): the #GstVulkanInstance used to create this @device
*
* Since: 1.18
*/
@ -629,7 +629,7 @@ gst_vulkan_device_run_context_query (GstElement * element,
* @device: a #GstVulkanDevice
* @error: a #GError to fill on failure
*
* Returns: a new #GstVulkanFence or %NULL
* Returns: (transfer full) (nullable): a new #GstVulkanFence or %NULL
*
* Since: 1.18
*/

View file

@ -206,7 +206,7 @@ gst_vulkan_display_finalize (GObject * object)
* @instance: a #GstVulkanInstance
* @type: the #GstVulkanDisplayType to create
*
* Returns: (transfer full): a new #GstVulkanDisplay or %NULL if e.g. @type is
* Returns: (transfer full) (nullable): a new #GstVulkanDisplay or %NULL if e.g. @type is
* unsupported
*
* Since: 1.18
@ -326,7 +326,7 @@ gst_vulkan_display_get_handle_type (GstVulkanDisplay * display)
* gst_vulkan_display_create_window:
* @display: a #GstVulkanDisplay
*
* Returns: (transfer full): a new #GstVulkanWindow for @display or %NULL.
* Returns: (transfer full) (nullable): a new #GstVulkanWindow for @display or %NULL.
*
* Since: 1.18
*/
@ -400,7 +400,7 @@ window_weak_list_to_strong (GstVulkanDisplay * display)
* first argument to @compare_func is the #GstVulkanWindow being checked and the
* second argument is @data.
*
* Returns: (transfer full): The first #GstVulkanWindow that causes a match
* Returns: (transfer full) (nullable): The first #GstVulkanWindow that causes a match
* from @compare_func
*
* Since: 1.18
@ -633,7 +633,7 @@ gst_vulkan_display_choose_type (GstVulkanInstance * instance)
* gst_vulkan_display_type_to_extension_string:
* @type: a #GstVulkanDisplayType
*
* Returns: the Vulkan extension string required for creating a VkSurfaceKHR
* Returns: (nullable): the Vulkan extension string required for creating a VkSurfaceKHR
* using a window system handle or %NULL
*
* Since: 1.18

View file

@ -87,7 +87,7 @@ gst_vulkan_fence_free (GstVulkanFence * fence)
/**
* gst_vulkan_fence_new:
* @device: the parent #GstVulkanDevice
* @error: a #GError for the failure condition
* @error: (optional): a #GError for the failure condition
*
* Returns: whether a new #GstVulkanFence or %NULL on error
*

View file

@ -419,7 +419,7 @@ FIXME: implement:
* gst_vulkan_format_get_info:
* @format: a valid `VkFormat`
*
* Returns: the #GstVulkanFormatInfo for @format or %NULL
* Returns: (nullable): the #GstVulkanFormatInfo for @format or %NULL
*
* Since: 1.18
*/

View file

@ -1071,7 +1071,7 @@ error:
*
* Performs `vkGetInstanceProcAddr()` with @instance and @name
*
* Returns: the function pointer for @name or %NULL
* Returns: (nullable): the function pointer for @name or %NULL
*
* Since: 1.18
*/
@ -1095,6 +1095,7 @@ gst_vulkan_instance_get_proc_address (GstVulkanInstance * instance,
/**
* gst_vulkan_instance_create_device:
* @instance: a #GstVulkanInstance
* @error: (optional): a #GError
*
* Returns: (transfer full): a new #GstVulkanDevice
*

View file

@ -97,7 +97,7 @@ gst_vulkan_queue_dispose (GObject * object)
* gst_vulkan_queue_get_device
* @queue: a #GstVulkanQueue
*
* Returns: (transfer full): the #GstVulkanDevice for @queue
* Returns: (transfer full) (nullable): the #GstVulkanDevice for @queue
*
* Since: 1.18
*/
@ -112,7 +112,7 @@ gst_vulkan_queue_get_device (GstVulkanQueue * queue)
/**
* gst_vulkan_queue_create_command_pool:
* @queue: a #GstVulkanQueue
* @error: a #GError
* @error: (optional): a #GError
*
* Returns: (transfer full): a new #GstVUlkanCommandPool or %NULL
*

View file

@ -489,7 +489,7 @@ gst_vulkan_get_or_create_image_view (GstVulkanImageMemory * image)
* @device: a #GstVulkanDevice
* @code: the SPIR-V shader byte code
* @size: length of @code. Must be a multiple of 4
* @error: a #GError to fill on failure
* @error: (optional): a #GError to fill on failure
*
* Returns: (transfer full): a #GstVulkanHandle for @image matching the
* original layout and format of @image or %NULL

View file

@ -65,7 +65,7 @@ gst_vulkan_display_ios_finalize (GObject * object)
*
* Create a new #GstVulkanDisplayIos.
*
* Returns: (transfer full): a new #GstVulkanDisplayIos or %NULL
* Returns: (transfer full): a new #GstVulkanDisplayIos
*/
GstVulkanDisplayIos *
gst_vulkan_display_ios_new (void)

View file

@ -105,12 +105,12 @@ gst_vulkan_display_wayland_finalize (GObject * object)
/**
* gst_vulkan_display_wayland_new:
* @name: (allow-none): a display name
* @name: (nullable): a display name
*
* Create a new #GstVulkanDisplayWayland from the wayland display name. See `wl_display_connect`()
* for details on what is a valid name.
*
* Returns: (transfer full): a new #GstVulkanDisplayWayland or %NULL
* Returns: (transfer full) (nullable): a new #GstVulkanDisplayWayland or %NULL
*
* Since: 1.18
*/
@ -118,17 +118,20 @@ GstVulkanDisplayWayland *
gst_vulkan_display_wayland_new (const gchar * name)
{
GstVulkanDisplayWayland *ret;
struct wl_display *display;
ret = g_object_new (GST_TYPE_VULKAN_DISPLAY_WAYLAND, NULL);
gst_object_ref_sink (ret);
ret->display = wl_display_connect (name);
display = wl_display_connect (name);
if (!ret->display) {
if (!display) {
GST_ERROR ("Failed to open Wayland display connection with name, \'%s\'",
name);
return NULL;
}
ret = g_object_new (GST_TYPE_VULKAN_DISPLAY_WAYLAND, NULL);
gst_object_ref_sink (ret);
ret->display = display;
/* connecting the listeners after attaching the event source will race with
* the source and the source may eat an event that we're waiting for and
* deadlock */

View file

@ -82,12 +82,12 @@ _get_screen_from_connection (xcb_connection_t * connection, int screen_no)
/**
* gst_vulkan_display_xcb_new:
* @name: (allow-none): a display name
* @name: (nullable): a display name
*
* Create a new #GstVulkanDisplayXCB from the xcb display name. See XOpenDisplay\()
* for details on what is a valid name.
*
* Returns: (transfer full): a new #GstVulkanDisplayXCB or %NULL
* Returns: (transfer full) (nullable): a new #GstVulkanDisplayXCB or %NULL
*
* Since: 1.18
*/