mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
base: Update for caps/pad template related API changes
This commit is contained in:
parent
c7789694fb
commit
5f2cd2b0a3
3 changed files with 13 additions and 11 deletions
|
@ -586,7 +586,7 @@ gst_base_sink_pad_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass),
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass),
|
||||||
"sink");
|
"sink");
|
||||||
if (pad_template != NULL) {
|
if (pad_template != NULL) {
|
||||||
caps = gst_caps_ref (gst_pad_template_get_caps (pad_template));
|
caps = gst_pad_template_get_caps (pad_template);
|
||||||
|
|
||||||
if (filter) {
|
if (filter) {
|
||||||
GstCaps *intersection;
|
GstCaps *intersection;
|
||||||
|
|
|
@ -802,7 +802,7 @@ gst_base_src_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
pad_template =
|
pad_template =
|
||||||
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass), "src");
|
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass), "src");
|
||||||
if (pad_template != NULL) {
|
if (pad_template != NULL) {
|
||||||
caps = gst_caps_ref (gst_pad_template_get_caps (pad_template));
|
caps = gst_pad_template_get_caps (pad_template);
|
||||||
|
|
||||||
if (filter) {
|
if (filter) {
|
||||||
GstCaps *intersection;
|
GstCaps *intersection;
|
||||||
|
|
|
@ -646,8 +646,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
|
|
||||||
/* we can do what the peer can */
|
/* we can do what the peer can */
|
||||||
if (filter) {
|
if (filter) {
|
||||||
GstCaps *temp;
|
GstCaps *temp, *templ;
|
||||||
const GstCaps *templ;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "filter caps %" GST_PTR_FORMAT, filter);
|
GST_DEBUG_OBJECT (pad, "filter caps %" GST_PTR_FORMAT, filter);
|
||||||
|
|
||||||
|
@ -656,6 +655,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
|
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
|
||||||
temp = gst_caps_intersect_full (filter, templ, GST_CAPS_INTERSECT_FIRST);
|
temp = gst_caps_intersect_full (filter, templ, GST_CAPS_INTERSECT_FIRST);
|
||||||
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
||||||
|
gst_caps_unref (templ);
|
||||||
|
|
||||||
/* then see what we can transform this to */
|
/* then see what we can transform this to */
|
||||||
peerfilter = gst_base_transform_transform_caps (trans,
|
peerfilter = gst_base_transform_transform_caps (trans,
|
||||||
|
@ -671,6 +671,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
gst_caps_intersect_full (peerfilter, templ, GST_CAPS_INTERSECT_FIRST);
|
gst_caps_intersect_full (peerfilter, templ, GST_CAPS_INTERSECT_FIRST);
|
||||||
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
||||||
gst_caps_unref (peerfilter);
|
gst_caps_unref (peerfilter);
|
||||||
|
gst_caps_unref (templ);
|
||||||
peerfilter = temp;
|
peerfilter = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,8 +681,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
gst_caps_unref (peerfilter);
|
gst_caps_unref (peerfilter);
|
||||||
|
|
||||||
if (peercaps && !gst_caps_is_any (peercaps)) {
|
if (peercaps && !gst_caps_is_any (peercaps)) {
|
||||||
GstCaps *temp;
|
GstCaps *temp, *templ;
|
||||||
const GstCaps *templ;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peercaps);
|
GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peercaps);
|
||||||
|
|
||||||
|
@ -690,6 +690,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
|
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
|
||||||
temp = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
|
temp = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
|
||||||
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
||||||
|
gst_caps_unref (templ);
|
||||||
|
|
||||||
/* then see what we can transform this to */
|
/* then see what we can transform this to */
|
||||||
caps = gst_base_transform_transform_caps (trans,
|
caps = gst_base_transform_transform_caps (trans,
|
||||||
|
@ -706,6 +707,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST);
|
temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST);
|
||||||
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
gst_caps_unref (templ);
|
||||||
caps = temp;
|
caps = temp;
|
||||||
|
|
||||||
/* Now try if we can put the untransformed downstream caps first */
|
/* Now try if we can put the untransformed downstream caps first */
|
||||||
|
@ -718,7 +720,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* no peer or the peer can do anything, our padtemplate is enough then */
|
/* no peer or the peer can do anything, our padtemplate is enough then */
|
||||||
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
caps = gst_pad_get_pad_template_caps (pad);
|
||||||
|
|
||||||
if (filter) {
|
if (filter) {
|
||||||
GstCaps *temp;
|
GstCaps *temp;
|
||||||
|
@ -827,8 +829,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
|
||||||
/* The caps we can actually output is the intersection of the transformed
|
/* The caps we can actually output is the intersection of the transformed
|
||||||
* caps with the pad template for the pad */
|
* caps with the pad template for the pad */
|
||||||
if (othercaps) {
|
if (othercaps) {
|
||||||
GstCaps *intersect;
|
GstCaps *intersect, *templ_caps;
|
||||||
const GstCaps *templ_caps;
|
|
||||||
|
|
||||||
templ_caps = gst_pad_get_pad_template_caps (otherpad);
|
templ_caps = gst_pad_get_pad_template_caps (otherpad);
|
||||||
GST_DEBUG_OBJECT (trans,
|
GST_DEBUG_OBJECT (trans,
|
||||||
|
@ -839,6 +840,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
|
||||||
GST_CAPS_INTERSECT_FIRST);
|
GST_CAPS_INTERSECT_FIRST);
|
||||||
|
|
||||||
gst_caps_unref (othercaps);
|
gst_caps_unref (othercaps);
|
||||||
|
gst_caps_unref (templ_caps);
|
||||||
othercaps = intersect;
|
othercaps = intersect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,8 +859,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
|
||||||
|
|
||||||
/* Now let's see what the peer suggests based on our transformed caps */
|
/* Now let's see what the peer suggests based on our transformed caps */
|
||||||
if (otherpeer) {
|
if (otherpeer) {
|
||||||
GstCaps *peercaps, *intersection;
|
GstCaps *peercaps, *intersection, *templ_caps;
|
||||||
const GstCaps *templ_caps;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (trans,
|
GST_DEBUG_OBJECT (trans,
|
||||||
"Checking peer caps with filter %" GST_PTR_FORMAT, othercaps);
|
"Checking peer caps with filter %" GST_PTR_FORMAT, othercaps);
|
||||||
|
@ -876,6 +877,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
|
||||||
GST_CAPS_INTERSECT_FIRST);
|
GST_CAPS_INTERSECT_FIRST);
|
||||||
GST_DEBUG_OBJECT (trans, "Intersection: %" GST_PTR_FORMAT, intersection);
|
GST_DEBUG_OBJECT (trans, "Intersection: %" GST_PTR_FORMAT, intersection);
|
||||||
gst_caps_unref (peercaps);
|
gst_caps_unref (peercaps);
|
||||||
|
gst_caps_unref (templ_caps);
|
||||||
peercaps = intersection;
|
peercaps = intersection;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (trans,
|
GST_DEBUG_OBJECT (trans,
|
||||||
|
|
Loading…
Reference in a new issue