rtpbuffer: Add function to read RFC 5285 header extensions from GstBufferLists
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>
Sun, 22 Aug 2010 21:22:21 +0000 (17:22 -0400)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 5 Oct 2010 14:19:14 +0000 (16:19 +0200)
docs/libs/gst-plugins-base-libs-sections.txt
gst-libs/gst/rtp/gstrtpbuffer.c
gst-libs/gst/rtp/gstrtpbuffer.h

index 706e63f..b9184f8 100644 (file)
@@ -1362,6 +1362,9 @@ gst_rtp_buffer_get_extension_twobytes_header
 
 gst_rtp_buffer_add_extension_onebyte_header
 gst_rtp_buffer_add_extension_twobytes_header
+
+gst_rtp_buffer_list_get_extension_onebyte_header
+gst_rtp_buffer_list_get_extension_twobytes_header
 </SECTION>
 
 # rtsp
index f786d96..4919dc8 100644 (file)
@@ -1760,3 +1760,70 @@ gst_rtp_buffer_add_extension_twobytes_header (GstBuffer * buffer,
 
   return TRUE;
 }
+
+/**
+ * gst_rtp_buffer_list_get_extension_onebyte_header:
+ * @bufferlist: the bufferlist
+ * @group_idx: The index of the group in the #GstBufferList
+ * @id: The ID of the header extension to be read (between 1 and 14).
+ * @nth: Read the nth extension packet with the requested ID
+ * @data: location for data
+ * @size: the size of the data in bytes
+ *
+ * Parses RFC 5285 style header extensions with a one byte header. It will
+ * return the nth extension with the requested id.
+ *
+ * Returns: TRUE if @buffer had the requested header extension
+ *
+ * Since: 0.10.31
+ */
+
+gboolean
+gst_rtp_buffer_list_get_extension_onebyte_header (GstBufferList * bufferlist,
+    guint group_idx, guint8 id, guint nth, gpointer * data, guint * size)
+{
+  GstBuffer *buffer;
+
+  buffer = gst_buffer_list_get (bufferlist, group_idx, 0);
+
+  if (!buffer)
+    return FALSE;
+
+  return gst_rtp_buffer_get_extension_onebyte_header (buffer, id, nth, data,
+      size);
+}
+
+
+/**
+ * gst_rtp_buffer_list_get_extension_twobytes_header:
+ * @bufferlist: the bufferlist
+ * @group_idx: The index of the group in the #GstBufferList
+ * @appbits: Application specific bits
+ * @id: The ID of the header extension to be read (between 1 and 14).
+ * @nth: Read the nth extension packet with the requested ID
+ * @data: location for data
+ * @size: the size of the data in bytes
+ *
+ * Parses RFC 5285 style header extensions with a two bytes header. It will
+ * return the nth extension with the requested id.
+ *
+ * Returns: TRUE if @buffer had the requested header extension
+ *
+ * Since: 0.10.31
+ */
+
+gboolean
+gst_rtp_buffer_list_get_extension_twobytes_header (GstBufferList * bufferlist,
+    guint group_idx, guint8 * appbits, guint8 id, guint nth,
+    gpointer * data, guint * size)
+{
+  GstBuffer *buffer;
+
+  buffer = gst_buffer_list_get (bufferlist, group_idx, 0);
+
+  if (!buffer)
+    return FALSE;
+
+  return gst_rtp_buffer_get_extension_twobytes_header (buffer, appbits, id,
+      nth, data, size);
+}
index 6c459c6..a1e5ee6 100644 (file)
@@ -131,6 +131,21 @@ gboolean       gst_rtp_buffer_add_extension_twobytes_header (GstBuffer * buffer,
                                                              guint8 id,
                                                              gpointer data,
                                                              guint size);
+
+gboolean       gst_rtp_buffer_list_get_extension_onebyte_header (GstBufferList * bufferlist,
+                                                                 guint group_idx,
+                                                                 guint8 id,
+                                                                 guint nth,
+                                                                 gpointer * data,
+                                                                 guint * size);
+gboolean       gst_rtp_buffer_list_get_extension_twobytes_header (GstBufferList * bufferlist,
+                                                                  guint group_idx,
+                                                                  guint8 * appbits,
+                                                                  guint8 id,
+                                                                  guint nth,
+                                                                  gpointer * data,
+                                                                  guint * size);
+
 G_END_DECLS
 
 #endif /* __GST_RTPBUFFER_H__ */