2005-05-09 Wim Taymans <wim@fluendo.com>
+ * gst/base/gstbasetransform.c: (gst_base_transform_proxy_getcaps),
+ (gst_base_transform_event):
+ * gst/gstpad.c: (gst_pad_accept_caps), (gst_pad_query):
+ Implement accept_caps.
+ Fix silly lock/unlock mismatch in base class.
+
+2005-05-09 Wim Taymans <wim@fluendo.com>
+
* docs/design/draft-push-pull.txt:
* gst/base/gstbasesrc.c: (gst_basesrc_init), (gst_basesrc_query):
* gst/elements/gstfilesink.c: (gst_filesink_init),
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gboolean ret = FALSE;
+ gboolean unlock;
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->event)
bclass->event (trans, event);
+ unlock = FALSE;
+
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
if (GST_EVENT_FLUSH_DONE (event)) {
}
GST_STREAM_LOCK (pad);
+ unlock = TRUE;
break;
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
+ unlock = TRUE;
break;
default:
break;
}
ret = gst_pad_event_default (pad, event);
- GST_STREAM_UNLOCK (pad);
+ if (unlock)
+ GST_STREAM_UNLOCK (pad);
return ret;
}
GST_CAT_DEBUG (GST_CAT_CAPS, "pad accept caps of %s:%s (%p)",
GST_DEBUG_PAD_NAME (realpad), realpad);
- /* FIXME, call accept function */
- result = FALSE;
+ if (GST_RPAD_ACCEPTCAPSFUNC (pad)) {
+ /* we can call the function */
+ result = GST_RPAD_ACCEPTCAPSFUNC (realpad) (pad, caps);
+ } else {
+ /* else see get the caps and see if it intersects to something
+ * not empty */
+ GstCaps *intersect;
+ GstCaps *allowed;
+
+ allowed = gst_real_pad_get_caps_unlocked (realpad);
+ intersect = gst_caps_intersect (allowed, caps);
+ if (gst_caps_is_empty (intersect))
+ result = FALSE;
+ else
+ result = TRUE;
+ }
GST_UNLOCK (realpad);
return result;
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
gboolean ret = FALSE;
+ gboolean unlock;
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->event)
bclass->event (trans, event);
+ unlock = FALSE;
+
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
if (GST_EVENT_FLUSH_DONE (event)) {
}
GST_STREAM_LOCK (pad);
+ unlock = TRUE;
break;
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
+ unlock = TRUE;
break;
default:
break;
}
ret = gst_pad_event_default (pad, event);
- GST_STREAM_UNLOCK (pad);
+ if (unlock)
+ GST_STREAM_UNLOCK (pad);
return ret;
}