vkencoder-private: add gst_vulkan_encoder_is_started()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-08-20 20:43:42 +02:00 committed by GStreamer Marge Bot
parent 549404ccaa
commit 44b8a50879
4 changed files with 24 additions and 0 deletions

View file

@ -376,6 +376,24 @@ gst_vulkan_encoder_picture_clear (GstVulkanEncoderPicture * pic,
pic->dpb_view = NULL;
}
/**
* gst_vulkan_encoder_is_started:
* @self: a #GstVulkanEncoder
*
* Returns: whether gst_vulkan_encoder_start() was called correctly previously.
*/
gboolean
gst_vulkan_encoder_is_started (GstVulkanEncoder * self)
{
GstVulkanEncoderPrivate *priv;
g_return_val_if_fail (GST_IS_VULKAN_ENCODER (self), FALSE);
priv = gst_vulkan_encoder_get_instance_private (self);
return priv->started;
}
/**
* gst_vulkan_encoder_caps:
* @self: a #GstVulkanEncoder

View file

@ -204,6 +204,8 @@ GST_VULKAN_API
gboolean gst_vulkan_encoder_caps (GstVulkanEncoder * self,
GstVulkanVideoCapabilities * caps);
GST_VULKAN_API
gboolean gst_vulkan_encoder_is_started (GstVulkanEncoder * self);
GST_VULKAN_API
GstCaps * gst_vulkan_encoder_profile_caps (GstVulkanEncoder * self);
GST_VULKAN_API
gint32 gst_vulkan_encoder_quality_level (GstVulkanEncoder * self);

View file

@ -702,6 +702,8 @@ setup_h264_encoder (guint32 width, gint32 height, gint sps_id, gint pps_id)
fail_unless (gst_vulkan_encoder_quality_level (enc) > -1);
fail_unless (gst_vulkan_encoder_is_started (enc));
mbAlignedWidth = GST_ROUND_UP_16 (width);
mbAlignedHeight = GST_ROUND_UP_16 (height);

View file

@ -799,6 +799,8 @@ setup_h265_encoder (uint32_t width, uint32_t height, gint vps_id,
fail_unless (gst_vulkan_encoder_quality_level (enc) > -1);
fail_unless (gst_vulkan_encoder_is_started (enc));
fail_unless (gst_vulkan_encoder_caps (enc, &enc_caps));
if (enc_caps.encoder.codec.h265.ctbSizes