mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-28 06:42:16 +00:00
gst/: Implement accept_caps.
Original commit message from CVS: * 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.
This commit is contained in:
parent
8df6cd7243
commit
e70ec7b807
4 changed files with 38 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
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:
|
||||
|
|
|
@ -216,6 +216,7 @@ gst_base_transform_event (GstPad * pad, GstEvent * event)
|
|||
GstBaseTransform *trans;
|
||||
GstBaseTransformClass *bclass;
|
||||
gboolean ret = FALSE;
|
||||
gboolean unlock;
|
||||
|
||||
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
|
||||
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
|
||||
|
@ -223,20 +224,25 @@ gst_base_transform_event (GstPad * pad, GstEvent * event)
|
|||
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;
|
||||
}
|
||||
|
|
18
gst/gstpad.c
18
gst/gstpad.c
|
@ -1791,8 +1791,22 @@ gst_pad_accept_caps (GstPad * pad, GstCaps * caps)
|
|||
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;
|
||||
|
|
|
@ -216,6 +216,7 @@ gst_base_transform_event (GstPad * pad, GstEvent * event)
|
|||
GstBaseTransform *trans;
|
||||
GstBaseTransformClass *bclass;
|
||||
gboolean ret = FALSE;
|
||||
gboolean unlock;
|
||||
|
||||
trans = GST_BASE_TRANSFORM (GST_PAD_PARENT (pad));
|
||||
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
|
||||
|
@ -223,20 +224,25 @@ gst_base_transform_event (GstPad * pad, GstEvent * event)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue