mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
audiopanorama: further port to 1.0
Transformcaps is not called with caps containing single structures anymore. Also add missing filter handling. Still does not negotiate though.
This commit is contained in:
parent
d187b96ee2
commit
1f1fe47cb6
1 changed files with 24 additions and 11 deletions
|
@ -326,19 +326,32 @@ gst_audio_panorama_transform_caps (GstBaseTransform * base,
|
||||||
{
|
{
|
||||||
GstCaps *res;
|
GstCaps *res;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
gint i;
|
||||||
|
|
||||||
/* transform caps gives one single caps so we can just replace
|
/* replace the channel property with our range. */
|
||||||
* the channel property with our range. */
|
|
||||||
res = gst_caps_copy (caps);
|
res = gst_caps_copy (caps);
|
||||||
structure = gst_caps_get_structure (res, 0);
|
for (i = 0; i < gst_caps_get_size (res); i++) {
|
||||||
if (direction == GST_PAD_SRC) {
|
structure = gst_caps_get_structure (res, i);
|
||||||
GST_INFO ("allow 1-2 channels");
|
if (direction == GST_PAD_SRC) {
|
||||||
gst_structure_set (structure, "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
|
GST_INFO ("allow 1-2 channels");
|
||||||
gst_structure_remove_field (structure, "channel-mask");
|
gst_structure_set (structure, "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
|
||||||
} else {
|
gst_structure_remove_field (structure, "channel-mask");
|
||||||
GST_INFO ("allow 2 channels");
|
} else {
|
||||||
gst_structure_set (structure, "channels", G_TYPE_INT, 2, NULL);
|
GST_INFO ("allow 2 channels");
|
||||||
gst_structure_remove_field (structure, "channel-mask");
|
gst_structure_set (structure, "channels", G_TYPE_INT, 2, NULL);
|
||||||
|
gst_structure_remove_field (structure, "channel-mask");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filter) {
|
||||||
|
GstCaps *intersection;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (base, "Using filter caps %" GST_PTR_FORMAT, filter);
|
||||||
|
intersection =
|
||||||
|
gst_caps_intersect_full (filter, res, GST_CAPS_INTERSECT_FIRST);
|
||||||
|
gst_caps_unref (res);
|
||||||
|
res = intersection;
|
||||||
|
GST_DEBUG_OBJECT (base, "Intersection %" GST_PTR_FORMAT, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue