payload->priv->header_exts);
g_ptr_array_foreach (to_add, (GFunc) add_item_to,
payload->priv->header_exts);
+ /* let extensions update their internal state from sinkcaps */
+ if (payload->priv->sinkcaps) {
+ gint i;
+
+ for (i = 0; i < payload->priv->header_exts->len; i++) {
+ GstRTPHeaderExtension *ext;
+
+ ext = g_ptr_array_index (payload->priv->header_exts, i);
+ if (!gst_rtp_header_extension_set_non_rtp_sink_caps (ext,
+ payload->priv->sinkcaps)) {
+ GST_WARNING_OBJECT (payload,
+ "Failed to update rtp header extension (%s) from sink caps",
+ GST_OBJECT_NAME (ext));
+ res = FALSE;
+ GST_OBJECT_UNLOCK (payload);
+ goto ext_out;
+ }
+ }
+ }
/* add extension information to srccaps */
g_ptr_array_foreach (payload->priv->header_exts,
(GFunc) add_header_ext_to_caps, srccaps);
}
/**
+ * gst_rtp_header_extension_set_non_rtp_sink_caps:
+ * @ext: a #GstRTPHeaderExtension
+ * @caps: sink #GstCaps
+ *
+ * Passes RTP payloader's sink (i.e. not payloaded) @caps to the header
+ * extension.
+ *
+ * Returns: Whether @caps could be read successfully
+ *
+ * Since: 1.20
+ */
+gboolean
+gst_rtp_header_extension_set_non_rtp_sink_caps (GstRTPHeaderExtension * ext,
+ const GstCaps * caps)
+{
+ GstRTPHeaderExtensionClass *klass;
+
+ g_return_val_if_fail (GST_IS_CAPS (caps), FALSE);
+ g_return_val_if_fail (GST_IS_RTP_HEADER_EXTENSION (ext), FALSE);
+ g_return_val_if_fail (ext->ext_id <= MAX_RTP_EXT_ID, FALSE);
+ klass = GST_RTP_HEADER_EXTENSION_GET_CLASS (ext);
+
+ if (klass->set_non_rtp_sink_caps) {
+ return klass->set_non_rtp_sink_caps (ext, caps);
+ }
+
+ return TRUE;
+}
+
+/**
* gst_rtp_header_extension_set_caps_from_attributes:
* @ext: a #GstRTPHeaderExtension
* @caps: writable #GstCaps to modify
* information is provided to help writing extensions in particular cases.
* @read: read from a rtp payloaded buffer and extract the extension
* information, optionally adding some meta onto the output buffer.
- * @set_attributes_from_caps: read the caps information to set the necesary
+ * @set_non_rtp_sink_caps: read any information from sink caps that the header
+ * extension needs for its function.
+ * @set_attributes_from_caps: read the caps information to set the necessary
* attributes that may be signaled e.g. with an SDP.
* @set_caps_from_attributes: write the necessary caps field/s for the configured
* attributes e.g. as signalled with SDP.
const guint8 * data,
gsize size,
GstBuffer * buffer);
+ gboolean (*set_non_rtp_sink_caps) (GstRTPHeaderExtension * ext,
+ const GstCaps * caps);
gboolean (*set_attributes_from_caps) (GstRTPHeaderExtension * ext,
const GstCaps * caps);
gboolean (*set_caps_from_attributes) (GstRTPHeaderExtension * ext,
gsize size,
GstBuffer * buffer);
GST_RTP_API
+gboolean gst_rtp_header_extension_set_non_rtp_sink_caps (GstRTPHeaderExtension * ext,
+ const GstCaps * caps);
+GST_RTP_API
gboolean gst_rtp_header_extension_set_caps_from_attributes (GstRTPHeaderExtension * ext,
GstCaps * caps);
GST_RTP_API