+2007-09-19 Wim Taymans <wim.taymans@gmail.com>
+
+ * gst-libs/gst/rtp/gstbasertppayload.c: (copy_fixed),
+ (gst_basertppayload_set_outcaps):
+ Fix compilation because of missing %d in printf.
+ When fixating caps, fixate what we can and throw away all remaining
+ unfixed caps, subclasses should do something smart if they need to.
+
2007-09-19 Stefan Kost <ensonic@users.sf.net>
* ext/gnomevfs/gstgnomevfssrc.c:
payload->clock_rate = clock_rate;
}
+gboolean
+copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
+{
+ if (gst_value_is_fixed (value)) {
+ gst_structure_id_set_value (dest, field_id, value);
+ }
+ return TRUE;
+}
+
/**
* gst_basertppayload_set_outcaps:
* @payload: a #GstBaseRTPPayload
GST_DEBUG_OBJECT (payload, "no peer caps: %" GST_PTR_FORMAT, srccaps);
} else {
GstCaps *temp;
- GstStructure *s;
+ GstStructure *s, *d;
const GValue *value;
gint pt;
/* now fixate, start by taking the first caps */
gst_caps_truncate (temp);
- srccaps = temp;
/* get first structure */
- s = gst_caps_get_structure (srccaps, 0);
+ s = gst_caps_get_structure (temp, 0);
if (gst_structure_get_int (s, "payload", &pt)) {
/* use peer pt */
/* no pt field, use the internal pt */
pt = GST_BASE_RTP_PAYLOAD_PT (payload);
gst_structure_set (s, "payload", G_TYPE_INT, pt, NULL);
- GST_LOG_OBJECT (payload, "using internal pt", pt);
+ GST_LOG_OBJECT (payload, "using internal pt %d", pt);
}
}
GST_LOG_OBJECT (payload, "using internal seqnum-base %u",
payload->seqnum_base);
}
+
+ /* make the target caps by copying over all the fixed caps, removing the
+ * unfixed caps. */
+ srccaps = gst_caps_new_simple (gst_structure_get_name (s), NULL);
+ d = gst_caps_get_structure (srccaps, 0);
+
+ gst_structure_foreach (s, (GstStructureForeachFunc) copy_fixed, d);
+
GST_DEBUG_OBJECT (payload, "with peer caps: %" GST_PTR_FORMAT, srccaps);
}