sink = gst_pad_new ("sink", GST_PAD_SINK);
gst_pad_set_active (src, TRUE);
+ /* source pad is active and will accept the caps event */
fail_unless (gst_pad_set_caps (src, caps) == TRUE);
+ /* sink pad is not active and will refuse the caps event */
fail_if (gst_pad_set_caps (sink, caps) == TRUE);
ASSERT_CAPS_REFCOUNT (caps, "caps", 2);
gst_pad_set_active (sink, TRUE);
+ /* sink pad is now active and will accept the caps event */
fail_unless (gst_pad_set_caps (sink, caps) == TRUE);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
return TRUE;
}
+/* Tests whether caps get properly forwarded when pads
+ are initially unlinked */
GST_START_TEST (test_sticky_caps_unlinked)
{
GstCaps *caps;
event = gst_event_new_caps (caps);
gst_pad_set_active (src, TRUE);
+ /* The caps event gets accepted by the source pad (and stored) */
fail_unless (gst_pad_push_event (src, event) == TRUE);
+ /* But wasn't forwarded since the sink pad is flushing (not activated) */
fail_unless (event_caps == NULL);
/* Activating will not forward the sticky event yet... */