mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
plugins: fix for allocation query API change
This commit is contained in:
parent
16d8fb2c2f
commit
abcbef287d
4 changed files with 31 additions and 23 deletions
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue