From abcbef287dbd5861d8716141d5243aca55c9c439 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 2 May 2011 11:11:33 +0200 Subject: [PATCH] plugins: fix for allocation query API change --- ext/libvisual/visual.c | 20 +++++++++++--------- ext/theora/gsttheoradec.c | 14 ++++++++------ gst/videotestsrc/gstvideotestsrc.c | 18 +++++++++++------- sys/xvimage/xvimagesink.c | 2 +- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/ext/libvisual/visual.c b/ext/libvisual/visual.c index 1476ee7c6..53bcd80bc 100644 --- a/ext/libvisual/visual.c +++ b/ext/libvisual/visual.c @@ -394,8 +394,8 @@ gst_vis_src_negotiate (GstVisual * visual) GstStructure *structure; GstCaps *caps; GstQuery *query; - GstBufferPool *pool = NULL; - guint alignment, prefix, size; + GstBufferPool *pool; + guint size, min, max, prefix, alignment; caps = gst_pad_get_caps (visual->srcpad); @@ -434,12 +434,13 @@ gst_vis_src_negotiate (GstVisual * visual) if (gst_pad_peer_query (visual->srcpad, query)) { /* we got configuration from our peer, parse them */ - gst_query_parse_allocation_params (query, &alignment, &prefix, &size, - &pool); + gst_query_parse_allocation_params (query, &size, &min, &max, &prefix, + &alignment, &pool); } else { - alignment = 0; - prefix = 0; size = visual->outsize; + min = max = 0; + prefix = 0; + alignment = 1; } if (pool == NULL) { @@ -449,7 +450,8 @@ gst_vis_src_negotiate (GstVisual * visual) pool = gst_buffer_pool_new (); config = gst_buffer_pool_get_config (pool); - gst_buffer_pool_config_set (config, caps, size, 0, 0, prefix, 0, alignment); + gst_buffer_pool_config_set (config, caps, size, min, max, prefix, 0, + alignment); gst_buffer_pool_set_config (pool, config); } @@ -865,8 +867,8 @@ gst_visual_change_state (GstElement * element, GstStateChange transition) switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: visual->actor = - visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin-> - info->plugname); + visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info-> + plugname); visual->video = visual_video_new (); visual->audio = visual_audio_new (); /* can't have a play without actors */ diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index babc3a708..5e0173441 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -800,7 +800,7 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps) { GstQuery *query; GstBufferPool *pool = NULL; - guint alignment, prefix, size; + guint size, min, max, prefix, alignment; /* find a pool for the negotiated caps now */ query = gst_query_new_allocation (caps, TRUE); @@ -808,13 +808,14 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps) if (gst_pad_peer_query (dec->srcpad, query)) { GST_DEBUG_OBJECT (dec, "got downstream ALLOCATION hints"); /* we got configuration from our peer, parse them */ - gst_query_parse_allocation_params (query, &alignment, &prefix, &size, - &pool); + gst_query_parse_allocation_params (query, &size, &min, &max, &prefix, + &alignment, &pool); } else { GST_DEBUG_OBJECT (dec, "didn't get downstream ALLOCATION hints"); - alignment = 0; - prefix = 0; size = gst_video_format_get_size (dec->format, dec->width, dec->height); + min = max = 0; + prefix = 0; + alignment = 1; } if (pool == NULL) { @@ -824,7 +825,8 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps) pool = gst_buffer_pool_new (); config = gst_buffer_pool_get_config (pool); - gst_buffer_pool_config_set (config, caps, size, 0, 0, prefix, 0, alignment); + gst_buffer_pool_config_set (config, caps, size, min, max, prefix, 0, + alignment); gst_buffer_pool_set_config (pool, config); } diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index b1015ef6f..addeba936 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -667,8 +667,8 @@ gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps) GstVideoTestSrc *videotestsrc; GstVideoTestSrcColorSpec color_spec; GstQuery *query; - GstBufferPool *pool = NULL; - guint alignment, prefix, size; + GstBufferPool *pool; + guint size, min, max, prefix, alignment; videotestsrc = GST_VIDEO_TEST_SRC (bsrc); @@ -692,14 +692,17 @@ gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps) /* find a pool for the negotiated caps now */ query = gst_query_new_allocation (caps, TRUE); + if (gst_pad_peer_query (bsrc->srcpad, query)) { /* we got configuration from our peer, parse them */ - gst_query_parse_allocation_params (query, &alignment, &prefix, &size, - &pool); + gst_query_parse_allocation_params (query, &size, &min, &max, &prefix, + &alignment, &pool); } else { - alignment = 0; - prefix = 0; size = gst_video_test_src_get_size (videotestsrc, width, height); + min = max = 0; + prefix = 0; + alignment = 1; + pool = NULL; } if (pool == NULL) { @@ -709,7 +712,8 @@ gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps) pool = gst_buffer_pool_new (); config = gst_buffer_pool_get_config (pool); - gst_buffer_pool_config_set (config, caps, size, 0, 0, prefix, 0, alignment); + gst_buffer_pool_config_set (config, caps, size, min, max, prefix, 0, + alignment); gst_buffer_pool_set_config (pool, config); } diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 7731afff7..4f2637aad 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1989,7 +1989,7 @@ gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery * query) if (!gst_buffer_pool_set_config (pool, config)) goto config_failed; } - gst_query_set_allocation_params (query, 0, 0, size, pool); + gst_query_set_allocation_params (query, size, 0, 0, 0, 16, pool); /* we also support various metadata */ gst_query_add_allocation_meta (query, GST_META_API_VIDEO); -- 2.34.1