? gst-wip.patch
? gstreamer-proxy-pad-alloc-20050418-1.patch
Index: gstelement.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstelement.h,v
retrieving revision 1.178
diff -u -b -r1.178 gstelement.h
--- gstelement.h	24 Jan 2005 17:04:08 -0000	1.178
+++ gstelement.h	18 Apr 2005 22:09:51 -0000
@@ -126,6 +126,9 @@
   /* element is in error */
   GST_ELEMENT_IN_ERROR,
 
+  /* element doesn't change passed buffer or change it in place */
+  GST_ELEMENT_WORK_IN_PLACE,
+  
   /* use some padding for future expansion */
   GST_ELEMENT_FLAG_LAST		= GST_OBJECT_FLAG_LAST + 16
 } GstElementFlags;
Index: gstpad.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstpad.c,v
retrieving revision 1.357.2.1
diff -u -b -r1.357.2.1 gstpad.c
--- gstpad.c	3 Mar 2005 18:39:49 -0000	1.357.2.1
+++ gstpad.c	18 Apr 2005 22:09:55 -0000
@@ -2979,7 +2979,8 @@
 
   peer = GST_RPAD_PEER (pad);
 
-  if (peer && peer->bufferallocfunc) {
+  while (peer) {
+    if (peer->bufferallocfunc) {
     GstBuffer *ret;
 
     GST_CAT_DEBUG (GST_CAT_BUFFER, "(%s:%s): getting buffer",
@@ -2992,7 +2993,26 @@
     ret = (peer->bufferallocfunc) (GST_PAD (peer), offset, size);
     if (ret)
       return ret;
+      else
+	break;
+    }else {
+      /* 
+	 there is a peer but it doesn't have a bufferallocfunc.
+	 Try to proxy the request if GST_ELEMENT_WORK_IN_PLACE
+	 is setted	   
+      */
+      GstElement *parent = GST_PAD_PARENT (peer);
+      if (parent == NULL) break;
+      if (GST_FLAG_IS_SET(parent, GST_ELEMENT_WORK_IN_PLACE)) {
+	/* get the src pad. don't proxy if src pad numbers != 1 */
+	GstPad *src = gst_element_get_pad (parent, "src");
+	if (src == NULL) break;
+	peer = GST_RPAD_PEER (src);
+      }else
+	break; 
   }
+  }
+
   return gst_buffer_new_and_alloc (size);
 }
 
Index: gstqueue.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstqueue.c,v
retrieving revision 1.117.2.3
diff -u -b -r1.117.2.3 gstqueue.c
--- gstqueue.c	9 Mar 2005 11:45:03 -0000	1.117.2.3
+++ gstqueue.c	18 Apr 2005 22:09:57 -0000
@@ -354,6 +354,8 @@
 
   GST_CAT_DEBUG_OBJECT (GST_CAT_THREAD, queue,
       "initialized queue's not_empty & not_full conditions");
+
+  GST_FLAG_SET (queue, GST_ELEMENT_WORK_IN_PLACE);
 }
 
 /* called only once, as opposed to dispose */
Index: elements/gstidentity.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/elements/gstidentity.c,v
retrieving revision 1.70
diff -u -b -r1.70 gstidentity.c
--- elements/gstidentity.c	8 Nov 2004 15:45:31 -0000	1.70
+++ elements/gstidentity.c	18 Apr 2005 22:09:57 -0000
@@ -227,6 +227,8 @@
   identity->srccaps = NULL;
 
   GST_FLAG_SET (identity, GST_ELEMENT_EVENT_AWARE);
+  GST_FLAG_SET (identity, GST_ELEMENT_WORK_IN_PLACE);
+
 }
 
 static void
