#define MAX_RTP_EXT_ID 256
+#define GST_RTP_HEADER_EXTENSION_DIRECTION_DEFAULT \
+ (GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV | \
+ GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED)
+
typedef struct
{
guint ext_id;
gboolean wants_update_non_rtp_src_caps;
+ GstRTPHeaderExtensionDirection direction;
} GstRTPHeaderExtensionPrivate;
/**
gst_rtp_header_extension_get_instance_private (ext);
priv->ext_id = G_MAXUINT32;
+ priv->direction = GST_RTP_HEADER_EXTENSION_DIRECTION_DEFAULT;
}
/**
return NULL;
}
+
+/**
+ * gst_rtp_header_extension_set_direction:
+ * @ext: the #GstRTPHeaderExtension
+ * @direction: The direction
+ *
+ * Set the direction that this header extension should be used in.
+ * If #GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED is included, the
+ * direction will not be included in the caps (as it shouldn't be in the
+ * extmap line in the SDP).
+ *
+ * Since: 1.20
+ */
+
+void
+gst_rtp_header_extension_set_direction (GstRTPHeaderExtension * ext,
+ GstRTPHeaderExtensionDirection direction)
+{
+ GstRTPHeaderExtensionPrivate *priv =
+ gst_rtp_header_extension_get_instance_private (ext);
+
+ g_return_if_fail (GST_IS_RTP_HEADER_EXTENSION (ext));
+ g_return_if_fail (direction <= GST_RTP_HEADER_EXTENSION_DIRECTION_DEFAULT);
+
+ priv->direction = direction;
+}
+
+/**
+ * gst_rtp_header_extension_get_direction:
+ * @ext: the #GstRTPHeaderExtension
+ *
+ * Retrieve the direction
+ *
+ * Returns: The direction
+ *
+ * Since: 1.20
+ */
+
+GstRTPHeaderExtensionDirection
+gst_rtp_header_extension_get_direction (GstRTPHeaderExtension * ext)
+{
+ GstRTPHeaderExtensionPrivate *priv =
+ gst_rtp_header_extension_get_instance_private (ext);
+
+ g_return_val_if_fail (GST_IS_RTP_HEADER_EXTENSION (ext),
+ GST_RTP_HEADER_EXTENSION_DIRECTION_DEFAULT);
+
+ return priv->direction;
+}
} GstRTPHeaderExtensionFlags;
/**
+ * GstRTPHeaderExtensionDirection:
+ * @GST_RTP_HEADER_EXTENSION_DIRECTION_INACTIVE: Neither send nor
+ * receive RTP Header Extensions
+ * @GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY: Only send RTP Header
+ * Extensions @GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY: Only
+ * receive RTP Header Extensions
+ * @GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV: Send and receive RTP
+ * Header Extensions ext
+ * @GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED: RTP header extension
+ * direction is inherited from the stream
+ *
+ * Direction to which to apply the RTP Header Extension
+ *
+ * Since: 1.20
+ */
+typedef enum /*< underscore_name=gst_rtp_header_extension_direction >*/
+{
+ GST_RTP_HEADER_EXTENSION_DIRECTION_INACTIVE = 0,
+ GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY = (1 << 0),
+ GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY = (1 << 1),
+ GST_RTP_HEADER_EXTENSION_DIRECTION_SENDRECV = (
+ GST_RTP_HEADER_EXTENSION_DIRECTION_SENDONLY |
+ GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY),
+ GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED = (1 << 2)
+} GstRTPHeaderExtensionDirection;
+
+/**
* GstRTPHeaderExtension:
* @parent: the parent #GObject
* @ext_id: the configured extension id
GST_RTP_API
gchar * gst_rtp_header_extension_get_sdp_caps_field_name (GstRTPHeaderExtension * ext);
+GST_RTP_API
+void gst_rtp_header_extension_set_direction (GstRTPHeaderExtension * ext,
+ GstRTPHeaderExtensionDirection direction);
+GST_RTP_API
+GstRTPHeaderExtensionDirection gst_rtp_header_extension_get_direction (GstRTPHeaderExtension * ext);
+
G_END_DECLS
#endif /* __GST_RTPHDREXT_H__ */