/* one of the scheduling types */
if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & type) == 0)
goto no_match;
- /* all of the blocking types must match */
- if ((flags & GST_PAD_PROBE_TYPE_BLOCKING) !=
- (type & GST_PAD_PROBE_TYPE_BLOCKING))
+ /* one of the blocking types must match */
+ if ((type & GST_PAD_PROBE_TYPE_BLOCKING) &&
+ (flags & GST_PAD_PROBE_TYPE_BLOCKING & type) == 0)
goto no_match;
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
if (G_UNLIKELY (GST_PAD_HAS_PENDING_EVENTS (pad))) {
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PENDING_EVENTS);
+ GST_DEBUG_OBJECT (pad, "pushing all sticky events");
+
ret = GST_FLOW_OK;
events_foreach (pad, push_sticky, &ret);
if (ret != GST_FLOW_OK)
if (G_UNLIKELY (GST_PAD_HAS_PENDING_EVENTS (pad))) {
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PENDING_EVENTS);
+ GST_DEBUG_OBJECT (pad, "pushing all sticky events");
+
ret = GST_FLOW_OK;
events_foreach (pad, push_sticky, &ret);
if (ret != GST_FLOW_OK)
caps = gst_caps_from_string ("foo/bar");
/* pushing on an inactive pad will return wrong state */
+ GST_DEBUG ("push buffer inactive");
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_WRONG_STATE);
gst_buffer_unref (buffer);
gst_pad_set_active (src, TRUE);
+ GST_DEBUG ("push caps event inactive");
gst_pad_set_caps (src, caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 2);
/* pushing on an unlinked pad will drop the buffer */
+ GST_DEBUG ("push buffer unlinked");
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_NOT_LINKED);
/* adding a probe that returns _DROP will drop the buffer without trying
* to chain */
+ GST_DEBUG ("push buffer drop");
id = gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_BUFFER,
_probe_handler, GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new ();
/* adding a probe that returns _OK will still chain the buffer,
* and hence drop because pad is unlinked */
+ GST_DEBUG ("push buffer ok");
id = gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_BUFFER,
_probe_handler, GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new ();
thread = g_thread_create ((GThreadFunc) push_buffer_async, pad, TRUE, NULL);
- g_usleep (100000);
+ /* wait for the block */
+ while (!gst_pad_is_blocking (pad)) {
+ g_usleep (100000);
+ }
+
+ /* stop with flushing */
gst_pad_push_event (pad, gst_event_new_flush_start ());
- gst_pad_push_event (pad, gst_event_new_flush_stop (FALSE));
+ /* get return value from push */
ret = GPOINTER_TO_INT (g_thread_join (thread));
-
- fail_if (ret == GST_FLOW_NOT_LINKED);
+ /* unflush now */
+ gst_pad_push_event (pad, gst_event_new_flush_stop (FALSE));
+ /* must be wrong state */
+ fail_unless (ret == GST_FLOW_WRONG_STATE);
gst_object_unref (pad);
}