? gst-p-base-getcaps.patch
Index: gst-libs/gst/rtp/gstbasertppayload.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/rtp/gstbasertppayload.c,v
retrieving revision 1.23
diff -u -p -r1.23 gstbasertppayload.c
--- gst-libs/gst/rtp/gstbasertppayload.c	12 Aug 2007 16:30:36 -0000	1.23
+++ gst-libs/gst/rtp/gstbasertppayload.c	13 Aug 2007 16:50:07 -0000
@@ -89,6 +89,7 @@ static void gst_basertppayload_init (Gst
 static void gst_basertppayload_finalize (GObject * object);
 
 static gboolean gst_basertppayload_setcaps (GstPad * pad, GstCaps * caps);
+static GstCaps * gst_basertppayload_getcaps (GstPad * pad);
 static gboolean gst_basertppayload_event (GstPad * pad, GstEvent * event);
 static GstFlowReturn gst_basertppayload_chain (GstPad * pad,
     GstBuffer * buffer);
@@ -228,6 +229,8 @@ gst_basertppayload_init (GstBaseRTPPaylo
   basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
   gst_pad_set_setcaps_function (basertppayload->sinkpad,
       gst_basertppayload_setcaps);
+  gst_pad_set_getcaps_function (basertppayload->sinkpad,
+      gst_basertppayload_getcaps);
   gst_pad_set_event_function (basertppayload->sinkpad,
       gst_basertppayload_event);
   gst_pad_set_chain_function (basertppayload->sinkpad,
@@ -297,6 +300,35 @@ gst_basertppayload_setcaps (GstPad * pad
   return ret;
 }
 
+
+static GstCaps *
+gst_basertppayload_getcaps (GstPad * pad)
+{
+  GstBaseRTPPayload *basertppayload;
+  GstBaseRTPPayloadClass *basertppayload_class;
+  GstCaps * caps = NULL;
+
+  GST_DEBUG_OBJECT (pad, "getting caps");
+  basertppayload = GST_BASE_RTP_PAYLOAD (gst_pad_get_parent (pad));
+  basertppayload_class = GST_BASE_RTP_PAYLOAD_GET_CLASS (basertppayload);
+
+  if (basertppayload_class->get_caps)
+    caps = basertppayload_class->get_caps (basertppayload, pad);
+
+  if (!caps) {
+    caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
+    GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad,
+        "using pad template %p with caps %p %" GST_PTR_FORMAT, GST_PAD_PAD_TEMPLATE (pad), caps,
+        caps);
+
+    caps = gst_caps_ref (caps);
+  }
+
+  gst_object_unref (basertppayload);
+
+  return caps;
+}
+
 static gboolean
 gst_basertppayload_event (GstPad * pad, GstEvent * event)
 {
Index: gst-libs/gst/rtp/gstbasertppayload.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/rtp/gstbasertppayload.h,v
retrieving revision 1.11
diff -u -p -r1.11 gstbasertppayload.h
--- gst-libs/gst/rtp/gstbasertppayload.h	12 Aug 2007 16:30:36 -0000	1.11
+++ gst-libs/gst/rtp/gstbasertppayload.h	13 Aug 2007 16:50:07 -0000
@@ -122,9 +122,10 @@ struct _GstBaseRTPPayloadClass
   GstFlowReturn (*handle_buffer)        (GstBaseRTPPayload *payload, 
                                          GstBuffer *buffer);
   gboolean      (*handle_event)         (GstPad * pad, GstEvent * event);
+  GstCaps *     (*get_caps)             (GstBaseRTPPayload *payload, GstPad * pad);
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING-1];
+  gpointer _gst_reserved[GST_PADDING-2];
 };
 
 GType           gst_basertppayload_get_type             (void);
