summaryrefslogtreecommitdiff
path: root/gst/goom2k1
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-03-15 20:37:56 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-03-15 20:37:56 +0100
commitf3a770a20c1ab8a91548cb3bd5c33c25ef75146e (patch)
tree45a50f0588eb0af7110814763ce67c11fc3502d4 /gst/goom2k1
parent6ed3bc109bce170367bde7a059831f62ddbe3b48 (diff)
downloadgstreamer-plugins-good-f3a770a20c1ab8a91548cb3bd5c33c25ef75146e.tar.gz
update for allocation query changes
Diffstat (limited to 'gst/goom2k1')
-rw-r--r--gst/goom2k1/gstgoom.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/gst/goom2k1/gstgoom.c b/gst/goom2k1/gstgoom.c
index 228df9f28..8917c958f 100644
--- a/gst/goom2k1/gstgoom.c
+++ b/gst/goom2k1/gstgoom.c
@@ -252,7 +252,8 @@ gst_goom_src_negotiate (GstGoom * goom)
GstCaps *templ;
GstQuery *query;
GstBufferPool *pool = NULL;
- guint size, min, max, prefix, padding, alignment;
+ GstStructure *config;
+ guint size, min, max;
templ = gst_pad_get_pad_template_caps (goom->srcpad);
@@ -281,36 +282,36 @@ gst_goom_src_negotiate (GstGoom * goom)
gst_goom_src_setcaps (goom, target);
- /* try to get a bufferpool now */
/* find a pool for the negotiated caps now */
query = gst_query_new_allocation (target, TRUE);
- if (gst_pad_peer_query (goom->srcpad, query)) {
+ if (!gst_pad_peer_query (goom->srcpad, query)) {
+ /* no problem, we use the query defaults */
+ GST_DEBUG_OBJECT (goom, "ALLOCATION query failed");
+ }
+
+ if (gst_query_get_n_allocation_pools (query) > 0) {
/* we got configuration from our peer, parse them */
- gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
- &padding, &alignment, &pool);
+ gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
} else {
+ pool = NULL;
size = goom->outsize;
min = max = 0;
- prefix = 0;
- padding = 0;
- alignment = 0;
}
if (pool == NULL) {
- GstStructure *config;
-
/* we did not get a pool, make one ourselves then */
pool = gst_buffer_pool_new ();
-
- config = gst_buffer_pool_get_config (pool);
- gst_buffer_pool_config_set (config, target, size, min, max, prefix,
- padding, alignment);
- gst_buffer_pool_set_config (pool, config);
}
- if (goom->pool)
+ config = gst_buffer_pool_get_config (pool);
+ gst_buffer_pool_config_set (config, target, size, min, max, 0, 0, 0);
+ gst_buffer_pool_set_config (pool, config);
+
+ if (goom->pool) {
+ gst_buffer_pool_set_active (goom->pool, FALSE);
gst_object_unref (goom->pool);
+ }
goom->pool = pool;
/* and activate */