gstvulkan: Expose gst_vulkan_result_to_string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1623>
This commit is contained in:
parent
5d70c168b3
commit
8987532cfc
@ -39,7 +39,7 @@ static const struct
|
|||||||
VkResult result;
|
VkResult result;
|
||||||
const char *str;
|
const char *str;
|
||||||
} vk_result_string_map[] = {
|
} vk_result_string_map[] = {
|
||||||
{VK_ERROR_OUT_OF_HOST_MEMORY, "Out Of host memory"},
|
{VK_ERROR_OUT_OF_HOST_MEMORY, "Out of host memory"},
|
||||||
{VK_ERROR_OUT_OF_DEVICE_MEMORY, "Out of device memory"},
|
{VK_ERROR_OUT_OF_DEVICE_MEMORY, "Out of device memory"},
|
||||||
{VK_ERROR_INITIALIZATION_FAILED, "Initialization failed"},
|
{VK_ERROR_INITIALIZATION_FAILED, "Initialization failed"},
|
||||||
{VK_ERROR_DEVICE_LOST, "Device lost"},
|
{VK_ERROR_DEVICE_LOST, "Device lost"},
|
||||||
@ -49,9 +49,9 @@ static const struct
|
|||||||
{VK_ERROR_FEATURE_NOT_PRESENT, "Feature not present"},
|
{VK_ERROR_FEATURE_NOT_PRESENT, "Feature not present"},
|
||||||
{VK_ERROR_INCOMPATIBLE_DRIVER, "Incompatible driver"},
|
{VK_ERROR_INCOMPATIBLE_DRIVER, "Incompatible driver"},
|
||||||
{VK_ERROR_TOO_MANY_OBJECTS, "Too many objects"},
|
{VK_ERROR_TOO_MANY_OBJECTS, "Too many objects"},
|
||||||
{VK_ERROR_FORMAT_NOT_SUPPORTED, "format not supported"},
|
{VK_ERROR_FORMAT_NOT_SUPPORTED, "Format not supported"},
|
||||||
{VK_ERROR_SURFACE_LOST_KHR, "Surface lost"},
|
{VK_ERROR_SURFACE_LOST_KHR, "Surface lost"},
|
||||||
{VK_ERROR_OUT_OF_DATE_KHR, "out of date"},
|
{VK_ERROR_OUT_OF_DATE_KHR, "Out of date"},
|
||||||
{VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, "Incompatible display"},
|
{VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, "Incompatible display"},
|
||||||
{VK_ERROR_NATIVE_WINDOW_IN_USE_KHR, "Native window in use"},
|
{VK_ERROR_NATIVE_WINDOW_IN_USE_KHR, "Native window in use"},
|
||||||
};
|
};
|
||||||
@ -63,8 +63,16 @@ gst_vulkan_error_quark (void)
|
|||||||
return g_quark_from_static_string ("gst-vulkan-error");
|
return g_quark_from_static_string ("gst-vulkan-error");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
/**
|
||||||
_vk_result_to_string (VkResult result)
|
* gst_vulkan_result_to_string: (skip)
|
||||||
|
* @result: a VkResult
|
||||||
|
*
|
||||||
|
* Returns: a message that corresponds to @result
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
const char *
|
||||||
|
gst_vulkan_result_to_string (VkResult result)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -105,7 +113,7 @@ gst_vulkan_error_to_g_error (VkResult result, GError ** error,
|
|||||||
/* we don't have an error to set */
|
/* we don't have an error to set */
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
result_str = _vk_result_to_string (result);
|
result_str = gst_vulkan_result_to_string (result);
|
||||||
if (result_str == NULL) {
|
if (result_str == NULL) {
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
result_str = "Unknown";
|
result_str = "Unknown";
|
||||||
|
@ -42,6 +42,9 @@ G_BEGIN_DECLS
|
|||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
GQuark gst_vulkan_error_quark (void);
|
GQuark gst_vulkan_error_quark (void);
|
||||||
|
|
||||||
|
GST_VULKAN_API
|
||||||
|
const char * gst_vulkan_result_to_string (VkResult result);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstVulkanError:
|
* GstVulkanError:
|
||||||
* @GST_VULKAN_FAILED: undetermined error
|
* @GST_VULKAN_FAILED: undetermined error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user