video: Give better names to buffer pools

Making debugging simpler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8617>
This commit is contained in:
Thibault Saunier 2025-03-10 13:14:07 -03:00 committed by GStreamer Marge Bot
parent 9979936703
commit ed693c7435
18 changed files with 142 additions and 2 deletions

View File

@ -946,6 +946,12 @@ gst_ffmpegviddec_ensure_internal_pool (GstFFMpegVidDec * ffmpegdec,
gst_object_unref (ffmpegdec->internal_pool);
ffmpegdec->internal_pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-internal-pool", GST_OBJECT_NAME (ffmpegdec));
g_object_set (ffmpegdec->internal_pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (ffmpegdec->internal_pool);
caps = gst_video_info_to_caps (&info);
@ -2509,6 +2515,12 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
if (max != 0 && max < REQUIRED_POOL_MAX_BUFFERS) {
gst_object_unref (pool);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-decide-pool", GST_OBJECT_NAME (ffmpegdec));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
max = 0;
update_pool = TRUE;
have_pool = FALSE;
@ -2607,6 +2619,12 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
if (!working_pool) {
gst_object_unref (pool);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-fallback-pool", GST_OBJECT_NAME (ffmpegdec));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, state->caps, size, min, max);
gst_buffer_pool_config_set_allocator (config, NULL, &params);

View File

@ -1454,6 +1454,12 @@ gst_svthevc_enc_set_format (GstVideoEncoder * video_enc,
caps = gst_video_info_to_caps (info);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-internal-pool", GST_OBJECT_NAME (encoder));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
size = GST_VIDEO_INFO_SIZE (info);
GST_INFO_OBJECT (encoder,
@ -1554,6 +1560,12 @@ gst_svthevc_enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query)
gst_query_add_allocation_param (query, allocator, &params);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-propose-pool", GST_OBJECT_NAME (svthevcenc));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);

View File

@ -416,6 +416,11 @@ gst_rfb_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
if (pool == NULL) {
/* we did not get a pool, make one ourselves then */
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (bsrc));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
size = info.size;
min = 1;
max = 0;

View File

@ -651,6 +651,11 @@ gst_y4m_dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
/* No pool, create our own if we need to do stride conversion */
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (y4mdec));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, y4mdec->out_info.size, 0,
0);

View File

@ -567,6 +567,11 @@ gst_cuda_memory_copy_propose_allocation (GstBaseTransform * trans,
if (!pool) {
GST_DEBUG_OBJECT (self, "creating system buffer pool");
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("cuda-memory-copy-upstream-pool");
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
config = gst_buffer_pool_get_config (pool);

View File

@ -90,6 +90,15 @@ gst_va_create_other_pool (GstAllocator * allocator,
}
pool = gst_video_buffer_pool_new ();
{
gchar *name;
if (allocator)
name = g_strdup_printf ("va-%s-pool", GST_OBJECT_NAME (allocator));
else
name = g_strdup ("va-video-pool");
g_object_set (pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);

View File

@ -987,6 +987,11 @@ default_decide_allocation (GstAudioVisualizer * scope, GstQuery * query)
if (pool == NULL) {
/* we did not get a pool, make one ourselves then */
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (scope));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
config = gst_buffer_pool_get_config (pool);

View File

@ -2780,8 +2780,14 @@ gst_video_aggregator_decide_allocation (GstAggregator * agg, GstQuery * query)
gst_query_parse_allocation (query, &caps, NULL);
/* no downstream pool, make our own */
if (pool == NULL)
if (pool == NULL) {
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (agg));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
config = gst_buffer_pool_get_config (pool);
@ -2802,6 +2808,12 @@ gst_video_aggregator_decide_allocation (GstAggregator * agg, GstQuery * query)
gst_object_unref (pool);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-fallback-pool", GST_OBJECT_NAME (agg));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_config_set_allocator (config, allocator, &params);

View File

@ -4261,6 +4261,11 @@ gst_video_decoder_decide_allocation_default (GstVideoDecoder * decoder,
/* no pool, we can make our own */
GST_DEBUG_OBJECT (decoder, "no pool, making new pool");
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (decoder));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
/* now configure */
@ -4281,6 +4286,12 @@ gst_video_decoder_decide_allocation_default (GstVideoDecoder * decoder,
gst_object_unref (pool);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-fallback-pool", GST_OBJECT_NAME (decoder));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
gst_buffer_pool_config_set_params (config, outcaps, size, min, max);
gst_buffer_pool_config_set_allocator (config, allocator, &params);
}

View File

@ -900,6 +900,12 @@ gst_video_encoder_propose_allocation_default (GstVideoEncoder * encoder,
gst_query_add_allocation_param (query, allocator, &params);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-propose-pool", GST_OBJECT_NAME (encoder));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
structure = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (structure, caps, size, 0, 0);

View File

@ -91,6 +91,12 @@ gst_video_filter_propose_allocation (GstBaseTransform * trans,
gst_query_add_allocation_param (query, allocator, &params);
pool = gst_video_buffer_pool_new ();
{
gchar *name =
g_strdup_printf ("%s-propose-pool", GST_OBJECT_NAME (filter));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
structure = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (structure, caps, size, 0, 0);
@ -147,8 +153,14 @@ gst_video_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
update_pool = FALSE;
}
if (!pool)
if (!pool) {
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-decide-pool", GST_OBJECT_NAME (trans));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);

View File

@ -1910,6 +1910,11 @@ _sink_query (GstAggregator * agg, GstAggregatorPad * bpad, GstQuery * query)
size = GST_VIDEO_INFO_SIZE (&info);
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (agg));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
structure = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (structure, caps, size, 0, 0);

View File

@ -983,6 +983,11 @@ gst_video_test_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
pool = gst_buffer_pool_new ();
else
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (videotestsrc));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
config = gst_buffer_pool_get_config (pool);

View File

@ -43,6 +43,11 @@ query_handler (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
gst_video_info_from_caps (&vinfo, caps);
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup ("theora-test-pool");
g_object_set (pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, vinfo.size, 0, 1);
gst_buffer_pool_set_config (pool, config);

View File

@ -278,6 +278,11 @@ gst_dvdec_negotiate_pool (GstDVDec * dec, GstCaps * caps, GstVideoInfo * info)
if (pool == NULL) {
/* we did not get a pool, make one ourselves then */
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (dec));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
if (dec->pool) {

View File

@ -2735,6 +2735,11 @@ gst_deinterlace_do_bufferpool (GstDeinterlace * self, GstCaps * outcaps)
/* no pool, we can make our own */
GST_DEBUG_OBJECT (self, "no pool, making new pool");
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-output-pool", GST_OBJECT_NAME (self));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
/* now configure */
@ -3172,6 +3177,11 @@ gst_deinterlace_propose_allocation (GstDeinterlace * self, GstQuery * query)
size = GST_VIDEO_INFO_SIZE (&info);
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-input-pool", GST_OBJECT_NAME (self));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
gst_query_add_allocation_pool (query, pool, size, 0, 0);

View File

@ -165,6 +165,11 @@ gst_rtp_vraw_depay_negotiate_pool (GstRtpVRawDepay * depay, GstCaps * caps,
if (pool == NULL) {
/* we did not get a pool, make one ourselves then */
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("%s-pool", GST_OBJECT_NAME (depay));
g_object_set (pool, "name", name, NULL);
g_free (name);
}
}
if (depay->pool)

View File

@ -256,6 +256,11 @@ gst_mpeg2dec_create_generic_pool (GstAllocator * allocator,
GstStructure *config;
pool = gst_video_buffer_pool_new ();
{
gchar *name = g_strdup_printf ("mpeg2dec-%p-pool", pool);
g_object_set (pool, "name", name, NULL);
g_free (name);
}
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_allocator (config, allocator, params);