synaesthesia: fixup for bufferpool api changes
... as well as some caps ref handling.
This commit is contained in:
parent
4aa8c11d85
commit
aeaa143e4e
@ -228,10 +228,10 @@ gst_synaesthesia_src_negotiate (GstSynaesthesia * synaesthesia)
|
|||||||
{
|
{
|
||||||
GstCaps *othercaps, *target, *intersect;
|
GstCaps *othercaps, *target, *intersect;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
const GstCaps *templ;
|
GstCaps *templ;
|
||||||
GstQuery *query;
|
GstQuery *query;
|
||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
guint size, min, max, prefix, alignment;
|
guint size, min, max;
|
||||||
|
|
||||||
templ = gst_pad_get_pad_template_caps (synaesthesia->srcpad);
|
templ = gst_pad_get_pad_template_caps (synaesthesia->srcpad);
|
||||||
|
|
||||||
@ -242,6 +242,7 @@ gst_synaesthesia_src_negotiate (GstSynaesthesia * synaesthesia)
|
|||||||
if (othercaps) {
|
if (othercaps) {
|
||||||
intersect = gst_caps_intersect (othercaps, templ);
|
intersect = gst_caps_intersect (othercaps, templ);
|
||||||
gst_caps_unref (othercaps);
|
gst_caps_unref (othercaps);
|
||||||
|
gst_caps_unref (templ);
|
||||||
|
|
||||||
if (gst_caps_is_empty (intersect))
|
if (gst_caps_is_empty (intersect))
|
||||||
goto no_format;
|
goto no_format;
|
||||||
@ -249,7 +250,7 @@ gst_synaesthesia_src_negotiate (GstSynaesthesia * synaesthesia)
|
|||||||
target = gst_caps_copy_nth (intersect, 0);
|
target = gst_caps_copy_nth (intersect, 0);
|
||||||
gst_caps_unref (intersect);
|
gst_caps_unref (intersect);
|
||||||
} else {
|
} else {
|
||||||
target = gst_caps_ref ((GstCaps *) templ);
|
target = templ;
|
||||||
}
|
}
|
||||||
|
|
||||||
structure = gst_caps_get_structure (target, 0);
|
structure = gst_caps_get_structure (target, 0);
|
||||||
@ -268,15 +269,13 @@ gst_synaesthesia_src_negotiate (GstSynaesthesia * synaesthesia)
|
|||||||
/* find a pool for the negotiated caps now */
|
/* find a pool for the negotiated caps now */
|
||||||
query = gst_query_new_allocation (target, TRUE);
|
query = gst_query_new_allocation (target, TRUE);
|
||||||
|
|
||||||
if (gst_pad_peer_query (synaesthesia->srcpad, query)) {
|
if (gst_pad_peer_query (synaesthesia->srcpad, query) &&
|
||||||
|
gst_query_get_n_allocation_pools (query) > 0) {
|
||||||
/* we got configuration from our peer, parse them */
|
/* we got configuration from our peer, parse them */
|
||||||
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
|
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
|
||||||
&alignment, &pool);
|
|
||||||
} else {
|
} else {
|
||||||
size = synaesthesia->outsize;
|
size = synaesthesia->outsize;
|
||||||
min = max = 0;
|
min = max = 0;
|
||||||
prefix = 0;
|
|
||||||
alignment = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pool == NULL) {
|
if (pool == NULL) {
|
||||||
@ -286,8 +285,7 @@ gst_synaesthesia_src_negotiate (GstSynaesthesia * synaesthesia)
|
|||||||
pool = gst_buffer_pool_new ();
|
pool = gst_buffer_pool_new ();
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set (config, target, size, min, max, prefix,
|
gst_buffer_pool_config_set_params (config, target, size, min, max);
|
||||||
alignment);
|
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user