From cbccd3ef8e5d13d59d2c9c0f0cb52091cdb5cc47 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Fri, 3 Jan 2014 14:49:22 +0000 Subject: [PATCH] videodecoder: add some debug about pool negotiation To let us know easily which pool is inactivate and activate during negotiation. --- gst-libs/gst/video/gstvideodecoder.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 905f836..db5afb2 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1760,6 +1760,8 @@ gst_video_decoder_reset (GstVideoDecoder * decoder, gboolean full, priv->base_picture_number = 0; if (priv->pool) { + GST_DEBUG_OBJECT (decoder, "inactivate pool %" GST_PTR_FORMAT, + priv->pool); gst_buffer_pool_set_active (priv->pool, FALSE); gst_object_unref (priv->pool); priv->pool = NULL; @@ -2109,6 +2111,7 @@ gst_video_decoder_change_state (GstElement * element, GstStateChange transition) break; case GST_STATE_CHANGE_READY_TO_PAUSED: /* Initialize device/library if needed */ + g_print ("-- dec ready to paused\n"); if (decoder_class->start && !decoder_class->start (decoder)) goto start_failed; GST_VIDEO_DECODER_STREAM_LOCK (decoder); @@ -2122,7 +2125,11 @@ gst_video_decoder_change_state (GstElement * element, GstStateChange transition) ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + g_print ("-- dec playing to paused\n"); + break; case GST_STATE_CHANGE_PAUSED_TO_READY: + g_print ("-- dec paused to ready\n"); GST_VIDEO_DECODER_STREAM_LOCK (decoder); gst_video_decoder_reset (decoder, TRUE, TRUE); GST_VIDEO_DECODER_STREAM_UNLOCK (decoder); @@ -3069,6 +3076,8 @@ gst_video_decoder_decide_allocation_default (GstVideoDecoder * decoder, config = gst_buffer_pool_get_config (pool); gst_buffer_pool_config_set_params (config, outcaps, size, min, max); gst_buffer_pool_config_set_allocator (config, allocator, ¶ms); + + GST_DEBUG_OBJECT (decoder, "setting config %" GST_PTR_FORMAT, pool); gst_buffer_pool_set_config (pool, config); if (update_allocator) @@ -3110,6 +3119,8 @@ gst_video_decoder_negotiate_pool (GstVideoDecoder * decoder, GstCaps * caps) query = gst_query_new_allocation (caps, TRUE); + GST_DEBUG_OBJECT (decoder, "about to query allocation"); + if (!gst_pad_peer_query (decoder->srcpad, query)) { GST_DEBUG_OBJECT (decoder, "didn't get downstream ALLOCATION hints"); } @@ -3147,12 +3158,15 @@ gst_video_decoder_negotiate_pool (GstVideoDecoder * decoder, GstCaps * caps) decoder->priv->params = params; if (decoder->priv->pool) { + GST_DEBUG_OBJECT (decoder, "inactivate pool %" GST_PTR_FORMAT, + decoder->priv->pool); gst_buffer_pool_set_active (decoder->priv->pool, FALSE); gst_object_unref (decoder->priv->pool); } decoder->priv->pool = pool; /* and activate */ + GST_DEBUG_OBJECT (decoder, "activate pool %" GST_PTR_FORMAT, pool); gst_buffer_pool_set_active (pool, TRUE); done: -- 1.7.10.4