caps = gst_caps_make_writable (caps);
/* get the first (prefered) format */
gst_caps_truncate (caps);
- /* try to fixate */
- gst_pad_fixate_caps (GST_BASE_SINK_PAD (basesink), caps);
- GST_DEBUG_OBJECT (basesink, "fixated to: %" GST_PTR_FORMAT, caps);
+ GST_DEBUG_OBJECT (basesink, "have caps: %" GST_PTR_FORMAT, caps);
if (gst_caps_is_any (caps)) {
GST_DEBUG_OBJECT (basesink, "caps were ANY after fixating, "
/* neither side has template caps in this case, so they are prepared for
pull() without setcaps() */
result = TRUE;
- } else if (gst_caps_is_fixed (caps)) {
- if (!gst_pad_set_caps (GST_BASE_SINK_PAD (basesink), caps))
- goto could_not_set_caps;
+ } else {
+ /* try to fixate */
+ gst_pad_fixate_caps (GST_BASE_SINK_PAD (basesink), caps);
+ GST_DEBUG_OBJECT (basesink, "fixated to: %" GST_PTR_FORMAT, caps);
- GST_OBJECT_LOCK (basesink);
- gst_caps_replace (&basesink->priv->pull_caps, caps);
- GST_OBJECT_UNLOCK (basesink);
+ if (gst_caps_is_fixed (caps)) {
+ if (!gst_pad_set_caps (GST_BASE_SINK_PAD (basesink), caps))
+ goto could_not_set_caps;
- result = TRUE;
+ GST_OBJECT_LOCK (basesink);
+ gst_caps_replace (&basesink->priv->pull_caps, caps);
+ GST_OBJECT_UNLOCK (basesink);
+
+ result = TRUE;
+ }
}
gst_caps_unref (caps);
/* now fixate */
if (!gst_caps_is_empty (caps)) {
- gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps);
- GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps);
-
+ GST_DEBUG_OBJECT (basesrc, "have caps: %" GST_PTR_FORMAT, caps);
if (gst_caps_is_any (caps)) {
/* hmm, still anything, so element can do anything and
* nego is not needed */
result = TRUE;
- } else if (gst_caps_is_fixed (caps)) {
- /* yay, fixed caps, use those then, it's possible that the subclass does
- * not accept this caps after all and we have to fail. */
- result = gst_pad_set_caps (GST_BASE_SRC_PAD (basesrc), caps);
+ } else {
+ gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps);
+ GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps);
+ if (gst_caps_is_fixed (caps)) {
+ /* yay, fixed caps, use those then, it's possible that the subclass does
+ * not accept this caps after all and we have to fail. */
+ result = gst_pad_set_caps (GST_BASE_SRC_PAD (basesrc), caps);
+ }
}
}
gst_caps_unref (caps);