gst/base/gstbasetransform.c (gst_base_transform_proxy_getcaps): Intersect the peer...
authorAndy Wingo <wingo@pobox.com>
Mon, 9 May 2005 21:37:54 +0000 (21:37 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 9 May 2005 21:37:54 +0000 (21:37 +0000)
Original commit message from CVS:
2005-05-09  Andy Wingo  <wingo@pobox.com>

* gst/base/gstbasetransform.c (gst_base_transform_proxy_getcaps):
Intersect the peer's caps with our caps.

ChangeLog
docs/gst/tmpl/gstelement.sgml
docs/gst/tmpl/gstpad.sgml
gst/base/gstbasetransform.c
libs/gst/base/gstbasetransform.c

index 7ad1b03..397abd0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-09  Andy Wingo  <wingo@pobox.com>
+
+       * gst/base/gstbasetransform.c (gst_base_transform_proxy_getcaps):
+       Intersect the peer's caps with our caps.
+
 2005-05-09  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * gst/base/gsttypefindhelper.c: (helper_find_peek):
index d461b1c..5998657 100644 (file)
@@ -601,15 +601,6 @@ Sets the parent of an element.
 <!-- pad manipulation -->
 
 
-<!-- ##### FUNCTION gst_element_get_event_masks ##### -->
-<para>
-
-</para>
-
-@element: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gst_element_send_event ##### -->
 <para>
 
@@ -646,32 +637,12 @@ Sets the parent of an element.
 </para>
 
 @element: 
+@query: 
+@Returns: 
+<!-- # Unused Parameters # -->
 @type: 
 @format: 
 @value: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gst_element_get_formats ##### -->
-<para>
-
-</para>
-
-@element: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gst_element_convert ##### -->
-<para>
-
-</para>
-
-@element: 
-@src_format: 
-@src_value: 
-@dest_format: 
-@dest_value: 
-@Returns: 
 
 
 <!-- ##### FUNCTION gst_element_is_locked_state ##### -->
index b51ce44..d401470 100644 (file)
@@ -139,29 +139,18 @@ Function signature to handle an event for the pad.
 @Returns: TRUE if the pad could handle the event.
 
 
-<!-- ##### USER_FUNCTION GstPadConvertFunction ##### -->
-<para>
-The signature of a convert function. 
-</para>
-
-@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.
-
-
 <!-- ##### USER_FUNCTION GstPadQueryFunction ##### -->
 <para>
 The signature of the query function.
 </para>
 
 @pad: the #GstPad to query.
+@query: 
+@Returns: TRUE if the query could be performed.
+<!-- # Unused Parameters # -->
 @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.
 
 
 <!-- ##### USER_FUNCTION GstPadIntLinkFunction ##### -->
@@ -175,24 +164,6 @@ The signature of the internal pad link function.
           The caller must call g_list_free() on it after use.
 
 
-<!-- ##### USER_FUNCTION GstPadFormatsFunction ##### -->
-<para>
-The signature of the formats function.
-</para>
-
-@pad: a #GstPad to query
-@Returns: an array of formats
-
-
-<!-- ##### USER_FUNCTION GstPadEventMaskFunction ##### -->
-<para>
-The signature of the eventmask function.
-</para>
-
-@pad: the #GstPad to query
-@Returns: an array of event masks
-
-
 <!-- ##### USER_FUNCTION GstPadQueryTypeFunction ##### -->
 <para>
 The signature of the query types function.
@@ -391,14 +362,6 @@ Checks if the pad is active.
 @pad: a #GstPad to check
 
 
-<!-- ##### MACRO GST_PAD_IS_NEGOTIATING ##### -->
-<para>
-
-</para>
-
-@pad: 
-
-
 <!-- ##### MACRO GST_PAD_IS_USABLE ##### -->
 <para>
 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
 
 
-<!-- ##### MACRO GST_PAD_CAN_PULL ##### -->
-<para>
-Checks if buffers can be pulled from this buffer.
-</para>
-
-@pad: a #GstPad to check on if a buffer can be pulled from it.
-
-
 <!-- ##### MACRO GST_PAD_IS_SRC ##### -->
 <para>
 Checks if the pad is a source pad.
@@ -616,33 +571,6 @@ Checks if the pad is a sink pad.
 @event: 
 
 
-<!-- ##### FUNCTION gst_pad_set_event_mask_function ##### -->
-<para>
-
-</para>
-
-@pad: 
-@mask_func: 
-
-
-<!-- ##### FUNCTION gst_pad_get_event_masks ##### -->
-<para>
-
-</para>
-
-@pad: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gst_pad_get_event_masks_default ##### -->
-<para>
-
-</para>
-
-@pad: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gst_pad_set_link_function ##### -->
 <para>
 
@@ -798,68 +726,6 @@ Checks if the pad is a sink pad.
 @Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_set_formats_function ##### -->
-<para>
-
-</para>
-
-@pad: 
-@formats: 
-
-
-<!-- ##### FUNCTION gst_pad_get_formats ##### -->
-<para>
-
-</para>
-
-@pad: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gst_pad_get_formats_default ##### -->
-<para>
-
-</para>
-
-@pad: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gst_pad_set_convert_function ##### -->
-<para>
-
-</para>
-
-@pad: 
-@convert: 
-
-
-<!-- ##### FUNCTION gst_pad_convert ##### -->
-<para>
-
-</para>
-
-@pad: 
-@src_format: 
-@src_value: 
-@dest_format: 
-@dest_value: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gst_pad_convert_default ##### -->
-<para>
-
-</para>
-
-@pad: 
-@src_format: 
-@src_value: 
-@dest_format: 
-@dest_value: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gst_pad_set_query_function ##### -->
 <para>
 
@@ -902,10 +768,12 @@ Checks if the pad is a sink pad.
 </para>
 
 @pad: 
+@query: 
+@Returns: 
+<!-- # Unused Parameters # -->
 @type: 
 @format: 
 @value: 
-@Returns: 
 
 
 <!-- ##### FUNCTION gst_pad_query_default ##### -->
@@ -914,10 +782,12 @@ Checks if the pad is a sink pad.
 </para>
 
 @pad: 
+@query: 
+@Returns: 
+<!-- # Unused Parameters # -->
 @type: 
 @format: 
 @value: 
-@Returns: 
 
 
 <!-- ##### FUNCTION gst_pad_set_internal_link_function ##### -->
index abfbcd6..cc8e82c 100644 (file)
@@ -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
index abfbcd6..cc8e82c 100644 (file)
@@ -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