Index: gst-libs/gst/rtp/gstbasertppayload.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/rtp/gstbasertppayload.c,v
retrieving revision 1.22
diff -u -p -r1.22 gstbasertppayload.c
--- gst-libs/gst/rtp/gstbasertppayload.c	16 Jul 2007 10:10:28 -0000	1.22
+++ gst-libs/gst/rtp/gstbasertppayload.c	10 Aug 2007 16:36:20 -0000
@@ -396,17 +396,48 @@ gst_basertppayload_set_outcaps (GstBaseR
 {
   GstCaps *srccaps;
   GstStructure *s;
+  const GValue *value;
+
+  srccaps = gst_pad_get_allowed_caps(payload->srcpad);
+
+  if (gst_caps_is_empty (srccaps)) {
+    gst_caps_unref (srccaps);
+    return FALSE;
+  }
+
+  srccaps = gst_caps_make_writable (srccaps);
 
-  srccaps = gst_caps_new_simple ("application/x-rtp",
-      "media", G_TYPE_STRING, payload->media,
-      "payload", G_TYPE_INT, GST_BASE_RTP_PAYLOAD_PT (payload),
-      "clock-rate", G_TYPE_INT, payload->clock_rate,
-      "encoding-name", G_TYPE_STRING, payload->encoding_name,
-      "ssrc", G_TYPE_UINT, payload->current_ssrc,
-      "clock-base", G_TYPE_UINT, payload->ts_base,
-      "seqnum-base", G_TYPE_UINT, payload->seqnum_base, NULL);
   s = gst_caps_get_structure (srccaps, 0);
 
+  if (!gst_structure_get_int (s,
+          "payload", &GST_BASE_RTP_PAYLOAD_PT (payload))) {
+    gst_structure_set (s,
+        "payload", G_TYPE_INT, GST_BASE_RTP_PAYLOAD_PT (payload), NULL);
+  }
+
+  if (gst_structure_has_field_typed (s, "ssrc", G_TYPE_UINT)) {
+    value = gst_structure_get_value (s, "ssrc");
+    payload->current_ssrc = g_value_get_uint (value);
+  } else {
+    gst_structure_set (s, "ssrc", G_TYPE_UINT, payload->current_ssrc, NULL);
+  }
+
+  if (gst_structure_has_field_typed (s, "clock-base", G_TYPE_UINT)) {
+    value = gst_structure_get_value (s, "clock-base");
+    payload->ts_base = g_value_get_uint (value);
+  } else {
+    gst_structure_set (s, "clock-base", G_TYPE_UINT, payload->ts_base, NULL);
+  }
+
+  if (gst_structure_has_field_typed (s, "seqnum-base", G_TYPE_UINT)) {
+    value = gst_structure_get_value (s, "seqnum-base");
+    payload->seqnum_base = g_value_get_uint (value);
+  } else {
+    gst_structure_set (s, "seqnum-base", G_TYPE_UINT, payload->seqnum_base,
+        NULL);
+  }
+
+
   if (fieldname) {
     va_list varargs;
 
