Commit 8076051a authored by Edward Hervey's avatar Edward Hervey 🤘 Committed by Edward Hervey
Browse files

basetransform: Minor refactoring

Move checks related to peerfilter in one place. No impact except for logic.

Part-of: <!484>
parent 3c7db917
Pipeline #146737 waiting for manual action with stages
in 16 seconds
......@@ -652,28 +652,31 @@ gst_base_transform_query_caps (GstBaseTransform * trans, GstPad * pad,
GST_DEBUG_OBJECT (pad, "transformed %" GST_PTR_FORMAT, peerfilter);
gst_caps_unref (temp);
if (peerfilter && !gst_caps_is_empty (peerfilter)) {
/* and filter against the template of the other pad */
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, otempl);
/* We keep the caps sorted like the returned caps */
temp =
gst_caps_intersect_full (peerfilter, otempl,
GST_CAPS_INTERSECT_FIRST);
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
gst_caps_unref (peerfilter);
peerfilter = temp;
if (peerfilter) {
if (!gst_caps_is_empty (peerfilter)) {
/* and filter against the template of the other pad */
GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, otempl);
/* We keep the caps sorted like the returned caps */
temp =
gst_caps_intersect_full (peerfilter, otempl,
GST_CAPS_INTERSECT_FIRST);
GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
gst_caps_unref (peerfilter);
peerfilter = temp;
}
/* If we filter out everything, bail out */
if (peerfilter && gst_caps_is_empty (peerfilter)) {
GST_DEBUG_OBJECT (pad, "peer filter caps are empty");
caps = peerfilter;
peerfilter = NULL;
goto done;
}
}
}
GST_DEBUG_OBJECT (pad, "peer filter caps %" GST_PTR_FORMAT, peerfilter);
if (peerfilter && gst_caps_is_empty (peerfilter)) {
GST_DEBUG_OBJECT (pad, "peer filter caps are empty");
caps = peerfilter;
peerfilter = NULL;
goto done;
}
/* query the peer with the transformed filter */
peercaps = gst_pad_peer_query_caps (otherpad, peerfilter);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment