From: Víctor Manuel Jáquez Leal Date: Tue, 20 Sep 2022 17:11:35 +0000 (+0200) Subject: vaencoder: Add gst_va_encoder_get_reconstruct_pool_config() X-Git-Tag: 1.22.0~523 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38f1a4ee3da82dc279d732a4ada2ad2875e011fc;p=platform%2Fupstream%2Fgstreamer.git 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: --- 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,