From: Olivier CrĂȘte Date: Sun, 22 Aug 2010 21:22:21 +0000 (-0400) Subject: rtpbuffer: Add function to read RFC 5285 header extensions from GstBufferLists X-Git-Tag: 1.19.3~511^2~7982 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb770ca5e5c5ec36b2eda016073824b265d631d6;p=platform%2Fupstream%2Fgstreamer.git rtpbuffer: Add function to read RFC 5285 header extensions from GstBufferLists --- diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 706e63f..b9184f8 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -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 # rtsp diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c index f786d96..4919dc8 100644 --- a/gst-libs/gst/rtp/gstrtpbuffer.c +++ b/gst-libs/gst/rtp/gstrtpbuffer.c @@ -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); +} diff --git a/gst-libs/gst/rtp/gstrtpbuffer.h b/gst-libs/gst/rtp/gstrtpbuffer.h index 6c459c6..a1e5ee6 100644 --- a/gst-libs/gst/rtp/gstrtpbuffer.h +++ b/gst-libs/gst/rtp/gstrtpbuffer.h @@ -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__ */