mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
gst/gstpad.c: Revert last change making try_set_caps() work with non-fixed caps.
Original commit message from CVS: * gst/gstpad.c: (gst_pad_try_set_caps): Revert last change making try_set_caps() work with non-fixed caps.
This commit is contained in:
parent
aeca198dda
commit
e02c8aae61
2 changed files with 21 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-01-26 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* gst/gstpad.c: (gst_pad_try_set_caps): Revert last change
|
||||||
|
making try_set_caps() work with non-fixed caps.
|
||||||
|
|
||||||
2004-01-26 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2004-01-26 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* docs/pwg/advanced_types.xml:
|
* docs/pwg/advanced_types.xml:
|
||||||
|
|
25
gst/gstpad.c
25
gst/gstpad.c
|
@ -1322,21 +1322,28 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps)
|
||||||
g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED);
|
g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED);
|
||||||
g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING),
|
g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING),
|
||||||
GST_PAD_LINK_REFUSED);
|
GST_PAD_LINK_REFUSED);
|
||||||
|
|
||||||
|
/* setting non-fixed caps on a pad is not allowed */
|
||||||
|
if (!gst_caps_is_fixed (caps)) {
|
||||||
|
GST_CAT_INFO (GST_CAT_CAPS,
|
||||||
|
"trying to set unfixed caps on pad %s:%s, not allowed",
|
||||||
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
|
g_warning ("trying to set non fixed caps on pad %s:%s, not allowed",
|
||||||
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
|
|
||||||
|
gst_caps_debug (caps, "unfixed caps");
|
||||||
|
return GST_PAD_LINK_REFUSED;
|
||||||
|
}
|
||||||
|
|
||||||
/* we allow setting caps on non-linked pads. It's ignored */
|
/* we allow setting caps on non-linked pads. It's ignored */
|
||||||
if (!GST_PAD_PEER (pad)) {
|
if (!GST_PAD_PEER (pad)) {
|
||||||
return GST_PAD_LINK_OK;
|
return GST_PAD_LINK_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the desired caps are already there, it's trivially ok */
|
/* if the desired caps are already there, it's trivially ok */
|
||||||
if (GST_PAD_CAPS (pad)) {
|
if (GST_PAD_CAPS (pad) && gst_caps_is_equal_fixed (caps,
|
||||||
GstCaps *intersection;
|
GST_PAD_CAPS (pad))) {
|
||||||
intersection = gst_caps_intersect (caps, GST_PAD_CAPS (pad));
|
return GST_PAD_LINK_OK;
|
||||||
if (!gst_caps_is_empty (intersection)) {
|
|
||||||
gst_caps_free (intersection);
|
|
||||||
return GST_PAD_LINK_OK;
|
|
||||||
}
|
|
||||||
gst_caps_free (intersection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED);
|
g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED);
|
||||||
|
|
Loading…
Reference in a new issue