mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
vkencoder-private: rename GstVulkanEncoderPicture
GstVulkanEncodePicture breaks the namespace. This commit fixes it by renaming it to GstVulkanEncoderPicture, also new() and free() signature functions. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
This commit is contained in:
parent
a830c58139
commit
cf9cc5ec1b
4 changed files with 35 additions and 35 deletions
|
@ -374,7 +374,7 @@ gst_vulkan_encoder_new_video_session_parameters (GstVulkanEncoder * self,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_vulkan_encode_picture_new:
|
* gst_vulkan_encoder_picture_new:
|
||||||
* @self: the #GstVulkanEncoder with the pool's configuration.
|
* @self: the #GstVulkanEncoder with the pool's configuration.
|
||||||
* @in_buffer: (transfer none): the input #GstBuffer.
|
* @in_buffer: (transfer none): the input #GstBuffer.
|
||||||
* @width: the picture width
|
* @width: the picture width
|
||||||
|
@ -384,14 +384,14 @@ gst_vulkan_encoder_new_video_session_parameters (GstVulkanEncoder * self,
|
||||||
*
|
*
|
||||||
* Create a new vulkan encode picture from the input buffer.
|
* Create a new vulkan encode picture from the input buffer.
|
||||||
*
|
*
|
||||||
* Returns: a new #GstVulkanEncodePicture.
|
* Returns: a new #GstVulkanEncoderPicture.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
GstVulkanEncodePicture *
|
GstVulkanEncoderPicture *
|
||||||
gst_vulkan_encode_picture_new (GstVulkanEncoder * self, GstBuffer * in_buffer,
|
gst_vulkan_encoder_picture_new (GstVulkanEncoder * self, GstBuffer * in_buffer,
|
||||||
int width, int height, gboolean is_ref, gint nb_refs)
|
int width, int height, gboolean is_ref, gint nb_refs)
|
||||||
{
|
{
|
||||||
GstVulkanEncodePicture *pic;
|
GstVulkanEncoderPicture *pic;
|
||||||
GstVulkanEncoderPrivate *priv;
|
GstVulkanEncoderPrivate *priv;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_VULKAN_ENCODER (self), NULL);
|
g_return_val_if_fail (GST_IS_VULKAN_ENCODER (self), NULL);
|
||||||
|
@ -399,7 +399,7 @@ gst_vulkan_encode_picture_new (GstVulkanEncoder * self, GstBuffer * in_buffer,
|
||||||
|
|
||||||
priv = gst_vulkan_encoder_get_instance_private (self);
|
priv = gst_vulkan_encoder_get_instance_private (self);
|
||||||
|
|
||||||
pic = g_new0 (GstVulkanEncodePicture, 1);
|
pic = g_new0 (GstVulkanEncoderPicture, 1);
|
||||||
|
|
||||||
if (priv->layered_dpb) {
|
if (priv->layered_dpb) {
|
||||||
g_assert (priv->layered_buffer);
|
g_assert (priv->layered_buffer);
|
||||||
|
@ -411,7 +411,7 @@ gst_vulkan_encode_picture_new (GstVulkanEncoder * self, GstBuffer * in_buffer,
|
||||||
ret =
|
ret =
|
||||||
gst_buffer_pool_acquire_buffer (priv->dpb_pool, &pic->dpb_buffer, NULL);
|
gst_buffer_pool_acquire_buffer (priv->dpb_pool, &pic->dpb_buffer, NULL);
|
||||||
if (ret != GST_FLOW_OK) {
|
if (ret != GST_FLOW_OK) {
|
||||||
gst_vulkan_encode_picture_free (pic);
|
gst_vulkan_encoder_picture_free (pic);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -441,14 +441,14 @@ gst_vulkan_encode_picture_new (GstVulkanEncoder * self, GstBuffer * in_buffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_vulkan_encode_picture_free:
|
* gst_vulkan_encoder_picture_free:
|
||||||
* @pic: the #GstVulkanEncodePicture to free.
|
* @pic: the #GstVulkanEncoderPicture to free.
|
||||||
*
|
*
|
||||||
* Free the #GstVulkanEncodePicture.
|
* Free the #GstVulkanEncoderPicture.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_vulkan_encode_picture_free (GstVulkanEncodePicture * pic)
|
gst_vulkan_encoder_picture_free (GstVulkanEncoderPicture * pic)
|
||||||
{
|
{
|
||||||
g_return_if_fail (pic != NULL);
|
g_return_if_fail (pic != NULL);
|
||||||
|
|
||||||
|
@ -1026,8 +1026,8 @@ bail:
|
||||||
/**
|
/**
|
||||||
* gst_vulkan_encoder_encode:
|
* gst_vulkan_encoder_encode:
|
||||||
* @self: a #GstVulkanEncoder
|
* @self: a #GstVulkanEncoder
|
||||||
* @pic: a #GstVulkanEncodePicture
|
* @pic: a #GstVulkanEncoderPicture
|
||||||
* @ref_pics: an array of #GstVulkanEncodePicture
|
* @ref_pics: an array of #GstVulkanEncoderPicture
|
||||||
*
|
*
|
||||||
* Encode a picture according to its reference pictures.
|
* Encode a picture according to its reference pictures.
|
||||||
*
|
*
|
||||||
|
@ -1036,7 +1036,7 @@ bail:
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_vulkan_encoder_encode (GstVulkanEncoder * self,
|
gst_vulkan_encoder_encode (GstVulkanEncoder * self,
|
||||||
GstVulkanEncodePicture * pic, GstVulkanEncodePicture ** ref_pics)
|
GstVulkanEncoderPicture * pic, GstVulkanEncoderPicture ** ref_pics)
|
||||||
{
|
{
|
||||||
GstVulkanEncoderPrivate *priv;
|
GstVulkanEncoderPrivate *priv;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
|
|
|
@ -36,10 +36,10 @@ typedef struct _GstVulkanEncoderClass GstVulkanEncoderClass;
|
||||||
typedef union _GstVulkanEncoderParameters GstVulkanEncoderParameters;
|
typedef union _GstVulkanEncoderParameters GstVulkanEncoderParameters;
|
||||||
typedef union _GstVulkanEncoderParametersOverrides GstVulkanEncoderParametersOverrides;
|
typedef union _GstVulkanEncoderParametersOverrides GstVulkanEncoderParametersOverrides;
|
||||||
typedef union _GstVulkanEncoderParametersFeedback GstVulkanEncoderParametersFeedback;
|
typedef union _GstVulkanEncoderParametersFeedback GstVulkanEncoderParametersFeedback;
|
||||||
typedef struct _GstVulkanEncodePicture GstVulkanEncodePicture;
|
typedef struct _GstVulkanEncoderPicture GstVulkanEncoderPicture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstVulkanEncodePicture:
|
* GstVulkanEncoderPicture:
|
||||||
* @is_ref: picture is reference
|
* @is_ref: picture is reference
|
||||||
* @nb_refs: number of references
|
* @nb_refs: number of references
|
||||||
* @slotIndex: slot index
|
* @slotIndex: slot index
|
||||||
|
@ -57,7 +57,7 @@ typedef struct _GstVulkanEncodePicture GstVulkanEncodePicture;
|
||||||
*
|
*
|
||||||
* Since: 1.24
|
* Since: 1.24
|
||||||
*/
|
*/
|
||||||
struct _GstVulkanEncodePicture
|
struct _GstVulkanEncoderPicture
|
||||||
{
|
{
|
||||||
gboolean is_ref;
|
gboolean is_ref;
|
||||||
gint nb_refs;
|
gint nb_refs;
|
||||||
|
@ -175,19 +175,19 @@ gboolean gst_vulkan_encoder_create_dpb_pool (GstVulkanEncode
|
||||||
GstCaps * caps);
|
GstCaps * caps);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
gboolean gst_vulkan_encoder_encode (GstVulkanEncoder * self,
|
gboolean gst_vulkan_encoder_encode (GstVulkanEncoder * self,
|
||||||
GstVulkanEncodePicture * pic,
|
GstVulkanEncoderPicture * pic,
|
||||||
GstVulkanEncodePicture ** ref_pics);
|
GstVulkanEncoderPicture ** ref_pics);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
gboolean gst_vulkan_encoder_caps (GstVulkanEncoder * self,
|
gboolean gst_vulkan_encoder_caps (GstVulkanEncoder * self,
|
||||||
GstVulkanVideoCapabilities * caps);
|
GstVulkanVideoCapabilities * caps);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
GstCaps * gst_vulkan_encoder_profile_caps (GstVulkanEncoder * self);
|
GstCaps * gst_vulkan_encoder_profile_caps (GstVulkanEncoder * self);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
GstVulkanEncodePicture * gst_vulkan_encode_picture_new (GstVulkanEncoder * self,
|
GstVulkanEncoderPicture* gst_vulkan_encoder_picture_new (GstVulkanEncoder * self,
|
||||||
GstBuffer * in_buffer,
|
GstBuffer * in_buffer,
|
||||||
gint width,
|
gint width,
|
||||||
gint height,
|
gint height,
|
||||||
gboolean is_ref,
|
gboolean is_ref,
|
||||||
gint nb_refs);
|
gint nb_refs);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
void gst_vulkan_encode_picture_free (GstVulkanEncodePicture * pic);
|
void gst_vulkan_encoder_picture_free (GstVulkanEncoderPicture * pic);
|
||||||
|
|
|
@ -45,7 +45,7 @@ static GstVideoInfo out_info;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GstVulkanEncodePicture *picture;
|
GstVulkanEncoderPicture *picture;
|
||||||
|
|
||||||
VkVideoEncodeH264NaluSliceInfoKHR slice_info;
|
VkVideoEncodeH264NaluSliceInfoKHR slice_info;
|
||||||
VkVideoEncodeH264PictureInfoKHR enc_pic_info;
|
VkVideoEncodeH264PictureInfoKHR enc_pic_info;
|
||||||
|
@ -61,7 +61,7 @@ typedef struct
|
||||||
} GstVulkanH264EncodeFrame;
|
} GstVulkanH264EncodeFrame;
|
||||||
|
|
||||||
static GstVulkanH264EncodeFrame *
|
static GstVulkanH264EncodeFrame *
|
||||||
_h264_encode_frame_new (GstVulkanEncodePicture * picture)
|
_h264_encode_frame_new (GstVulkanEncoderPicture * picture)
|
||||||
{
|
{
|
||||||
GstVulkanH264EncodeFrame *frame;
|
GstVulkanH264EncodeFrame *frame;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ static void
|
||||||
_h264_encode_frame_free (gpointer pframe)
|
_h264_encode_frame_free (gpointer pframe)
|
||||||
{
|
{
|
||||||
GstVulkanH264EncodeFrame *frame = pframe;
|
GstVulkanH264EncodeFrame *frame = pframe;
|
||||||
g_clear_pointer (&frame->picture, gst_vulkan_encode_picture_free);
|
g_clear_pointer (&frame->picture, gst_vulkan_encoder_picture_free);
|
||||||
g_free (frame);
|
g_free (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,8 +356,8 @@ allocate_frame (GstVulkanEncoder * enc, int width,
|
||||||
|
|
||||||
upload_buffer_to_image(img_pool, in_buffer, &img_buffer);
|
upload_buffer_to_image(img_pool, in_buffer, &img_buffer);
|
||||||
|
|
||||||
frame = _h264_encode_frame_new (gst_vulkan_encode_picture_new (enc, img_buffer, width, height, is_ref,
|
frame = _h264_encode_frame_new (gst_vulkan_encoder_picture_new (enc,
|
||||||
nb_refs));
|
img_buffer, width, height, is_ref, nb_refs));
|
||||||
fail_unless (frame);
|
fail_unless (frame);
|
||||||
fail_unless (frame->picture);
|
fail_unless (frame->picture);
|
||||||
gst_buffer_unref (in_buffer);
|
gst_buffer_unref (in_buffer);
|
||||||
|
@ -378,11 +378,11 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH264EncodeFrame * frame,
|
||||||
{
|
{
|
||||||
GstVulkanVideoCapabilities enc_caps;
|
GstVulkanVideoCapabilities enc_caps;
|
||||||
int i, ref_pics_num = 0;
|
int i, ref_pics_num = 0;
|
||||||
GstVulkanEncodePicture *ref_pics[16] = { NULL, };
|
GstVulkanEncoderPicture *ref_pics[16] = { NULL, };
|
||||||
guint qp_i = 26;
|
guint qp_i = 26;
|
||||||
guint qp_p = 26;
|
guint qp_p = 26;
|
||||||
guint qp_b = 26;
|
guint qp_b = 26;
|
||||||
GstVulkanEncodePicture *picture = frame->picture;
|
GstVulkanEncoderPicture *picture = frame->picture;
|
||||||
|
|
||||||
GST_DEBUG ("Encoding frame num:%d", frame_num);
|
GST_DEBUG ("Encoding frame num:%d", frame_num);
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ static GstVideoInfo in_info;
|
||||||
static GstVideoInfo out_info;
|
static GstVideoInfo out_info;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GstVulkanEncodePicture *picture;
|
GstVulkanEncoderPicture *picture;
|
||||||
|
|
||||||
VkVideoEncodeH265PictureInfoKHR enc_pic_info;
|
VkVideoEncodeH265PictureInfoKHR enc_pic_info;
|
||||||
VkVideoEncodeH265NaluSliceSegmentInfoKHR slice_info;
|
VkVideoEncodeH265NaluSliceSegmentInfoKHR slice_info;
|
||||||
|
@ -66,7 +66,7 @@ typedef struct
|
||||||
|
|
||||||
|
|
||||||
static GstVulkanH265EncodeFrame *
|
static GstVulkanH265EncodeFrame *
|
||||||
_h265_encode_frame_new (GstVulkanEncodePicture * picture)
|
_h265_encode_frame_new (GstVulkanEncoderPicture * picture)
|
||||||
{
|
{
|
||||||
GstVulkanH265EncodeFrame *frame;
|
GstVulkanH265EncodeFrame *frame;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ static void
|
||||||
_h265_encode_frame_free (gpointer pframe)
|
_h265_encode_frame_free (gpointer pframe)
|
||||||
{
|
{
|
||||||
GstVulkanH265EncodeFrame *frame = pframe;
|
GstVulkanH265EncodeFrame *frame = pframe;
|
||||||
g_clear_pointer (&frame->picture, gst_vulkan_encode_picture_free);
|
g_clear_pointer (&frame->picture, gst_vulkan_encoder_picture_free);
|
||||||
g_free (frame);
|
g_free (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,8 +364,8 @@ allocate_frame (GstVulkanEncoder * enc, int width,
|
||||||
upload_buffer_to_image(img_pool, in_buffer, &img_buffer);
|
upload_buffer_to_image(img_pool, in_buffer, &img_buffer);
|
||||||
|
|
||||||
|
|
||||||
frame = _h265_encode_frame_new (gst_vulkan_encode_picture_new (enc, img_buffer, width, height, is_ref,
|
frame = _h265_encode_frame_new (gst_vulkan_encoder_picture_new (enc,
|
||||||
nb_refs));
|
img_buffer, width, height, is_ref, nb_refs));
|
||||||
fail_unless (frame);
|
fail_unless (frame);
|
||||||
fail_unless (frame->picture);
|
fail_unless (frame->picture);
|
||||||
gst_buffer_unref (in_buffer);
|
gst_buffer_unref (in_buffer);
|
||||||
|
@ -390,12 +390,12 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH265EncodeFrame * frame,
|
||||||
{
|
{
|
||||||
GstVulkanVideoCapabilities enc_caps;
|
GstVulkanVideoCapabilities enc_caps;
|
||||||
int i, ref_pics_num = 0;
|
int i, ref_pics_num = 0;
|
||||||
GstVulkanEncodePicture *ref_pics[16] = { NULL, };
|
GstVulkanEncoderPicture *ref_pics[16] = { NULL, };
|
||||||
gint16 delta_poc_s0_minus1 = 0, delta_poc_s1_minus1 = 0;
|
gint16 delta_poc_s0_minus1 = 0, delta_poc_s1_minus1 = 0;
|
||||||
guint qp_i = 26;
|
guint qp_i = 26;
|
||||||
guint qp_p = 26;
|
guint qp_p = 26;
|
||||||
guint qp_b = 26;
|
guint qp_b = 26;
|
||||||
GstVulkanEncodePicture *picture = frame->picture;
|
GstVulkanEncoderPicture *picture = frame->picture;
|
||||||
gint picture_type = PICTURE_TYPE(slice_type, picture->is_ref);
|
gint picture_type = PICTURE_TYPE(slice_type, picture->is_ref);
|
||||||
|
|
||||||
GST_DEBUG ("Encoding frame num: %d", frame_num);
|
GST_DEBUG ("Encoding frame num: %d", frame_num);
|
||||||
|
|
Loading…
Reference in a new issue