From b594010249c1ed2b1111facd44001e7eab65de55 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 9 May 2005 21:37:54 +0000 Subject: [PATCH] gst/base/gstbasetransform.c (gst_base_transform_proxy_getcaps): Intersect the peer's caps with our caps. Original commit message from CVS: 2005-05-09 Andy Wingo * gst/base/gstbasetransform.c (gst_base_transform_proxy_getcaps): Intersect the peer's caps with our caps. --- ChangeLog | 5 ++ docs/gst/tmpl/gstelement.sgml | 35 +-------- docs/gst/tmpl/gstpad.sgml | 148 +++------------------------------------ gst/base/gstbasetransform.c | 11 ++- libs/gst/base/gstbasetransform.c | 11 ++- 5 files changed, 35 insertions(+), 175 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ad1b03..397abd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-05-09 Andy Wingo + + * gst/base/gstbasetransform.c (gst_base_transform_proxy_getcaps): + Intersect the peer's caps with our caps. + 2005-05-09 Ronald S. Bultje * gst/base/gsttypefindhelper.c: (helper_find_peek): diff --git a/docs/gst/tmpl/gstelement.sgml b/docs/gst/tmpl/gstelement.sgml index d461b1c..5998657 100644 --- a/docs/gst/tmpl/gstelement.sgml +++ b/docs/gst/tmpl/gstelement.sgml @@ -601,15 +601,6 @@ Sets the parent of an element. - - - - - -@element: -@Returns: - - @@ -646,32 +637,12 @@ Sets the parent of an element. @element: +@query: +@Returns: + @type: @format: @value: -@Returns: - - - - - - - -@element: -@Returns: - - - - - - - -@element: -@src_format: -@src_value: -@dest_format: -@dest_value: -@Returns: diff --git a/docs/gst/tmpl/gstpad.sgml b/docs/gst/tmpl/gstpad.sgml index b51ce44..d401470 100644 --- a/docs/gst/tmpl/gstpad.sgml +++ b/docs/gst/tmpl/gstpad.sgml @@ -139,29 +139,18 @@ Function signature to handle an event for the pad. @Returns: TRUE if the pad could handle the event. - - -The signature of a convert function. - - -@pad: the #GstPad to perform the convert on. -@src_format: the source #GstFormat of the conversion. -@src_value: the source value of the conversion. -@dest_format: a pointer to the destination #GstFormat. -@dest_value: a pointer to the destination value. -@Returns: TRUE if the conversion could be performed. - - The signature of the query function. @pad: the #GstPad to query. +@query: +@Returns: TRUE if the query could be performed. + @type: the #GstPadQueryType. @format: a pointer to the target #GstFormat. @value: a pointer to the target value. -@Returns: TRUE if the query could be performed. @@ -175,24 +164,6 @@ The signature of the internal pad link function. The caller must call g_list_free() on it after use. - - -The signature of the formats function. - - -@pad: a #GstPad to query -@Returns: an array of formats - - - - -The signature of the eventmask function. - - -@pad: the #GstPad to query -@Returns: an array of event masks - - The signature of the query types function. @@ -391,14 +362,6 @@ Checks if the pad is active. @pad: a #GstPad to check - - - - - -@pad: - - Checks if a pad is usable. A usable pad is both linked and active. @@ -407,14 +370,6 @@ Checks if a pad is usable. A usable pad is both linked and active. @pad: a #GstPad to check - - -Checks if buffers can be pulled from this buffer. - - -@pad: a #GstPad to check on if a buffer can be pulled from it. - - Checks if the pad is a source pad. @@ -616,33 +571,6 @@ Checks if the pad is a sink pad. @event: - - - - - -@pad: -@mask_func: - - - - - - - -@pad: -@Returns: - - - - - - - -@pad: -@Returns: - - @@ -798,68 +726,6 @@ Checks if the pad is a sink pad. @Returns: - - - - - -@pad: -@formats: - - - - - - - -@pad: -@Returns: - - - - - - - -@pad: -@Returns: - - - - - - - -@pad: -@convert: - - - - - - - -@pad: -@src_format: -@src_value: -@dest_format: -@dest_value: -@Returns: - - - - - - - -@pad: -@src_format: -@src_value: -@dest_format: -@dest_value: -@Returns: - - @@ -902,10 +768,12 @@ Checks if the pad is a sink pad. @pad: +@query: +@Returns: + @type: @format: @value: -@Returns: @@ -914,10 +782,12 @@ Checks if the pad is a sink pad. @pad: +@query: +@Returns: + @type: @format: @value: -@Returns: diff --git a/gst/base/gstbasetransform.c b/gst/base/gstbasetransform.c index abfbcd6..cc8e82c 100644 --- a/gst/base/gstbasetransform.c +++ b/gst/base/gstbasetransform.c @@ -180,6 +180,7 @@ gst_base_transform_proxy_getcaps (GstPad * pad) GstPad *otherpad; GstBaseTransform *trans; GstCaps *caps; + const GstCaps *templcaps; trans = GST_BASE_TRANSFORM (GST_OBJECT_PARENT (pad)); @@ -187,11 +188,17 @@ gst_base_transform_proxy_getcaps (GstPad * pad) /* we can do whatever the peer can do */ caps = gst_pad_peer_get_caps (otherpad); + templcaps = gst_pad_get_pad_template_caps (pad); + if (caps == NULL) { /* no peer, then the padtemplate is enough */ - caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + return gst_caps_copy (templcaps); + } else { + GstCaps *ret = gst_caps_intersect (caps, templcaps); + + gst_caps_unref (caps); + return ret; } - return caps; } static gboolean diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index abfbcd6..cc8e82c 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -180,6 +180,7 @@ gst_base_transform_proxy_getcaps (GstPad * pad) GstPad *otherpad; GstBaseTransform *trans; GstCaps *caps; + const GstCaps *templcaps; trans = GST_BASE_TRANSFORM (GST_OBJECT_PARENT (pad)); @@ -187,11 +188,17 @@ gst_base_transform_proxy_getcaps (GstPad * pad) /* we can do whatever the peer can do */ caps = gst_pad_peer_get_caps (otherpad); + templcaps = gst_pad_get_pad_template_caps (pad); + if (caps == NULL) { /* no peer, then the padtemplate is enough */ - caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + return gst_caps_copy (templcaps); + } else { + GstCaps *ret = gst_caps_intersect (caps, templcaps); + + gst_caps_unref (caps); + return ret; } - return caps; } static gboolean -- 2.7.4