From 38f1a4ee3da82dc279d732a4ada2ad2875e011fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 20 Sep 2022 19:11:35 +0200 Subject: [PATCH] vaencoder: Add gst_va_encoder_get_reconstruct_pool_config() This method will return the caps configured in the reconstruct buffer pool, and its maxium number of buffers to allocate. The caps are needed later to know if the internal encoder has to be reopened if the stream properties change. Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvaencoder.c | 22 ++++++++++++++++++++++ subprojects/gst-plugins-bad/sys/va/gstvaencoder.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c index db836e2..3e0c2b3 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c @@ -535,6 +535,28 @@ gst_va_encoder_new (GstVaDisplay * display, guint32 codec, } gboolean +gst_va_encoder_get_reconstruct_pool_config (GstVaEncoder * self, + GstCaps ** caps, guint * max_surfaces) +{ + GstStructure *config; + gboolean ret; + + g_return_val_if_fail (GST_IS_VA_ENCODER (self), FALSE); + + if (!gst_va_encoder_is_open (self)) + return FALSE; + + if (!self->recon_pool) + return FALSE; + + config = gst_buffer_pool_get_config (self->recon_pool); + ret = gst_buffer_pool_config_get_params (config, caps, NULL, NULL, + max_surfaces); + gst_structure_free (config); + return ret; +} + +gboolean gst_va_encoder_has_profile (GstVaEncoder * self, VAProfile profile) { VAProfile p; diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.h b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.h index 2152f0b..9def532 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.h +++ b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.h @@ -56,6 +56,9 @@ gboolean gst_va_encoder_open (GstVaEncoder * self, guint rc_ctrl, guint32 packed_headers); gboolean gst_va_encoder_close (GstVaEncoder * self); +gboolean gst_va_encoder_get_reconstruct_pool_config (GstVaEncoder * self, + GstCaps ** caps, + guint * max_surfaces); gboolean gst_va_encoder_has_profile (GstVaEncoder * self, VAProfile profile); gint gst_va_encoder_get_max_slice_num (GstVaEncoder * self, -- 2.7.4