vkvideoutils-private: make it private

Since we moved the GstVulkan generic decoder and encoder to private objects in
the library, there was not need to keep vkvideoutils public.

This patch turns it private and reduces the public API surface.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9493>
This commit is contained in:
Víctor Manuel Jáquez Leal 2025-08-04 16:56:56 +02:00 committed by GStreamer Marge Bot
parent 8162ba6338
commit 573f401e58
13 changed files with 21 additions and 213 deletions

View File

@ -11,6 +11,6 @@ variables:
CHECKS_TAG: '2025-05-24.0'
ABI_CHECK_TAG: '2025-07-17.0'
ABI_CHECK_TAG: '2025-08-05.0'
WINDOWS_TAG: '2025-07-03.0'

View File

@ -6039,50 +6039,6 @@ signalled and freed.</doc>
</parameter>
</parameters>
</callback>
<record name="VulkanVideoCapabilities" c:type="GstVulkanVideoCapabilities" version="1.24">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="caps" introspectable="0" readable="0" private="1">
<type c:type="VkVideoCapabilitiesKHR"/>
</field>
<union>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<record name="decoder" c:type="decoder">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="caps" introspectable="0" readable="0" private="1">
<type c:type="VkVideoDecodeCapabilitiesKHR"/>
</field>
<union name="codec" c:type="codec">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="h264" introspectable="0" readable="0" private="1">
<type c:type="VkVideoDecodeH264CapabilitiesKHR"/>
</field>
<field name="h265" introspectable="0" readable="0" private="1">
<type c:type="VkVideoDecodeH265CapabilitiesKHR"/>
</field>
</union>
</record>
<record name="encoder" c:type="encoder">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="caps" introspectable="0" readable="0" private="1">
<type c:type="VkVideoEncodeCapabilitiesKHR"/>
</field>
<union name="codec" c:type="codec">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="h264" introspectable="0" readable="0" private="1">
<type c:type="VkVideoEncodeH264CapabilitiesKHR"/>
</field>
<field name="h265" introspectable="0" readable="0" private="1">
<type c:type="VkVideoEncodeH265CapabilitiesKHR"/>
</field>
</union>
</record>
</union>
<field name="_reserved" readable="0" private="1">
<array zero-terminated="0" fixed-size="4">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</record>
<class name="VulkanVideoFilter" c:symbol-prefix="vulkan_video_filter" c:type="GstVulkanVideoFilter" version="1.18" parent="GstBase.BaseTransform" glib:type-name="GstVulkanVideoFilter" glib:get-type="gst_vulkan_video_filter_get_type" glib:type-struct="VulkanVideoFilterClass">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideofilter.h"/>
<method name="get_device" c:identifier="gst_vulkan_video_filter_get_device" version="1.26">
@ -6177,125 +6133,6 @@ signalled and freed.</doc>
</array>
</field>
</record>
<enumeration name="VulkanVideoOperation" version="1.24" glib:type-name="GstVulkanVideoOperation" glib:get-type="gst_vulkan_video_operation_get_type" c:type="GstVulkanVideoOperation">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h">The type of video operation.</doc>
<member name="decode" value="0" c:identifier="GST_VULKAN_VIDEO_OPERATION_DECODE" glib:nick="decode" glib:name="GST_VULKAN_VIDEO_OPERATION_DECODE">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h">decode operation</doc>
</member>
<member name="encode" value="1" c:identifier="GST_VULKAN_VIDEO_OPERATION_ENCODE" glib:nick="encode" glib:name="GST_VULKAN_VIDEO_OPERATION_ENCODE">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h">encode operation</doc>
</member>
<member name="unknown" value="2" c:identifier="GST_VULKAN_VIDEO_OPERATION_UNKNOWN" glib:nick="unknown" glib:name="GST_VULKAN_VIDEO_OPERATION_UNKNOWN">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h">unknown</doc>
</member>
</enumeration>
<record name="VulkanVideoProfile" c:type="GstVulkanVideoProfile" version="1.24">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="profile" introspectable="0" readable="0" private="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h">the generic vulkan video profile</doc>
<type c:type="VkVideoProfileInfoKHR"/>
</field>
<union name="usage" c:type="usage">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="decode" introspectable="0" writable="1">
<type c:type="VkVideoDecodeUsageInfoKHR"/>
</field>
<field name="encode" introspectable="0" writable="1">
<type c:type="VkVideoEncodeUsageInfoKHR"/>
</field>
</union>
<union name="codec" c:type="codec">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<field name="base" writable="1">
<type name="Vulkan.BaseInStructure" c:type="VkBaseInStructure"/>
</field>
<field name="h264dec" introspectable="0" writable="1">
<type c:type="VkVideoDecodeH264ProfileInfoKHR"/>
</field>
<field name="h265dec" introspectable="0" writable="1">
<type c:type="VkVideoDecodeH265ProfileInfoKHR"/>
</field>
<field name="h264enc" introspectable="0" writable="1">
<type c:type="VkVideoEncodeH264ProfileInfoKHR"/>
</field>
<field name="h265enc" introspectable="0" writable="1">
<type c:type="VkVideoEncodeH265ProfileInfoKHR"/>
</field>
</union>
<field name="_reserved" writable="1">
<array zero-terminated="0" fixed-size="4">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
<method name="is_equal" c:identifier="gst_vulkan_video_profile_is_equal">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">whether @a and @b contains the same information.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="a" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">a #GstVulkanVideoProfile</doc>
<type name="VulkanVideoProfile" c:type="const GstVulkanVideoProfile*"/>
</instance-parameter>
<parameter name="b" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">another #GstVulkanVideoProfile</doc>
<type name="VulkanVideoProfile" c:type="const GstVulkanVideoProfile*"/>
</parameter>
</parameters>
</method>
<method name="is_valid" c:identifier="gst_vulkan_video_profile_is_valid" version="1.24" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">%TRUE if @profile is correct and matches with @codec</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="profile" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">the output profile</doc>
<type name="VulkanVideoProfile" c:type="GstVulkanVideoProfile*"/>
</instance-parameter>
<parameter name="codec" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">VkVideoCodecOperationFlagBitsKHR described by @profile</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</method>
<method name="to_caps" c:identifier="gst_vulkan_video_profile_to_caps" version="1.24" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">a #GstCaps from @profile</doc>
<type name="Gst.Caps" c:type="GstCaps*"/>
</return-value>
<parameters>
<instance-parameter name="profile" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">#GstVulkanVideoProfile to convert into a #GstCaps</doc>
<type name="VulkanVideoProfile" c:type="const GstVulkanVideoProfile*"/>
</instance-parameter>
</parameters>
</method>
<function name="from_caps" c:identifier="gst_vulkan_video_profile_from_caps" version="1.24" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">%TRUE if @caps was parsed correctly, otherwise %FALSE</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="profile" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">the output profile</doc>
<type name="VulkanVideoProfile" c:type="GstVulkanVideoProfile*"/>
</parameter>
<parameter name="caps" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">a #GstCaps to parse</doc>
<type name="Gst.Caps" c:type="GstCaps*"/>
</parameter>
<parameter name="video_operation" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">a supported video operation</doc>
<type name="VulkanVideoOperation" c:type="GstVulkanVideoOperation"/>
</parameter>
</parameters>
</function>
</record>
<class name="VulkanWindow" c:symbol-prefix="vulkan_window" c:type="GstVulkanWindow" version="1.18" parent="Gst.Object" abstract="1" glib:type-name="GstVulkanWindow" glib:get-type="gst_vulkan_window_get_type" glib:type-struct="VulkanWindowClass">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkwindow.h">#GstVulkanWindow is an opaque struct and should only be accessed through the
provided api.</doc>
@ -7917,27 +7754,6 @@ associated #GstVulkanFence is signalled</doc>
</parameter>
</parameters>
</function>
<function name="vulkan_video_profile_from_caps" c:identifier="gst_vulkan_video_profile_from_caps" moved-to="VulkanVideoProfile.from_caps" version="1.24" introspectable="0">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">%TRUE if @caps was parsed correctly, otherwise %FALSE</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="profile" direction="out" caller-allocates="1" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">the output profile</doc>
<type name="VulkanVideoProfile" c:type="GstVulkanVideoProfile*"/>
</parameter>
<parameter name="caps" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">a #GstCaps to parse</doc>
<type name="Gst.Caps" c:type="GstCaps*"/>
</parameter>
<parameter name="video_operation" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c">a supported video operation</doc>
<type name="VulkanVideoOperation" c:type="GstVulkanVideoOperation"/>
</parameter>
</parameters>
</function>
<function name="vulkan_window_error_quark" c:identifier="gst_vulkan_window_error_quark" moved-to="VulkanWindowError.quark" version="1.18">
<return-value transfer-ownership="none">
<type name="GLib.Quark" c:type="GQuark"/>

View File

@ -21,6 +21,7 @@
#pragma once
#include <gst/vulkan/gstvkqueue.h>
#include "gstvkvideoutils-private.h"
G_BEGIN_DECLS

View File

@ -21,6 +21,7 @@
#pragma once
#include <gst/vulkan/vulkan.h>
#include "gstvkvideoutils-private.h"
#define GST_TYPE_VULKAN_ENCODER (gst_vulkan_encoder_get_type())
#define GST_VULKAN_ENCODER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_ENCODER, GstVulkanEncoder))

View File

@ -24,6 +24,10 @@
#include "gstvkimagebufferpool.h"
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
#include "gst/vulkan/gstvkvideoutils-private.h"
#endif
/**
* SECTION:vkimagebufferpool
* @title: GstVulkanImageBufferPool
@ -54,8 +58,10 @@ struct _GstVulkanImageBufferPoolPrivate
VkFormat vk_fmts[GST_VIDEO_MAX_PLANES];
int n_imgs;
guint32 n_layers;
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
guint32 n_profiles;
GstVulkanVideoProfile profiles[2];
#endif
GstVulkanOperation *exec;
gboolean add_videometa;
};

View File

@ -22,7 +22,7 @@
#include <gst/gst.h>
#include <gst/vulkan/gstvkapi.h>
#include <gst/vulkan/gstvkvideoutils.h>
#include "gstvkvideoutils-private.h"
G_BEGIN_DECLS

View File

@ -22,9 +22,8 @@
#include "config.h"
#endif
#include "gstvkvideoutils.h"
#include "gstvkvideoutils-private.h"
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
/* *INDENT-OFF* */
static const struct {
GstVulkanVideoOperation video_operation;
@ -94,7 +93,6 @@ static const struct {
};
/* *INDENT-ON* */
#endif
/**
* gst_vulkan_video_profile_to_caps: (skip)
@ -107,7 +105,6 @@ static const struct {
GstCaps *
gst_vulkan_video_profile_to_caps (const GstVulkanVideoProfile * profile)
{
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
const char *mime = NULL, *chroma_sub = NULL;
const char *profile_str = NULL, *layout = NULL;
int i, luma = 0, chroma = 0;
@ -218,9 +215,6 @@ gst_vulkan_video_profile_to_caps (const GstVulkanVideoProfile * profile)
gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING, layout, NULL);
return caps;
#endif
return NULL;
}
/**
@ -237,7 +231,6 @@ gboolean
gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
GstCaps * caps, GstVulkanVideoOperation video_operation)
{
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
const GstStructure *structure;
const gchar *mime, *chroma_sub, *profile_str = NULL, *layout = NULL;
gint i, luma, chroma;
@ -386,7 +379,6 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
}
if (i == G_N_ELEMENTS (bit_depth_map))
return FALSE;
#endif
return TRUE;
}
@ -402,7 +394,6 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
gboolean
gst_vulkan_video_profile_is_valid (GstVulkanVideoProfile * profile, guint codec)
{
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
int i;
VkVideoCodecOperationFlagBitsKHR op = codec;
VkStructureType stype = VK_STRUCTURE_TYPE_MAX_ENUM;
@ -427,9 +418,6 @@ gst_vulkan_video_profile_is_valid (GstVulkanVideoProfile * profile, guint codec)
return FALSE;
return TRUE;
#endif
return FALSE;
}
/**
@ -443,7 +431,6 @@ gboolean
gst_vulkan_video_profile_is_equal (const GstVulkanVideoProfile * a,
const GstVulkanVideoProfile * b)
{
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
gboolean profile;
g_return_val_if_fail (a && b, FALSE);
@ -468,7 +455,4 @@ gst_vulkan_video_profile_is_equal (const GstVulkanVideoProfile * a,
}
g_assert_not_reached ();
#else
return FALSE;
#endif
}

View File

@ -25,6 +25,9 @@
G_BEGIN_DECLS
typedef struct _GstVulkanVideoProfile GstVulkanVideoProfile;
typedef struct _GstVulkanVideoCapabilities GstVulkanVideoCapabilities;
/**
* GstVulkanVideoProfile:
* @profile: the generic vulkan video profile
@ -35,7 +38,6 @@ G_BEGIN_DECLS
struct _GstVulkanVideoProfile
{
/*< private >*/
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
VkVideoProfileInfoKHR profile;
union {
VkVideoDecodeUsageInfoKHR decode;
@ -64,7 +66,6 @@ struct _GstVulkanVideoProfile
**/
VkVideoEncodeH265ProfileInfoKHR h265enc;
} codec;
#endif
gpointer _reserved[GST_PADDING];
};
@ -76,7 +77,6 @@ struct _GstVulkanVideoProfile
struct _GstVulkanVideoCapabilities
{
/*< private >*/
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
VkVideoCapabilitiesKHR caps;
union
{
@ -103,7 +103,6 @@ struct _GstVulkanVideoCapabilities
} codec;
} encoder;
};
#endif
/*< private >*/
gpointer _reserved[GST_PADDING];
};

View File

@ -35,7 +35,6 @@ vulkan_sources = files(
'gstvkswapper.c',
'gstvktrash.c',
'gstvkvideofilter.c',
'gstvkvideoutils.c',
'gstvkutils.c',
'gstvkwindow.c',
)
@ -71,7 +70,6 @@ vulkan_headers = files(
'gstvktrash.h',
'gstvkutils.h',
'gstvkvideofilter.h',
'gstvkvideoutils.h',
'gstvkwindow.h',
'vulkan-prelude.h',
'vulkan_fwd.h',
@ -346,6 +344,7 @@ static VkVideoEncodeH265ProfileInfoKHR h265_profile;
if have_vk_video
vulkan_conf.set('GST_VULKAN_HAVE_VIDEO_EXTENSIONS', 1)
vulkan_priv_sources += files(
'gstvkvideoutils-private.c',
'gstvkvideo-private.c',
'gstvkdecoder-private.c',
'gstvkencoder-private.c',

View File

@ -61,6 +61,5 @@
#include <gst/vulkan/gstvkoperation.h>
#include <gst/vulkan/gstvkutils.h>
#include <gst/vulkan/gstvkvideoutils.h>
#endif /* __GST_VULKAN_H__ */

View File

@ -112,8 +112,6 @@ typedef struct _GstVulkanFullScreenQuadClass GstVulkanFullScreenQuadClass;
typedef struct _GstVulkanFullScreenQuadPrivate GstVulkanFullScreenQuadPrivate;
typedef struct _GstVulkanQueueFamilyOps GstVulkanQueueFamilyOps;
typedef struct _GstVulkanVideoProfile GstVulkanVideoProfile;
typedef struct _GstVulkanVideoCapabilities GstVulkanVideoCapabilities;
typedef struct _GstVulkanOperation GstVulkanOperation;
typedef struct _GstVulkanOperationClass GstVulkanOperationClass;

View File

@ -26,6 +26,10 @@
#include <gst/check/gstcheck.h>
#include <gst/vulkan/vulkan.h>
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
#include "gst/vulkan/gstvkvideoutils-private.h"
#endif
static GstVulkanInstance *instance;
static GstVulkanDevice *device;
static GstVulkanQueue *queue = NULL;
@ -206,7 +210,7 @@ GST_START_TEST (test_decoding_image)
}
GST_END_TEST;
#endif
#endif /* GST_VULKAN_HAVE_VIDEO_EXTENSIONS */
static Suite *
vkimagebufferpool_suite (void)

View File

@ -27,6 +27,7 @@
#include <gst/vulkan/vulkan.h>
#include "gst/vulkan/gstvkdecoder-private.h"
#include "gst/vulkan/gstvkvideoutils-private.h"
static GstVulkanInstance *instance;
static GstVulkanDevice *device;