2005-07-14 10:29:30 +00:00
|
|
|
/* GStreamer
|
2006-09-14 20:09:19 +00:00
|
|
|
* Copyright (C) <2005> Philippe Khalaf <burger@speedy.org>
|
|
|
|
* Copyright (C) <2006> Wim Taymans <wim@fluendo.com>
|
2005-07-14 10:29:30 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2005-07-14 10:29:30 +00:00
|
|
|
*/
|
|
|
|
|
2006-07-19 18:20:43 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gstrtpbuffer
|
2017-01-23 19:36:11 +00:00
|
|
|
* @title: GstRTPBuffer
|
2006-07-19 18:20:43 +00:00
|
|
|
* @short_description: Helper methods for dealing with RTP buffers
|
2011-11-11 11:24:08 +00:00
|
|
|
* @see_also: #GstRTPBasePayload, #GstRTPBaseDepayload, gstrtcpbuffer
|
2006-07-19 18:20:43 +00:00
|
|
|
*
|
2017-01-23 19:36:11 +00:00
|
|
|
* The GstRTPBuffer helper functions makes it easy to parse and create regular
|
2006-07-19 18:20:43 +00:00
|
|
|
* #GstBuffer objects that contain RTP payloads. These buffers are typically of
|
|
|
|
* 'application/x-rtp' #GstCaps.
|
2017-01-23 19:36:11 +00:00
|
|
|
*
|
2006-07-19 18:20:43 +00:00
|
|
|
*/
|
2018-04-28 13:50:11 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2006-07-19 18:20:43 +00:00
|
|
|
|
2005-07-14 10:29:30 +00:00
|
|
|
#include "gstrtpbuffer.h"
|
|
|
|
|
2007-09-05 14:09:15 +00:00
|
|
|
#include <stdlib.h>
|
2007-09-07 17:37:03 +00:00
|
|
|
#include <string.h>
|
2007-09-05 14:09:15 +00:00
|
|
|
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
#define GST_RTP_HEADER_LEN 12
|
|
|
|
|
2007-09-07 16:46:05 +00:00
|
|
|
/* Note: we use bitfields here to make sure the compiler doesn't add padding
|
|
|
|
* between fields on certain architectures; can't assume aligned access either
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
typedef struct _GstRTPHeader
|
|
|
|
{
|
|
|
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
|
|
|
unsigned int csrc_count:4; /* CSRC count */
|
|
|
|
unsigned int extension:1; /* header extension flag */
|
|
|
|
unsigned int padding:1; /* padding flag */
|
|
|
|
unsigned int version:2; /* protocol version */
|
|
|
|
unsigned int payload_type:7; /* payload type */
|
|
|
|
unsigned int marker:1; /* marker bit */
|
|
|
|
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
|
|
|
unsigned int version:2; /* protocol version */
|
|
|
|
unsigned int padding:1; /* padding flag */
|
|
|
|
unsigned int extension:1; /* header extension flag */
|
|
|
|
unsigned int csrc_count:4; /* CSRC count */
|
|
|
|
unsigned int marker:1; /* marker bit */
|
|
|
|
unsigned int payload_type:7; /* payload type */
|
|
|
|
#else
|
|
|
|
#error "G_BYTE_ORDER should be big or little endian."
|
|
|
|
#endif
|
2007-09-07 16:46:05 +00:00
|
|
|
unsigned int seq:16; /* sequence number */
|
|
|
|
unsigned int timestamp:32; /* timestamp */
|
|
|
|
unsigned int ssrc:32; /* synchronization source */
|
|
|
|
guint8 csrclist[4]; /* optional CSRC list, 32 bits each */
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
} GstRTPHeader;
|
|
|
|
|
2009-06-18 16:03:40 +00:00
|
|
|
#define GST_RTP_HEADER_VERSION(data) (((GstRTPHeader *)(data))->version)
|
|
|
|
#define GST_RTP_HEADER_PADDING(data) (((GstRTPHeader *)(data))->padding)
|
|
|
|
#define GST_RTP_HEADER_EXTENSION(data) (((GstRTPHeader *)(data))->extension)
|
|
|
|
#define GST_RTP_HEADER_CSRC_COUNT(data) (((GstRTPHeader *)(data))->csrc_count)
|
|
|
|
#define GST_RTP_HEADER_MARKER(data) (((GstRTPHeader *)(data))->marker)
|
|
|
|
#define GST_RTP_HEADER_PAYLOAD_TYPE(data) (((GstRTPHeader *)(data))->payload_type)
|
|
|
|
#define GST_RTP_HEADER_SEQ(data) (((GstRTPHeader *)(data))->seq)
|
|
|
|
#define GST_RTP_HEADER_TIMESTAMP(data) (((GstRTPHeader *)(data))->timestamp)
|
|
|
|
#define GST_RTP_HEADER_SSRC(data) (((GstRTPHeader *)(data))->ssrc)
|
|
|
|
#define GST_RTP_HEADER_CSRC_LIST_OFFSET(data,i) \
|
|
|
|
data + G_STRUCT_OFFSET(GstRTPHeader, csrclist) + \
|
2007-09-07 16:46:05 +00:00
|
|
|
((i) * sizeof(guint32))
|
2009-06-18 16:03:40 +00:00
|
|
|
#define GST_RTP_HEADER_CSRC_SIZE(data) (GST_RTP_HEADER_CSRC_COUNT(data) * sizeof (guint32))
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_allocate_data:
|
|
|
|
* @buffer: a #GstBuffer
|
|
|
|
* @payload_len: the length of the payload
|
|
|
|
* @pad_len: the amount of padding
|
|
|
|
* @csrc_count: the number of CSRC entries
|
|
|
|
*
|
|
|
|
* Allocate enough data in @buffer to hold an RTP packet with @csrc_count CSRCs,
|
|
|
|
* a payload length of @payload_len and padding of @pad_len.
|
2012-04-04 07:33:30 +00:00
|
|
|
* @buffer must be writable and all previous memory in @buffer will be freed.
|
2012-08-22 07:46:38 +00:00
|
|
|
* If @pad_len is >0, the padding bit will be set. All other RTP header fields
|
|
|
|
* will be set to 0/FALSE.
|
2006-08-18 16:43:26 +00:00
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_allocate_data (GstBuffer * buffer, guint payload_len,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8 pad_len, guint8 csrc_count)
|
|
|
|
{
|
2012-01-24 13:37:12 +00:00
|
|
|
GstMapInfo map;
|
2011-03-27 11:55:15 +00:00
|
|
|
GstMemory *mem;
|
2012-08-22 07:46:38 +00:00
|
|
|
gsize hlen;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
|
|
|
g_return_if_fail (csrc_count <= 15);
|
|
|
|
g_return_if_fail (GST_IS_BUFFER (buffer));
|
2012-04-04 07:33:30 +00:00
|
|
|
g_return_if_fail (gst_buffer_is_writable (buffer));
|
|
|
|
|
|
|
|
gst_buffer_remove_all_memory (buffer);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
hlen = GST_RTP_HEADER_LEN + csrc_count * sizeof (guint32);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
mem = gst_allocator_alloc (NULL, hlen, NULL);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2012-01-24 13:37:12 +00:00
|
|
|
gst_memory_map (mem, &map, GST_MAP_WRITE);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
/* fill in defaults */
|
2012-01-24 13:37:12 +00:00
|
|
|
GST_RTP_HEADER_VERSION (map.data) = GST_RTP_VERSION;
|
2012-08-22 07:46:38 +00:00
|
|
|
if (pad_len)
|
|
|
|
GST_RTP_HEADER_PADDING (map.data) = TRUE;
|
|
|
|
else
|
|
|
|
GST_RTP_HEADER_PADDING (map.data) = FALSE;
|
2012-01-24 13:37:12 +00:00
|
|
|
GST_RTP_HEADER_EXTENSION (map.data) = FALSE;
|
|
|
|
GST_RTP_HEADER_CSRC_COUNT (map.data) = csrc_count;
|
|
|
|
memset (GST_RTP_HEADER_CSRC_LIST_OFFSET (map.data, 0), 0,
|
2007-09-07 17:37:03 +00:00
|
|
|
csrc_count * sizeof (guint32));
|
2012-01-24 13:37:12 +00:00
|
|
|
GST_RTP_HEADER_MARKER (map.data) = FALSE;
|
|
|
|
GST_RTP_HEADER_PAYLOAD_TYPE (map.data) = 0;
|
|
|
|
GST_RTP_HEADER_SEQ (map.data) = 0;
|
|
|
|
GST_RTP_HEADER_TIMESTAMP (map.data) = 0;
|
|
|
|
GST_RTP_HEADER_SSRC (map.data) = 0;
|
|
|
|
gst_memory_unmap (mem, &map);
|
2011-03-27 11:55:15 +00:00
|
|
|
|
2012-03-30 16:12:39 +00:00
|
|
|
gst_buffer_append_memory (buffer, mem);
|
2012-08-22 07:46:38 +00:00
|
|
|
|
|
|
|
if (payload_len) {
|
|
|
|
mem = gst_allocator_alloc (NULL, payload_len, NULL);
|
|
|
|
gst_buffer_append_memory (buffer, mem);
|
|
|
|
}
|
|
|
|
if (pad_len) {
|
|
|
|
mem = gst_allocator_alloc (NULL, pad_len, NULL);
|
|
|
|
|
|
|
|
gst_memory_map (mem, &map, GST_MAP_WRITE);
|
|
|
|
map.data[pad_len - 1] = pad_len;
|
|
|
|
gst_memory_unmap (mem, &map);
|
|
|
|
|
|
|
|
gst_buffer_append_memory (buffer, mem);
|
|
|
|
}
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_new_take_data:
|
2012-07-07 06:42:13 +00:00
|
|
|
* @data: (array length=len) (transfer full) (element-type guint8):
|
|
|
|
* data for the new buffer
|
2006-08-18 16:43:26 +00:00
|
|
|
* @len: the length of data
|
|
|
|
*
|
|
|
|
* Create a new buffer and set the data and size of the buffer to @data and @len
|
|
|
|
* respectively. @data will be freed when the buffer is unreffed, so this
|
|
|
|
* function transfers ownership of @data to the new buffer.
|
|
|
|
*
|
|
|
|
* Returns: A newly allocated buffer with @data and of size @len.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer *
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_new_take_data (gpointer data, gsize len)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (data != NULL, NULL);
|
|
|
|
g_return_val_if_fail (len > 0, NULL);
|
|
|
|
|
2012-04-01 16:11:23 +00:00
|
|
|
return gst_buffer_new_wrapped (data, len);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_new_copy_data:
|
2012-07-07 06:42:13 +00:00
|
|
|
* @data: (array length=len) (element-type guint8): data for the new
|
|
|
|
* buffer
|
2006-08-18 16:43:26 +00:00
|
|
|
* @len: the length of data
|
|
|
|
*
|
|
|
|
* Create a new buffer and set the data to a copy of @len
|
|
|
|
* bytes of @data and the size to @len. The data will be freed when the buffer
|
|
|
|
* is freed.
|
|
|
|
*
|
|
|
|
* Returns: A newly allocated buffer with a copy of @data and of size @len.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer *
|
2017-11-17 12:07:22 +00:00
|
|
|
gst_rtp_buffer_new_copy_data (gconstpointer data, gsize len)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2021-05-23 22:51:27 +00:00
|
|
|
return gst_rtp_buffer_new_take_data (g_memdup2 (data, len), len);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_new_allocate:
|
|
|
|
* @payload_len: the length of the payload
|
|
|
|
* @pad_len: the amount of padding
|
|
|
|
* @csrc_count: the number of CSRC entries
|
|
|
|
*
|
2010-03-15 23:46:39 +00:00
|
|
|
* Allocate a new #GstBuffer with enough data to hold an RTP packet with
|
|
|
|
* @csrc_count CSRCs, a payload length of @payload_len and padding of @pad_len.
|
2006-08-18 16:43:26 +00:00
|
|
|
* All other RTP header fields will be set to 0/FALSE.
|
|
|
|
*
|
|
|
|
* Returns: A newly allocated buffer that can hold an RTP packet with given
|
|
|
|
* parameters.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer *
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_new_allocate (guint payload_len, guint8 pad_len,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8 csrc_count)
|
|
|
|
{
|
|
|
|
GstBuffer *result;
|
|
|
|
|
|
|
|
g_return_val_if_fail (csrc_count <= 15, NULL);
|
|
|
|
|
|
|
|
result = gst_buffer_new ();
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_allocate_data (result, payload_len, pad_len, csrc_count);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_new_allocate_len:
|
2011-11-14 09:46:56 +00:00
|
|
|
* @packet_len: the total length of the packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @pad_len: the amount of padding
|
|
|
|
* @csrc_count: the number of CSRC entries
|
|
|
|
*
|
|
|
|
* Create a new #GstBuffer that can hold an RTP packet that is exactly
|
|
|
|
* @packet_len long. The length of the payload depends on @pad_len and
|
|
|
|
* @csrc_count and can be calculated with gst_rtp_buffer_calc_payload_len().
|
|
|
|
* All RTP header fields will be set to 0/FALSE.
|
|
|
|
*
|
|
|
|
* Returns: A newly allocated buffer that can hold an RTP packet of @packet_len.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
GstBuffer *
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_new_allocate_len (guint packet_len, guint8 pad_len,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8 csrc_count)
|
|
|
|
{
|
|
|
|
guint len;
|
|
|
|
|
|
|
|
g_return_val_if_fail (csrc_count <= 15, NULL);
|
|
|
|
|
2005-12-01 14:29:59 +00:00
|
|
|
len = gst_rtp_buffer_calc_payload_len (packet_len, pad_len, csrc_count);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2005-12-01 14:29:59 +00:00
|
|
|
return gst_rtp_buffer_new_allocate (len, pad_len, csrc_count);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_calc_header_len:
|
|
|
|
* @csrc_count: the number of CSRC entries
|
|
|
|
*
|
|
|
|
* Calculate the header length of an RTP packet with @csrc_count CSRC entries.
|
|
|
|
* An RTP packet can have at most 15 CSRC entries.
|
|
|
|
*
|
|
|
|
* Returns: The length of an RTP header with @csrc_count CSRC entries.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_calc_header_len (guint8 csrc_count)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (csrc_count <= 15, 0);
|
|
|
|
|
|
|
|
return GST_RTP_HEADER_LEN + (csrc_count * sizeof (guint32));
|
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_calc_packet_len:
|
|
|
|
* @payload_len: the length of the payload
|
|
|
|
* @pad_len: the amount of padding
|
|
|
|
* @csrc_count: the number of CSRC entries
|
|
|
|
*
|
|
|
|
* Calculate the total length of an RTP packet with a payload size of @payload_len,
|
|
|
|
* a padding of @pad_len and a @csrc_count CSRC entries.
|
|
|
|
*
|
|
|
|
* Returns: The total length of an RTP header with given parameters.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_calc_packet_len (guint payload_len, guint8 pad_len,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8 csrc_count)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (csrc_count <= 15, 0);
|
|
|
|
|
|
|
|
return payload_len + GST_RTP_HEADER_LEN + (csrc_count * sizeof (guint32))
|
|
|
|
+ pad_len;
|
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_calc_payload_len:
|
|
|
|
* @packet_len: the length of the total RTP packet
|
|
|
|
* @pad_len: the amount of padding
|
|
|
|
* @csrc_count: the number of CSRC entries
|
|
|
|
*
|
|
|
|
* Calculate the length of the payload of an RTP packet with size @packet_len,
|
|
|
|
* a padding of @pad_len and a @csrc_count CSRC entries.
|
|
|
|
*
|
|
|
|
* Returns: The length of the payload of an RTP packet with given parameters.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint
|
2005-12-01 14:29:59 +00:00
|
|
|
gst_rtp_buffer_calc_payload_len (guint packet_len, guint8 pad_len,
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8 csrc_count)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (csrc_count <= 15, 0);
|
|
|
|
|
2014-05-02 14:09:35 +00:00
|
|
|
if (packet_len <
|
|
|
|
GST_RTP_HEADER_LEN + (csrc_count * sizeof (guint32)) + pad_len)
|
|
|
|
return 0;
|
|
|
|
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
return packet_len - GST_RTP_HEADER_LEN - (csrc_count * sizeof (guint32))
|
|
|
|
- pad_len;
|
|
|
|
}
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_map:
|
|
|
|
* @buffer: a #GstBuffer
|
|
|
|
* @flags: #GstMapFlags
|
|
|
|
* @rtp: (out): a #GstRTPBuffer
|
2009-06-18 16:47:49 +00:00
|
|
|
*
|
2012-07-17 14:35:06 +00:00
|
|
|
* Map the contents of @buffer into @rtp.
|
2009-06-18 16:47:49 +00:00
|
|
|
*
|
2012-07-17 14:35:06 +00:00
|
|
|
* Returns: %TRUE if @buffer could be mapped.
|
2009-06-18 16:47:49 +00:00
|
|
|
*/
|
2012-07-17 14:35:06 +00:00
|
|
|
gboolean
|
|
|
|
gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
|
2009-06-18 16:47:49 +00:00
|
|
|
{
|
|
|
|
guint8 padding;
|
|
|
|
guint8 csrc_count;
|
|
|
|
guint header_len;
|
2013-09-13 14:01:42 +00:00
|
|
|
guint8 version, pt;
|
2012-07-17 14:35:06 +00:00
|
|
|
guint8 *data;
|
|
|
|
guint size;
|
|
|
|
gsize bufsize, skip;
|
|
|
|
guint idx, length;
|
2015-05-29 13:15:31 +00:00
|
|
|
guint n_mem;
|
2012-07-17 14:35:06 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
|
|
|
|
g_return_val_if_fail (rtp != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (rtp->buffer == NULL, FALSE);
|
2009-06-18 16:47:49 +00:00
|
|
|
|
2015-05-29 13:15:31 +00:00
|
|
|
n_mem = gst_buffer_n_memory (buffer);
|
|
|
|
if (n_mem < 1)
|
2012-11-12 10:17:56 +00:00
|
|
|
goto no_memory;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
/* map first memory, this should be the header */
|
|
|
|
if (!gst_buffer_map_range (buffer, 0, 1, &rtp->map[0], flags))
|
|
|
|
goto map_failed;
|
|
|
|
|
|
|
|
data = rtp->data[0] = rtp->map[0].data;
|
|
|
|
size = rtp->map[0].size;
|
2009-06-18 16:47:49 +00:00
|
|
|
|
2012-08-21 09:49:36 +00:00
|
|
|
/* the header must be completely in the first buffer */
|
2009-06-18 16:47:49 +00:00
|
|
|
header_len = GST_RTP_HEADER_LEN;
|
2012-07-17 14:35:06 +00:00
|
|
|
if (G_UNLIKELY (size < header_len))
|
2009-06-18 16:47:49 +00:00
|
|
|
goto wrong_length;
|
|
|
|
|
|
|
|
/* check version */
|
|
|
|
version = (data[0] & 0xc0);
|
|
|
|
if (G_UNLIKELY (version != (GST_RTP_VERSION << 6)))
|
|
|
|
goto wrong_version;
|
|
|
|
|
2013-09-13 14:01:42 +00:00
|
|
|
/* check reserved PT and marker bit, this is to check for RTCP
|
|
|
|
* packets. We do a relaxed check, you can still use 72-76 as long
|
|
|
|
* as the marker bit is cleared. */
|
|
|
|
pt = data[1];
|
|
|
|
if (G_UNLIKELY (pt >= 200 && pt <= 204))
|
|
|
|
goto reserved_pt;
|
|
|
|
|
2009-06-18 16:47:49 +00:00
|
|
|
/* calc header length with csrc */
|
|
|
|
csrc_count = (data[0] & 0x0f);
|
|
|
|
header_len += csrc_count * sizeof (guint32);
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
rtp->size[0] = header_len;
|
|
|
|
|
|
|
|
bufsize = gst_buffer_get_size (buffer);
|
|
|
|
|
2009-06-18 16:47:49 +00:00
|
|
|
/* calc extension length when present. */
|
|
|
|
if (data[0] & 0x10) {
|
2012-07-17 14:35:06 +00:00
|
|
|
guint8 *extdata;
|
2020-10-12 11:21:17 +00:00
|
|
|
gsize extlen;
|
2009-06-18 16:47:49 +00:00
|
|
|
|
2012-08-21 09:49:36 +00:00
|
|
|
/* find memory for the extension bits, we find the block for the first 4
|
|
|
|
* bytes, all other extension bytes should also be in this block */
|
2012-07-17 14:35:06 +00:00
|
|
|
if (!gst_buffer_find_memory (buffer, header_len, 4, &idx, &length, &skip))
|
2009-06-18 16:47:49 +00:00
|
|
|
goto wrong_length;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
if (!gst_buffer_map_range (buffer, idx, length, &rtp->map[1], flags))
|
|
|
|
goto map_failed;
|
|
|
|
|
|
|
|
extdata = rtp->data[1] = rtp->map[1].data + skip;
|
2009-06-18 16:47:49 +00:00
|
|
|
/* skip id */
|
2012-07-17 14:35:06 +00:00
|
|
|
extdata += 2;
|
2009-06-18 16:47:49 +00:00
|
|
|
/* read length as the number of 32 bits words */
|
2012-07-17 14:35:06 +00:00
|
|
|
extlen = GST_READ_UINT16_BE (extdata);
|
2012-08-21 09:49:36 +00:00
|
|
|
extlen *= sizeof (guint32);
|
|
|
|
/* add id and length */
|
|
|
|
extlen += 4;
|
2009-06-18 16:47:49 +00:00
|
|
|
|
2012-08-21 09:49:36 +00:00
|
|
|
/* all extension bytes must be in this block */
|
|
|
|
if (G_UNLIKELY (rtp->map[1].size < extlen))
|
|
|
|
goto wrong_length;
|
|
|
|
|
|
|
|
rtp->size[1] = extlen;
|
2012-07-17 14:35:06 +00:00
|
|
|
|
|
|
|
header_len += rtp->size[1];
|
|
|
|
} else {
|
|
|
|
rtp->data[1] = NULL;
|
|
|
|
rtp->size[1] = 0;
|
2009-06-18 16:47:49 +00:00
|
|
|
}
|
|
|
|
|
2015-07-22 09:31:05 +00:00
|
|
|
/* check for padding unless flags says to skip */
|
|
|
|
if ((data[0] & 0x20) != 0 &&
|
|
|
|
(flags & GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING) == 0) {
|
2012-07-17 14:35:06 +00:00
|
|
|
/* find memory for the padding bits */
|
|
|
|
if (!gst_buffer_find_memory (buffer, bufsize - 1, 1, &idx, &length, &skip))
|
|
|
|
goto wrong_length;
|
|
|
|
|
|
|
|
if (!gst_buffer_map_range (buffer, idx, length, &rtp->map[3], flags))
|
|
|
|
goto map_failed;
|
|
|
|
|
|
|
|
padding = rtp->map[3].data[skip];
|
|
|
|
rtp->data[3] = rtp->map[3].data + skip + 1 - padding;
|
|
|
|
rtp->size[3] = padding;
|
2014-04-29 06:46:02 +00:00
|
|
|
|
|
|
|
if (skip + 1 < padding)
|
|
|
|
goto wrong_length;
|
2009-06-18 16:47:49 +00:00
|
|
|
} else {
|
2012-07-17 14:35:06 +00:00
|
|
|
rtp->data[3] = NULL;
|
|
|
|
rtp->size[3] = 0;
|
2009-06-18 16:47:49 +00:00
|
|
|
padding = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check if padding and header not bigger than packet length */
|
2012-07-17 14:35:06 +00:00
|
|
|
if (G_UNLIKELY (bufsize < padding + header_len))
|
2009-06-18 16:47:49 +00:00
|
|
|
goto wrong_padding;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
rtp->buffer = buffer;
|
2015-05-29 13:15:31 +00:00
|
|
|
|
|
|
|
if (n_mem == 1) {
|
|
|
|
/* we have mapped the buffer already, so might just as well fill in the
|
|
|
|
* payload pointer and size and avoid another buffer map/unmap later */
|
|
|
|
rtp->data[2] = rtp->map[0].data + header_len;
|
|
|
|
rtp->size[2] = bufsize - header_len - padding;
|
|
|
|
} else {
|
|
|
|
/* we have not yet mapped the payload */
|
|
|
|
rtp->data[2] = NULL;
|
|
|
|
rtp->size[2] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* rtp->state = 0; *//* unused */
|
2012-07-17 14:35:06 +00:00
|
|
|
|
2009-06-18 16:47:49 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
2012-11-12 10:17:56 +00:00
|
|
|
no_memory:
|
|
|
|
{
|
|
|
|
GST_ERROR ("buffer without memory");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-07-17 14:35:06 +00:00
|
|
|
map_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR ("failed to map memory");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2009-06-18 16:47:49 +00:00
|
|
|
wrong_length:
|
|
|
|
{
|
2015-10-15 19:40:50 +00:00
|
|
|
GST_DEBUG ("length check failed");
|
2009-10-28 08:17:43 +00:00
|
|
|
goto dump_packet;
|
2009-06-18 16:47:49 +00:00
|
|
|
}
|
|
|
|
wrong_version:
|
|
|
|
{
|
2015-10-15 19:40:50 +00:00
|
|
|
GST_DEBUG ("version check failed (%d != %d)", version, GST_RTP_VERSION);
|
2009-10-28 08:17:43 +00:00
|
|
|
goto dump_packet;
|
2009-06-18 16:47:49 +00:00
|
|
|
}
|
2013-09-13 14:01:42 +00:00
|
|
|
reserved_pt:
|
|
|
|
{
|
2015-10-15 19:40:50 +00:00
|
|
|
GST_DEBUG ("reserved PT %d found", pt);
|
2013-09-13 14:01:42 +00:00
|
|
|
goto dump_packet;
|
|
|
|
}
|
2009-06-18 16:47:49 +00:00
|
|
|
wrong_padding:
|
|
|
|
{
|
2015-10-15 19:40:50 +00:00
|
|
|
GST_DEBUG ("padding check failed (%" G_GSIZE_FORMAT " - %d < %d)", bufsize,
|
|
|
|
header_len, padding);
|
2009-10-28 08:17:43 +00:00
|
|
|
goto dump_packet;
|
|
|
|
}
|
|
|
|
dump_packet:
|
|
|
|
{
|
2012-08-22 08:20:55 +00:00
|
|
|
gint i;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_MEMDUMP ("buffer", data, size);
|
2012-08-22 08:20:55 +00:00
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (rtp->map); ++i) {
|
2015-05-29 13:15:31 +00:00
|
|
|
if (rtp->map[i].memory != NULL)
|
2012-08-22 08:20:55 +00:00
|
|
|
gst_buffer_unmap (buffer, &rtp->map[i]);
|
|
|
|
}
|
2009-06-18 16:47:49 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
2012-07-17 14:35:06 +00:00
|
|
|
* gst_rtp_buffer_unmap:
|
|
|
|
* @rtp: a #GstRTPBuffer
|
2009-06-18 15:46:01 +00:00
|
|
|
*
|
2012-07-17 14:35:06 +00:00
|
|
|
* Unmap @rtp previously mapped with gst_rtp_buffer_map().
|
2009-06-18 15:46:01 +00:00
|
|
|
*/
|
2012-07-17 14:35:06 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_unmap (GstRTPBuffer * rtp)
|
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
gint i;
|
2009-06-18 15:46:01 +00:00
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
g_return_if_fail (rtp != NULL);
|
|
|
|
g_return_if_fail (rtp->buffer != NULL);
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
2015-05-29 13:15:31 +00:00
|
|
|
if (rtp->map[i].memory != NULL) {
|
2012-07-17 14:35:06 +00:00
|
|
|
gst_buffer_unmap (rtp->buffer, &rtp->map[i]);
|
2015-05-29 13:15:31 +00:00
|
|
|
rtp->map[i].memory = NULL;
|
|
|
|
}
|
|
|
|
rtp->data[i] = NULL;
|
|
|
|
rtp->size[i] = 0;
|
2012-07-17 14:35:06 +00:00
|
|
|
}
|
2011-03-27 11:55:15 +00:00
|
|
|
rtp->buffer = NULL;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2011-03-27 11:55:15 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_packet_len:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @len: the new packet length
|
|
|
|
*
|
2011-03-27 11:55:15 +00:00
|
|
|
* Set the total @rtp size to @len. The data in the buffer will be made
|
|
|
|
* larger if needed. Any padding will be removed from the packet.
|
2006-08-18 16:43:26 +00:00
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_packet_len (GstRTPBuffer * rtp, guint len)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2009-06-18 16:03:40 +00:00
|
|
|
guint8 *data;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
data = rtp->data[0];
|
|
|
|
|
|
|
|
/* FIXME */
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2012-04-02 08:31:18 +00:00
|
|
|
if (rtp->map[0].maxsize <= len) {
|
2011-03-27 11:55:15 +00:00
|
|
|
/* FIXME, realloc bigger space */
|
|
|
|
g_warning ("not implemented");
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
2011-03-27 11:55:15 +00:00
|
|
|
|
|
|
|
gst_buffer_set_size (rtp->buffer, len);
|
2012-04-02 08:31:18 +00:00
|
|
|
rtp->map[0].size = len;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
|
|
|
/* remove any padding */
|
2009-06-18 16:03:40 +00:00
|
|
|
GST_RTP_HEADER_PADDING (data) = FALSE;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_packet_len:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Return the total length of the packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: The total length of the packet in @buffer.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_packet_len (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2011-03-27 11:55:15 +00:00
|
|
|
return gst_buffer_get_size (rtp->buffer);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2007-09-03 19:31:11 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_header_len:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2007-09-03 19:31:11 +00:00
|
|
|
*
|
|
|
|
* Return the total length of the header in @buffer. This include the length of
|
|
|
|
* the fixed header, the CSRC list and the extension header.
|
|
|
|
*
|
|
|
|
* Returns: The total length of the header in @buffer.
|
|
|
|
*/
|
|
|
|
guint
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_header_len (GstRTPBuffer * rtp)
|
2007-09-03 19:31:11 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return rtp->size[0] + rtp->size[1];
|
2007-09-03 19:31:11 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_version:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the version number of the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: The version of @buffer.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_version (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return GST_RTP_HEADER_VERSION (rtp->data[0]);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_version:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @version: the new version
|
|
|
|
*
|
|
|
|
* Set the version of the RTP packet in @buffer to @version.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_version (GstRTPBuffer * rtp, guint8 version)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (version < 0x04);
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_VERSION (rtp->data[0]) = version;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_padding:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Check if the padding bit is set on the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: TRUE if @buffer has the padding bit set.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_padding (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return GST_RTP_HEADER_PADDING (rtp->data[0]);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_padding:
|
2011-11-14 09:46:56 +00:00
|
|
|
* @rtp: the buffer
|
2006-08-18 16:43:26 +00:00
|
|
|
* @padding: the new padding
|
|
|
|
*
|
|
|
|
* Set the padding bit on the RTP packet in @buffer to @padding.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_padding (GstRTPBuffer * rtp, gboolean padding)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_PADDING (rtp->data[0]) = padding;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_pad_to:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @len: the new amount of padding
|
|
|
|
*
|
2007-09-03 19:31:11 +00:00
|
|
|
* Set the amount of padding in the RTP packet in @buffer to
|
2006-08-18 16:43:26 +00:00
|
|
|
* @len. If @len is 0, the padding is removed.
|
|
|
|
*
|
|
|
|
* NOTE: This function does not work correctly.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_pad_to (GstRTPBuffer * rtp, guint len)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2009-06-18 16:03:40 +00:00
|
|
|
guint8 *data;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
data = rtp->data[0];
|
2009-06-18 16:03:40 +00:00
|
|
|
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
if (len > 0)
|
2009-06-18 16:03:40 +00:00
|
|
|
GST_RTP_HEADER_PADDING (data) = TRUE;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
else
|
2009-06-18 16:03:40 +00:00
|
|
|
GST_RTP_HEADER_PADDING (data) = FALSE;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/* FIXME, set the padding byte at the end of the payload data */
|
|
|
|
}
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_extension:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Check if the extension bit is set on the RTP packet in @buffer.
|
2017-01-23 19:36:11 +00:00
|
|
|
*
|
2006-08-18 16:43:26 +00:00
|
|
|
* Returns: TRUE if @buffer has the extension bit set.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_extension (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return GST_RTP_HEADER_EXTENSION (rtp->data[0]);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_extension:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @extension: the new extension
|
|
|
|
*
|
|
|
|
* Set the extension bit on the RTP packet in @buffer to @extension.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_extension (GstRTPBuffer * rtp, gboolean extension)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_EXTENSION (rtp->data[0]) = extension;
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2007-09-03 19:31:11 +00:00
|
|
|
/**
|
2013-06-16 20:39:30 +00:00
|
|
|
* gst_rtp_buffer_get_extension_data: (skip)
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2012-07-07 06:42:13 +00:00
|
|
|
* @bits: (out): location for result bits
|
|
|
|
* @data: (out) (array) (element-type guint8) (transfer none): location for data
|
|
|
|
* @wordlen: (out): location for length of @data in 32 bits words
|
2007-09-03 19:31:11 +00:00
|
|
|
*
|
2008-01-22 15:37:49 +00:00
|
|
|
* Get the extension data. @bits will contain the extension 16 bits of custom
|
2007-09-03 19:31:11 +00:00
|
|
|
* data. @data will point to the data in the extension and @wordlen will contain
|
|
|
|
* the length of @data in 32 bits words.
|
|
|
|
*
|
2008-01-22 15:37:49 +00:00
|
|
|
* If @buffer did not contain an extension, this function will return %FALSE
|
2007-09-03 19:31:11 +00:00
|
|
|
* with @bits, @data and @wordlen unchanged.
|
2017-01-23 19:36:11 +00:00
|
|
|
*
|
2007-09-03 19:31:11 +00:00
|
|
|
* Returns: TRUE if @buffer had the extension bit set.
|
|
|
|
*/
|
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_extension_data (GstRTPBuffer * rtp, guint16 * bits,
|
2007-09-03 19:31:11 +00:00
|
|
|
gpointer * data, guint * wordlen)
|
|
|
|
{
|
|
|
|
guint8 *pdata;
|
|
|
|
|
|
|
|
/* move to the extension */
|
2012-07-17 14:35:06 +00:00
|
|
|
pdata = rtp->data[1];
|
|
|
|
if (!pdata)
|
|
|
|
return FALSE;
|
2007-09-03 19:31:11 +00:00
|
|
|
|
|
|
|
if (bits)
|
|
|
|
*bits = GST_READ_UINT16_BE (pdata);
|
|
|
|
if (wordlen)
|
|
|
|
*wordlen = GST_READ_UINT16_BE (pdata + 2);
|
2011-11-04 07:41:00 +00:00
|
|
|
pdata += 4;
|
2007-09-03 19:31:11 +00:00
|
|
|
if (data)
|
2011-11-04 07:41:00 +00:00
|
|
|
*data = (gpointer *) pdata;
|
2007-09-03 19:31:11 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2013-06-16 20:39:30 +00:00
|
|
|
/**
|
2014-11-01 20:08:01 +00:00
|
|
|
* gst_rtp_buffer_get_extension_bytes: (rename-to gst_rtp_buffer_get_extension_data)
|
2013-06-16 20:39:30 +00:00
|
|
|
* @rtp: the RTP packet
|
|
|
|
* @bits: (out): location for header bits
|
|
|
|
*
|
|
|
|
* Similar to gst_rtp_buffer_get_extension_data, but more suitable for language
|
|
|
|
* bindings usage. @bits will contain the extension 16 bits of custom data and
|
|
|
|
* the extension data (not including the extension header) is placed in a new
|
|
|
|
* #GBytes structure.
|
|
|
|
*
|
|
|
|
* If @rtp did not contain an extension, this function will return %NULL, with
|
|
|
|
* @bits unchanged. If there is an extension header but no extension data then
|
|
|
|
* an empty #GBytes will be returned.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): A new #GBytes if an extension header was present
|
|
|
|
* and %NULL otherwise.
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
GBytes *
|
|
|
|
gst_rtp_buffer_get_extension_bytes (GstRTPBuffer * rtp, guint16 * bits)
|
|
|
|
{
|
|
|
|
gpointer buf_data = NULL;
|
|
|
|
guint buf_len;
|
|
|
|
|
|
|
|
g_return_val_if_fail (rtp != NULL, FALSE);
|
|
|
|
|
|
|
|
if (!gst_rtp_buffer_get_extension_data (rtp, bits, &buf_data, &buf_len))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (buf_len == 0) {
|
|
|
|
/* if no extension data is present return an empty GBytes */
|
|
|
|
buf_data = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* multiply length with 4 to get length in bytes */
|
|
|
|
return g_bytes_new (buf_data, 4 * buf_len);
|
|
|
|
}
|
|
|
|
|
2016-11-25 09:48:06 +00:00
|
|
|
static gboolean
|
|
|
|
gst_rtp_buffer_map_payload (GstRTPBuffer * rtp)
|
|
|
|
{
|
|
|
|
guint hlen, plen;
|
|
|
|
guint idx, length;
|
|
|
|
gsize skip;
|
|
|
|
|
|
|
|
if (rtp->map[2].memory != NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
hlen = gst_rtp_buffer_get_header_len (rtp);
|
|
|
|
plen = gst_buffer_get_size (rtp->buffer) - hlen - rtp->size[3];
|
|
|
|
|
|
|
|
if (!gst_buffer_find_memory (rtp->buffer, hlen, plen, &idx, &length, &skip))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!gst_buffer_map_range (rtp->buffer, idx, length, &rtp->map[2],
|
|
|
|
rtp->map[0].flags))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
rtp->data[2] = rtp->map[2].data + skip;
|
|
|
|
rtp->size[2] = plen;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
/* ensure header, payload and padding are in separate buffers */
|
|
|
|
static void
|
|
|
|
ensure_buffers (GstRTPBuffer * rtp)
|
|
|
|
{
|
|
|
|
guint i, pos;
|
|
|
|
gboolean changed = FALSE;
|
|
|
|
|
|
|
|
/* make sure payload is mapped */
|
2016-11-25 09:48:06 +00:00
|
|
|
gst_rtp_buffer_map_payload (rtp);
|
2012-08-22 07:46:38 +00:00
|
|
|
|
|
|
|
for (i = 0, pos = 0; i < 4; i++) {
|
|
|
|
if (rtp->size[i]) {
|
2016-11-25 09:48:06 +00:00
|
|
|
gsize offset = (guint8 *) rtp->data[i] - rtp->map[i].data;
|
2012-08-22 07:46:38 +00:00
|
|
|
|
|
|
|
if (offset != 0 || rtp->map[i].size != rtp->size[i]) {
|
|
|
|
GstMemory *mem;
|
|
|
|
|
|
|
|
/* make copy */
|
|
|
|
mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);
|
|
|
|
|
|
|
|
/* insert new memory */
|
|
|
|
gst_buffer_insert_memory (rtp->buffer, pos, mem);
|
|
|
|
|
|
|
|
changed = TRUE;
|
|
|
|
}
|
|
|
|
pos++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changed) {
|
2015-07-30 13:30:44 +00:00
|
|
|
GstBuffer *buf = rtp->buffer;
|
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
gst_rtp_buffer_unmap (rtp);
|
2015-07-30 13:30:44 +00:00
|
|
|
gst_buffer_remove_memory_range (buf, pos, -1);
|
2015-07-30 14:16:57 +00:00
|
|
|
gst_rtp_buffer_map (buf, GST_MAP_READWRITE, rtp);
|
2012-08-22 07:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-01 11:09:16 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_extension_data:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2008-02-01 11:09:16 +00:00
|
|
|
* @bits: the bits specific for the extension
|
|
|
|
* @length: the length that counts the number of 32-bit words in
|
|
|
|
* the extension, excluding the extension header ( therefore zero is a valid length)
|
|
|
|
*
|
|
|
|
* Set the extension bit of the rtp buffer and fill in the @bits and @length of the
|
2012-08-22 07:46:38 +00:00
|
|
|
* extension header. If the existing extension data is not large enough, it will
|
|
|
|
* be made larger.
|
2008-02-01 11:09:16 +00:00
|
|
|
*
|
2021-08-24 11:26:54 +00:00
|
|
|
* Will also shorten the extension data from 1.20.
|
|
|
|
*
|
2008-02-01 11:09:16 +00:00
|
|
|
* Returns: True if done.
|
|
|
|
*/
|
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_extension_data (GstRTPBuffer * rtp, guint16 bits,
|
2008-02-01 11:09:16 +00:00
|
|
|
guint16 length)
|
|
|
|
{
|
|
|
|
guint32 min_size = 0;
|
|
|
|
guint8 *data;
|
2012-08-22 07:46:38 +00:00
|
|
|
GstMemory *mem = NULL;
|
2008-02-01 11:09:16 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
ensure_buffers (rtp);
|
2009-06-18 16:03:40 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
/* this is the size of the extension data we need */
|
2012-07-17 14:35:06 +00:00
|
|
|
min_size = 4 + length * sizeof (guint32);
|
2012-08-22 07:46:38 +00:00
|
|
|
|
|
|
|
/* we should allocate and map the extension data */
|
|
|
|
if (rtp->data[1] == NULL || min_size > rtp->size[1]) {
|
|
|
|
GstMapInfo map;
|
|
|
|
|
|
|
|
/* we don't have (enough) extension data, make some */
|
|
|
|
mem = gst_allocator_alloc (NULL, min_size, NULL);
|
|
|
|
|
|
|
|
if (rtp->data[1]) {
|
2021-03-18 19:13:21 +00:00
|
|
|
/* copy old data & initialize the remainder of the new buffer */
|
2012-08-22 07:46:38 +00:00
|
|
|
gst_memory_map (mem, &map, GST_MAP_WRITE);
|
|
|
|
memcpy (map.data, rtp->data[1], rtp->size[1]);
|
2021-03-18 19:13:21 +00:00
|
|
|
if (min_size > rtp->size[1]) {
|
|
|
|
memset (map.data + rtp->size[1], 0, min_size - rtp->size[1]);
|
|
|
|
}
|
2012-08-22 07:46:38 +00:00
|
|
|
gst_memory_unmap (mem, &map);
|
|
|
|
|
|
|
|
/* unmap old */
|
|
|
|
gst_buffer_unmap (rtp->buffer, &rtp->map[1]);
|
|
|
|
gst_buffer_replace_memory (rtp->buffer, 1, mem);
|
|
|
|
} else {
|
2021-03-18 19:13:21 +00:00
|
|
|
/* don't leak data from uninitialized memory via the padding */
|
|
|
|
gst_memory_map (mem, &map, GST_MAP_WRITE);
|
|
|
|
memset (map.data, 0, map.size);
|
|
|
|
gst_memory_unmap (mem, &map);
|
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
/* we didn't have extension data, add */
|
|
|
|
gst_buffer_insert_memory (rtp->buffer, 1, mem);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* map new */
|
|
|
|
gst_memory_map (mem, &rtp->map[1], GST_MAP_READWRITE);
|
|
|
|
gst_memory_ref (mem);
|
|
|
|
rtp->data[1] = rtp->map[1].data;
|
|
|
|
rtp->size[1] = rtp->map[1].size;
|
2021-08-24 11:26:54 +00:00
|
|
|
} else if (min_size < rtp->size[1]) {
|
|
|
|
GstMemory *mem = rtp->map[1].memory;
|
|
|
|
|
|
|
|
gst_memory_ref (mem);
|
|
|
|
gst_buffer_unmap (rtp->buffer, &rtp->map[1]);
|
|
|
|
gst_memory_resize (mem, 0, min_size);
|
|
|
|
gst_memory_map (mem, &rtp->map[1], GST_MAP_READWRITE);
|
|
|
|
rtp->data[1] = rtp->map[1].data;
|
|
|
|
rtp->size[1] = rtp->map[1].size;
|
2012-08-22 07:46:38 +00:00
|
|
|
}
|
2008-02-01 11:09:16 +00:00
|
|
|
|
2008-05-14 20:28:02 +00:00
|
|
|
/* now we can set the extension bit */
|
2012-08-22 07:46:38 +00:00
|
|
|
data = rtp->data[0];
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_EXTENSION (data) = TRUE;
|
2008-02-01 11:09:16 +00:00
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
data = rtp->data[1];
|
2008-02-01 11:09:16 +00:00
|
|
|
GST_WRITE_UINT16_BE (data, bits);
|
|
|
|
GST_WRITE_UINT16_BE (data + 2, length);
|
2008-05-14 20:28:02 +00:00
|
|
|
|
2008-02-01 11:09:16 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-05-24 17:02:42 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_remove_extension_data:
|
|
|
|
* @rtp: the RTP packet
|
|
|
|
*
|
|
|
|
* Unsets the extension bit of the RTP buffer and removes the extension header
|
|
|
|
* and data.
|
|
|
|
*
|
|
|
|
* If the RTP buffer has no header extension data, the action has no effect.
|
|
|
|
* The RTP buffer must be mapped READWRITE only once and the underlying
|
|
|
|
* GstBuffer must be writable.
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_rtp_buffer_remove_extension_data (GstRTPBuffer * rtp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (gst_buffer_is_writable (rtp->buffer));
|
|
|
|
g_return_if_fail (rtp->map[0].flags & GST_MAP_WRITE);
|
|
|
|
|
|
|
|
if (rtp->data[1] != NULL) {
|
|
|
|
GstBuffer *buf = rtp->buffer;
|
|
|
|
|
|
|
|
ensure_buffers (rtp);
|
|
|
|
|
|
|
|
GST_RTP_HEADER_EXTENSION (rtp->data[0]) = FALSE;
|
|
|
|
gst_rtp_buffer_unmap (rtp);
|
|
|
|
gst_buffer_remove_memory (buf, 1);
|
|
|
|
gst_rtp_buffer_map (buf, GST_MAP_READWRITE, rtp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_ssrc:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the SSRC of the RTP packet in @buffer.
|
2017-01-23 19:36:11 +00:00
|
|
|
*
|
2006-08-18 16:43:26 +00:00
|
|
|
* Returns: the SSRC of @buffer in host order.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint32
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_ssrc (GstRTPBuffer * rtp)
|
2009-06-18 15:46:01 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return g_ntohl (GST_RTP_HEADER_SSRC (rtp->data[0]));
|
2009-06-18 15:46:01 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_ssrc:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @ssrc: the new SSRC
|
|
|
|
*
|
|
|
|
* Set the SSRC on the RTP packet in @buffer to @ssrc.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_ssrc (GstRTPBuffer * rtp, guint32 ssrc)
|
2009-06-18 15:46:01 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_SSRC (rtp->data[0]) = g_htonl (ssrc);
|
2009-06-18 15:46:01 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_csrc_count:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the CSRC count of the RTP packet in @buffer.
|
2017-01-23 19:36:11 +00:00
|
|
|
*
|
2006-08-18 16:43:26 +00:00
|
|
|
* Returns: the CSRC count of @buffer.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_csrc_count (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return GST_RTP_HEADER_CSRC_COUNT (rtp->data[0]);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_csrc:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @idx: the index of the CSRC to get
|
|
|
|
*
|
|
|
|
* Get the CSRC at index @idx in @buffer.
|
2017-01-23 19:36:11 +00:00
|
|
|
*
|
2006-08-18 16:43:26 +00:00
|
|
|
* Returns: the CSRC at index @idx in host order.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint32
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_csrc (GstRTPBuffer * rtp, guint8 idx)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2009-06-18 16:03:40 +00:00
|
|
|
guint8 *data;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
data = rtp->data[0];
|
2009-06-18 16:03:40 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (data), 0);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2009-06-18 16:03:40 +00:00
|
|
|
return GST_READ_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (data, idx));
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_csrc:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @idx: the CSRC index to set
|
|
|
|
* @csrc: the CSRC in host order to set at @idx
|
|
|
|
*
|
|
|
|
* Modify the CSRC at index @idx in @buffer to @csrc.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_csrc (GstRTPBuffer * rtp, guint8 idx, guint32 csrc)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2009-06-18 16:03:40 +00:00
|
|
|
guint8 *data;
|
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
data = rtp->data[0];
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2009-06-18 16:03:40 +00:00
|
|
|
g_return_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (data));
|
|
|
|
|
|
|
|
GST_WRITE_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (data, idx), csrc);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_marker:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Check if the marker bit is set on the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: TRUE if @buffer has the marker bit set.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_marker (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return GST_RTP_HEADER_MARKER (rtp->data[0]);
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_marker:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @marker: the new marker
|
|
|
|
*
|
|
|
|
* Set the marker bit on the RTP packet in @buffer to @marker.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_marker (GstRTPBuffer * rtp, gboolean marker)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_MARKER (rtp->data[0]) = marker;
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_payload_type:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the payload type of the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: The payload type.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint8
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_payload_type (GstRTPBuffer * rtp)
|
2009-06-18 15:46:01 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return GST_RTP_HEADER_PAYLOAD_TYPE (rtp->data[0]);
|
2009-06-18 15:46:01 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_payload_type:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @payload_type: the new type
|
|
|
|
*
|
|
|
|
* Set the payload type of the RTP packet in @buffer to @payload_type.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_payload_type (GstRTPBuffer * rtp, guint8 payload_type)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (payload_type < 0x80);
|
2005-07-14 10:29:30 +00:00
|
|
|
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_PAYLOAD_TYPE (rtp->data[0]) = payload_type;
|
2009-06-18 15:46:01 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_seq:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the sequence number of the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: The sequence number in host order.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint16
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_seq (GstRTPBuffer * rtp)
|
2005-07-14 10:29:30 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return g_ntohs (GST_RTP_HEADER_SEQ (rtp->data[0]));
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_seq:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @seq: the new sequence number
|
|
|
|
*
|
|
|
|
* Set the sequence number of the RTP packet in @buffer to @seq.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_seq (GstRTPBuffer * rtp, guint16 seq)
|
2005-07-14 10:29:30 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_SEQ (rtp->data[0]) = g_htons (seq);
|
2009-06-18 15:46:01 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_timestamp:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the timestamp of the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: The timestamp in host order.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint32
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_timestamp (GstRTPBuffer * rtp)
|
2009-06-18 15:46:01 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return g_ntohl (GST_RTP_HEADER_TIMESTAMP (rtp->data[0]));
|
2009-06-18 15:46:01 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_set_timestamp:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @timestamp: the new timestamp
|
|
|
|
*
|
|
|
|
* Set the timestamp of the RTP packet in @buffer to @timestamp.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
void
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_set_timestamp (GstRTPBuffer * rtp, guint32 timestamp)
|
2009-06-19 13:33:04 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
GST_RTP_HEADER_TIMESTAMP (rtp->data[0]) = g_htonl (timestamp);
|
2009-06-19 13:33:04 +00:00
|
|
|
}
|
|
|
|
|
2009-06-18 15:46:01 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_payload_subbuffer:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
* @offset: the offset in the payload
|
|
|
|
* @len: the length in the payload
|
|
|
|
*
|
|
|
|
* Create a subbuffer of the payload of the RTP packet in @buffer. @offset bytes
|
|
|
|
* are skipped in the payload and the subbuffer will be of size @len.
|
2013-12-09 23:56:07 +00:00
|
|
|
* If @len is -1 the total payload starting from @offset is subbuffered.
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Returns: A new buffer with the specified data of the payload.
|
|
|
|
*/
|
2005-11-21 19:12:51 +00:00
|
|
|
GstBuffer *
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_payload_subbuffer (GstRTPBuffer * rtp, guint offset,
|
2006-08-18 16:43:26 +00:00
|
|
|
guint len)
|
2005-11-21 19:12:51 +00:00
|
|
|
{
|
2006-08-18 16:43:26 +00:00
|
|
|
guint poffset, plen;
|
2005-11-21 19:12:51 +00:00
|
|
|
|
2011-03-27 11:55:15 +00:00
|
|
|
plen = gst_rtp_buffer_get_payload_len (rtp);
|
2006-08-18 16:43:26 +00:00
|
|
|
/* we can't go past the length */
|
2013-12-09 23:56:07 +00:00
|
|
|
if (G_UNLIKELY (offset > plen))
|
2008-05-14 20:28:02 +00:00
|
|
|
goto wrong_offset;
|
2005-11-21 19:12:51 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/* apply offset */
|
2011-03-27 11:55:15 +00:00
|
|
|
poffset = gst_rtp_buffer_get_header_len (rtp) + offset;
|
2006-08-18 16:43:26 +00:00
|
|
|
plen -= offset;
|
2005-11-21 19:12:51 +00:00
|
|
|
|
2007-09-03 19:31:11 +00:00
|
|
|
/* see if we need to shrink the buffer based on @len */
|
2006-08-18 16:43:26 +00:00
|
|
|
if (len != -1 && len < plen)
|
|
|
|
plen = len;
|
|
|
|
|
2011-03-30 14:50:45 +00:00
|
|
|
return gst_buffer_copy_region (rtp->buffer, GST_BUFFER_COPY_ALL, poffset,
|
|
|
|
plen);
|
2008-05-14 20:28:02 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
wrong_offset:
|
|
|
|
{
|
2013-12-09 23:56:07 +00:00
|
|
|
g_warning ("offset=%u should be less than plen=%u", offset, plen);
|
2008-05-14 20:28:02 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2006-08-18 16:43:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_payload_buffer:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Create a buffer of the payload of the RTP packet in @buffer. This function
|
2007-01-09 11:15:57 +00:00
|
|
|
* will internally create a subbuffer of @buffer so that a memcpy can be
|
2006-08-18 16:43:26 +00:00
|
|
|
* avoided.
|
|
|
|
*
|
|
|
|
* Returns: A new buffer with the data of the payload.
|
|
|
|
*/
|
|
|
|
GstBuffer *
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_payload_buffer (GstRTPBuffer * rtp)
|
2006-08-18 16:43:26 +00:00
|
|
|
{
|
2011-03-27 11:55:15 +00:00
|
|
|
return gst_rtp_buffer_get_payload_subbuffer (rtp, 0, -1);
|
2005-11-21 19:12:51 +00:00
|
|
|
}
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_payload_len:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get the length of the payload of the RTP packet in @buffer.
|
|
|
|
*
|
|
|
|
* Returns: The length of the payload in @buffer.
|
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
guint
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_payload_len (GstRTPBuffer * rtp)
|
2005-07-14 10:29:30 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
return gst_buffer_get_size (rtp->buffer) - gst_rtp_buffer_get_header_len (rtp)
|
|
|
|
- rtp->size[3];
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
2006-08-18 16:43:26 +00:00
|
|
|
/**
|
2013-06-16 20:39:30 +00:00
|
|
|
* gst_rtp_buffer_get_payload: (skip)
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
|
|
|
* Get a pointer to the payload data in @buffer. This pointer is valid as long
|
2007-01-09 11:15:57 +00:00
|
|
|
* as a reference to @buffer is held.
|
2006-08-18 16:43:26 +00:00
|
|
|
*
|
2012-07-07 06:42:13 +00:00
|
|
|
* Returns: (array) (element-type guint8) (transfer none): A pointer
|
|
|
|
* to the payload data in @buffer.
|
2006-08-18 16:43:26 +00:00
|
|
|
*/
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
gpointer
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_payload (GstRTPBuffer * rtp)
|
gst-libs/gst/rtp/gstbasertpdepayload.*: Fix for RTPBuffer changes.
Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_chain),
(gst_base_rtp_depayload_add_to_queue),
(gst_base_rtp_depayload_push),
(gst_base_rtp_depayload_queue_release):
* gst-libs/gst/rtp/gstbasertpdepayload.h:
Fix for RTPBuffer changes.
* gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtpbuffer_allocate_data),
(gst_rtpbuffer_new_take_data), (gst_rtpbuffer_new_copy_data),
(gst_rtpbuffer_new_allocate), (gst_rtpbuffer_new_allocate_len),
(gst_rtpbuffer_calc_header_len), (gst_rtpbuffer_calc_packet_len),
(gst_rtpbuffer_calc_payload_len), (gst_rtpbuffer_validate_data),
(gst_rtpbuffer_validate), (gst_rtpbuffer_set_packet_len),
(gst_rtpbuffer_get_packet_len), (gst_rtpbuffer_get_version),
(gst_rtpbuffer_set_version), (gst_rtpbuffer_get_padding),
(gst_rtpbuffer_set_padding), (gst_rtpbuffer_pad_to),
(gst_rtpbuffer_get_extension), (gst_rtpbuffer_set_extension),
(gst_rtpbuffer_get_ssrc), (gst_rtpbuffer_set_ssrc),
(gst_rtpbuffer_get_csrc_count), (gst_rtpbuffer_get_csrc),
(gst_rtpbuffer_set_csrc), (gst_rtpbuffer_get_marker),
(gst_rtpbuffer_set_marker), (gst_rtpbuffer_get_payload_type),
(gst_rtpbuffer_set_payload_type), (gst_rtpbuffer_get_seq),
(gst_rtpbuffer_set_seq), (gst_rtpbuffer_get_timestamp),
(gst_rtpbuffer_set_timestamp), (gst_rtpbuffer_get_payload_len),
(gst_rtpbuffer_get_payload):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Don't subclass GstBuffer but add methods and helper functions
to construct and manipulate RTP packets in regular GstBuffers.
2005-08-18 10:23:54 +00:00
|
|
|
{
|
2012-07-17 14:35:06 +00:00
|
|
|
if (rtp->data[2])
|
|
|
|
return rtp->data[2];
|
|
|
|
|
2016-11-25 09:48:06 +00:00
|
|
|
if (!gst_rtp_buffer_map_payload (rtp))
|
2012-07-17 14:35:06 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return rtp->data[2];
|
2005-07-14 10:29:30 +00:00
|
|
|
}
|
2007-03-29 10:17:52 +00:00
|
|
|
|
2013-06-16 20:39:30 +00:00
|
|
|
/**
|
2014-11-01 20:08:01 +00:00
|
|
|
* gst_rtp_buffer_get_payload_bytes: (rename-to gst_rtp_buffer_get_payload)
|
2013-06-16 20:39:30 +00:00
|
|
|
* @rtp: the RTP packet
|
|
|
|
*
|
|
|
|
* Similar to gst_rtp_buffer_get_payload, but more suitable for language
|
|
|
|
* bindings usage. The return value is a pointer to a #GBytes structure
|
|
|
|
* containing the payload data in @rtp.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): A new #GBytes containing the payload data in @rtp.
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
GBytes *
|
|
|
|
gst_rtp_buffer_get_payload_bytes (GstRTPBuffer * rtp)
|
|
|
|
{
|
|
|
|
gpointer data;
|
|
|
|
|
|
|
|
g_return_val_if_fail (rtp != NULL, NULL);
|
|
|
|
|
|
|
|
data = gst_rtp_buffer_get_payload (rtp);
|
|
|
|
if (data == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return g_bytes_new (data, gst_rtp_buffer_get_payload_len (rtp));
|
|
|
|
}
|
|
|
|
|
2007-03-29 10:17:52 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_default_clock_rate:
|
|
|
|
* @payload_type: the static payload type
|
|
|
|
*
|
|
|
|
* Get the default clock-rate for the static payload type @payload_type.
|
|
|
|
*
|
|
|
|
* Returns: the default clock rate or -1 if the payload type is not static or
|
|
|
|
* the clock-rate is undefined.
|
|
|
|
*/
|
|
|
|
guint32
|
|
|
|
gst_rtp_buffer_default_clock_rate (guint8 payload_type)
|
|
|
|
{
|
2007-10-01 13:22:14 +00:00
|
|
|
const GstRTPPayloadInfo *info;
|
|
|
|
guint32 res;
|
|
|
|
|
|
|
|
info = gst_rtp_payload_info_for_pt (payload_type);
|
|
|
|
if (!info)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
res = info->clock_rate;
|
|
|
|
/* 0 means unknown so we have to return -1 from this function */
|
|
|
|
if (res == 0)
|
|
|
|
res = -1;
|
|
|
|
|
|
|
|
return res;
|
2007-03-29 10:17:52 +00:00
|
|
|
}
|
2007-08-31 15:21:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_compare_seqnum:
|
|
|
|
* @seqnum1: a sequence number
|
|
|
|
* @seqnum2: a sequence number
|
|
|
|
*
|
2008-04-25 07:37:09 +00:00
|
|
|
* Compare two sequence numbers, taking care of wraparounds. This function
|
|
|
|
* returns the difference between @seqnum1 and @seqnum2.
|
2007-08-31 15:21:13 +00:00
|
|
|
*
|
2008-05-14 13:43:12 +00:00
|
|
|
* Returns: a negative value if @seqnum1 is bigger than @seqnum2, 0 if they
|
|
|
|
* are equal or a positive value if @seqnum1 is smaller than @segnum2.
|
2007-08-31 15:21:13 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_rtp_buffer_compare_seqnum (guint16 seqnum1, guint16 seqnum2)
|
|
|
|
{
|
2015-03-09 10:12:46 +00:00
|
|
|
/* See http://en.wikipedia.org/wiki/Serial_number_arithmetic
|
|
|
|
* for an explanation why this does the right thing even for
|
|
|
|
* wraparounds, under the assumption that the difference is
|
|
|
|
* never bigger than 2**15 sequence numbers
|
|
|
|
*/
|
2008-05-14 13:43:12 +00:00
|
|
|
return (gint16) (seqnum2 - seqnum1);
|
2007-08-31 15:21:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_ext_timestamp:
|
2018-04-20 19:53:10 +00:00
|
|
|
* @exttimestamp: (inout): a previous extended timestamp
|
2007-08-31 15:21:13 +00:00
|
|
|
* @timestamp: a new timestamp
|
|
|
|
*
|
2017-06-05 16:11:42 +00:00
|
|
|
* Update the @exttimestamp field with the extended timestamp of @timestamp
|
|
|
|
* For the first call of the method, @exttimestamp should point to a location
|
|
|
|
* with a value of -1.
|
2007-08-31 15:21:13 +00:00
|
|
|
*
|
2017-06-05 16:11:42 +00:00
|
|
|
* This function is able to handle both forward and backward timestamps taking
|
|
|
|
* into account:
|
|
|
|
* - timestamp wraparound making sure that the returned value is properly increased.
|
|
|
|
* - timestamp unwraparound making sure that the returned value is properly decreased.
|
2007-08-31 15:21:13 +00:00
|
|
|
*
|
2017-06-05 16:11:42 +00:00
|
|
|
* Returns: The extended timestamp of @timestamp or 0 if the result can't go anywhere backwards.
|
2007-08-31 15:21:13 +00:00
|
|
|
*/
|
|
|
|
guint64
|
|
|
|
gst_rtp_buffer_ext_timestamp (guint64 * exttimestamp, guint32 timestamp)
|
|
|
|
{
|
2017-06-05 16:11:42 +00:00
|
|
|
guint64 result, ext;
|
2007-08-31 15:21:13 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (exttimestamp != NULL, -1);
|
|
|
|
|
|
|
|
ext = *exttimestamp;
|
|
|
|
|
|
|
|
if (ext == -1) {
|
|
|
|
result = timestamp;
|
|
|
|
} else {
|
|
|
|
/* pick wraparound counter from previous timestamp and add to new timestamp */
|
2013-11-13 19:12:48 +00:00
|
|
|
result = timestamp + (ext & ~(G_GUINT64_CONSTANT (0xffffffff)));
|
2007-08-31 15:21:13 +00:00
|
|
|
|
|
|
|
/* check for timestamp wraparound */
|
2017-06-05 16:11:42 +00:00
|
|
|
if (result < ext) {
|
|
|
|
guint64 diff = ext - result;
|
|
|
|
|
|
|
|
if (diff > G_MAXINT32) {
|
|
|
|
/* timestamp went backwards more than allowed, we wrap around and get
|
|
|
|
* updated extended timestamp. */
|
|
|
|
result += (G_GUINT64_CONSTANT (1) << 32);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
guint64 diff = result - ext;
|
|
|
|
|
|
|
|
if (diff > G_MAXINT32) {
|
|
|
|
if (result < (G_GUINT64_CONSTANT (1) << 32)) {
|
|
|
|
GST_WARNING
|
|
|
|
("Cannot unwrap, any wrapping took place yet. Returning 0 without updating extended timestamp.");
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
/* timestamp went forwards more than allowed, we unwrap around and get
|
|
|
|
* updated extended timestamp. */
|
|
|
|
result -= (G_GUINT64_CONSTANT (1) << 32);
|
|
|
|
/* We don't want the extended timestamp storage to go back, ever */
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
2007-08-31 15:21:13 +00:00
|
|
|
}
|
|
|
|
}
|
2017-06-05 16:11:42 +00:00
|
|
|
|
2007-08-31 15:21:13 +00:00
|
|
|
*exttimestamp = result;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2010-08-19 20:26:18 +00:00
|
|
|
|
|
|
|
|
2020-01-28 17:17:47 +00:00
|
|
|
static gboolean
|
|
|
|
_get_extension_onebyte_header (const guint8 * pdata, guint len,
|
|
|
|
guint16 bit_pattern, guint8 id, guint nth, gpointer * data, guint * size)
|
2010-08-19 20:26:18 +00:00
|
|
|
{
|
|
|
|
gulong offset = 0;
|
|
|
|
guint count = 0;
|
|
|
|
|
|
|
|
g_return_val_if_fail (id > 0 && id < 15, FALSE);
|
|
|
|
|
2020-01-28 17:17:47 +00:00
|
|
|
if (bit_pattern != 0xBEDE)
|
2010-08-19 20:26:18 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
guint8 read_id, read_len;
|
|
|
|
|
2020-01-28 17:17:47 +00:00
|
|
|
if (offset + 1 >= len)
|
2010-08-19 20:26:18 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
read_id = GST_READ_UINT8 (pdata + offset) >> 4;
|
|
|
|
read_len = (GST_READ_UINT8 (pdata + offset) & 0x0F) + 1;
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* ID 0 means its padding, skip */
|
|
|
|
if (read_id == 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* ID 15 is special and means we should stop parsing */
|
|
|
|
if (read_id == 15)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Ignore extension headers where the size does not fit */
|
2020-01-28 17:17:47 +00:00
|
|
|
if (offset + read_len > len)
|
2010-08-19 20:26:18 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* If we have the right one */
|
|
|
|
if (id == read_id) {
|
|
|
|
if (nth == count) {
|
|
|
|
if (data)
|
2020-01-28 17:17:47 +00:00
|
|
|
*data = (gpointer) & pdata[offset];
|
2010-08-19 20:26:18 +00:00
|
|
|
if (size)
|
|
|
|
*size = read_len;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
offset += read_len;
|
|
|
|
|
2020-01-28 17:17:47 +00:00
|
|
|
if (offset >= len)
|
2010-08-19 20:26:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-01-28 17:17:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_extension_onebyte_header_from_bytes:
|
|
|
|
* @bytes: #GBytes
|
|
|
|
* @bit_pattern: The bit-pattern. Anything but 0xBEDE is rejected.
|
|
|
|
* @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: (out) (array length=size) (element-type guint8) (transfer none):
|
|
|
|
* location for data
|
|
|
|
* @size: (out): the size of the data in bytes
|
|
|
|
*
|
|
|
|
* Similar to gst_rtp_buffer_get_extension_onebyte_header, but working
|
|
|
|
* on the #GBytes you get from gst_rtp_buffer_get_extension_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 @bytes had the requested header extension
|
|
|
|
*
|
|
|
|
* Since: 1.18
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_rtp_buffer_get_extension_onebyte_header_from_bytes (GBytes * bytes,
|
|
|
|
guint16 bit_pattern, guint8 id, guint nth, gpointer * data, guint * size)
|
|
|
|
{
|
|
|
|
const guint8 *pdata = g_bytes_get_data (bytes, NULL);
|
|
|
|
gsize len = g_bytes_get_size (bytes);
|
|
|
|
return _get_extension_onebyte_header (pdata, len, bit_pattern, id, nth, data,
|
|
|
|
size);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_extension_onebyte_header:
|
|
|
|
* @rtp: the RTP packet
|
|
|
|
* @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: (out) (array length=size) (element-type guint8) (transfer none):
|
|
|
|
* location for data
|
|
|
|
* @size: (out): 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gst_rtp_buffer_get_extension_onebyte_header (GstRTPBuffer * rtp, guint8 id,
|
|
|
|
guint nth, gpointer * data, guint * size)
|
|
|
|
{
|
|
|
|
guint16 bit_pattern;
|
|
|
|
guint8 *pdata;
|
|
|
|
guint wordlen;
|
|
|
|
|
|
|
|
if (!gst_rtp_buffer_get_extension_data (rtp, &bit_pattern, (gpointer) & pdata,
|
|
|
|
&wordlen))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return _get_extension_onebyte_header (pdata, wordlen * 4, bit_pattern, id,
|
|
|
|
nth, data, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-19 20:26:18 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_get_extension_twobytes_header:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2012-07-07 06:42:13 +00:00
|
|
|
* @appbits: (out): Application specific bits
|
2010-08-19 20:26:18 +00:00
|
|
|
* @id: The ID of the header extension to be read (between 1 and 14).
|
|
|
|
* @nth: Read the nth extension packet with the requested ID
|
2012-07-07 06:42:13 +00:00
|
|
|
* @data: (out) (array length=size) (element-type guint8) (transfer none):
|
|
|
|
* location for data
|
|
|
|
* @size: (out): the size of the data in bytes
|
2010-08-19 20:26:18 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_get_extension_twobytes_header (GstRTPBuffer * rtp,
|
2010-08-19 20:26:18 +00:00
|
|
|
guint8 * appbits, guint8 id, guint nth, gpointer * data, guint * size)
|
|
|
|
{
|
|
|
|
guint16 bits;
|
2011-11-04 07:41:00 +00:00
|
|
|
guint8 *pdata = NULL;
|
2010-08-19 20:26:18 +00:00
|
|
|
guint wordlen;
|
|
|
|
guint bytelen;
|
|
|
|
gulong offset = 0;
|
|
|
|
guint count = 0;
|
|
|
|
|
2011-11-04 07:41:00 +00:00
|
|
|
if (!gst_rtp_buffer_get_extension_data (rtp, &bits, (gpointer *) & pdata,
|
2010-08-19 20:26:18 +00:00
|
|
|
&wordlen))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (bits >> 4 != 0x100)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
bytelen = wordlen * 4;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
guint8 read_id, read_len;
|
|
|
|
|
|
|
|
if (offset + 2 >= bytelen)
|
|
|
|
break;
|
|
|
|
|
|
|
|
read_id = GST_READ_UINT8 (pdata + offset);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
if (read_id == 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
read_len = GST_READ_UINT8 (pdata + offset);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* Ignore extension headers where the size does not fit */
|
|
|
|
if (offset + read_len > bytelen)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* If we have the right one, return it */
|
|
|
|
if (id == read_id) {
|
|
|
|
if (nth == count) {
|
|
|
|
if (data)
|
|
|
|
*data = pdata + offset;
|
|
|
|
if (size)
|
|
|
|
*size = read_len;
|
|
|
|
if (appbits)
|
|
|
|
*appbits = bits;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
offset += read_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2019-12-13 15:06:44 +00:00
|
|
|
static gboolean
|
2020-02-20 16:25:19 +00:00
|
|
|
get_onebyte_header_end_offset (guint8 * pdata, guint wordlen, guint * offset)
|
2010-08-22 23:44:38 +00:00
|
|
|
{
|
|
|
|
guint bytelen = wordlen * 4;
|
|
|
|
guint paddingcount = 0;
|
|
|
|
|
2019-12-13 15:06:44 +00:00
|
|
|
*offset = 0;
|
|
|
|
|
|
|
|
while (*offset + 1 < bytelen) {
|
2010-08-22 23:44:38 +00:00
|
|
|
guint8 read_id, read_len;
|
|
|
|
|
2019-12-13 15:06:44 +00:00
|
|
|
read_id = GST_READ_UINT8 (pdata + *offset) >> 4;
|
|
|
|
read_len = (GST_READ_UINT8 (pdata + *offset) & 0x0F) + 1;
|
|
|
|
*offset += 1;
|
2010-08-22 23:44:38 +00:00
|
|
|
|
|
|
|
/* ID 0 means its padding, skip */
|
|
|
|
if (read_id == 0) {
|
|
|
|
paddingcount++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
paddingcount = 0;
|
|
|
|
|
|
|
|
/* ID 15 is special and means we should stop parsing */
|
|
|
|
/* It also means we can't add an extra packet */
|
2019-12-13 15:06:44 +00:00
|
|
|
if (read_id == 15) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-22 23:44:38 +00:00
|
|
|
|
|
|
|
/* Ignore extension headers where the size does not fit */
|
2019-12-13 15:06:44 +00:00
|
|
|
if (*offset + read_len > bytelen) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-22 23:44:38 +00:00
|
|
|
|
2019-12-13 15:06:44 +00:00
|
|
|
*offset += read_len;
|
2010-08-22 23:44:38 +00:00
|
|
|
}
|
|
|
|
|
2019-12-13 15:06:44 +00:00
|
|
|
*offset -= paddingcount;
|
|
|
|
|
|
|
|
return TRUE;
|
2010-08-22 23:44:38 +00:00
|
|
|
}
|
|
|
|
|
2010-08-20 16:54:38 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_add_extension_onebyte_header:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2010-08-20 16:54:38 +00:00
|
|
|
* @id: The ID of the header extension (between 1 and 14).
|
2012-07-07 06:42:13 +00:00
|
|
|
* @data: (array length=size) (element-type guint8): location for data
|
2010-08-20 16:54:38 +00:00
|
|
|
* @size: the size of the data in bytes
|
|
|
|
*
|
|
|
|
* Adds a RFC 5285 header extension with a one byte header to the end of the
|
|
|
|
* RTP header. If there is already a RFC 5285 header extension with a one byte
|
|
|
|
* header, the new extension will be appended.
|
|
|
|
* It will not work if there is already a header extension that does not follow
|
2019-08-29 17:42:39 +00:00
|
|
|
* the mechanism described in RFC 5285 or if there is a header extension with
|
2010-08-20 16:54:38 +00:00
|
|
|
* a two bytes header as described in RFC 5285. In that case, use
|
|
|
|
* gst_rtp_buffer_add_extension_twobytes_header()
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if header extension could be added
|
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_add_extension_onebyte_header (GstRTPBuffer * rtp, guint8 id,
|
2016-07-26 14:46:02 +00:00
|
|
|
gconstpointer data, guint size)
|
2010-08-20 16:54:38 +00:00
|
|
|
{
|
|
|
|
guint16 bits;
|
2011-11-04 07:41:00 +00:00
|
|
|
guint8 *pdata = 0;
|
2020-02-20 16:25:19 +00:00
|
|
|
guint wordlen = 0;
|
|
|
|
guint wordlen_new;
|
2010-08-20 16:54:38 +00:00
|
|
|
gboolean has_bit;
|
2012-08-22 07:46:38 +00:00
|
|
|
guint extlen, offset = 0;
|
2010-08-20 16:54:38 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (id > 0 && id < 15, FALSE);
|
|
|
|
g_return_val_if_fail (size >= 1 && size <= 16, FALSE);
|
2011-03-27 11:55:15 +00:00
|
|
|
g_return_val_if_fail (gst_buffer_is_writable (rtp->buffer), FALSE);
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2011-03-27 11:55:15 +00:00
|
|
|
has_bit = gst_rtp_buffer_get_extension_data (rtp, &bits,
|
2010-08-20 16:54:38 +00:00
|
|
|
(gpointer) & pdata, &wordlen);
|
|
|
|
|
|
|
|
if (has_bit) {
|
|
|
|
if (bits != 0xBEDE)
|
|
|
|
return FALSE;
|
|
|
|
|
2019-12-13 15:06:44 +00:00
|
|
|
if (!get_onebyte_header_end_offset (pdata, wordlen, &offset))
|
2010-08-22 23:44:38 +00:00
|
|
|
return FALSE;
|
2012-08-22 07:46:38 +00:00
|
|
|
}
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
/* the required size of the new extension data */
|
|
|
|
extlen = offset + size + 1;
|
|
|
|
/* calculate amount of words */
|
2020-02-20 16:25:19 +00:00
|
|
|
wordlen_new = extlen / 4 + ((extlen % 4) ? 1 : 0);
|
|
|
|
wordlen_new = MAX (wordlen_new, wordlen);
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2020-02-20 16:25:19 +00:00
|
|
|
gst_rtp_buffer_set_extension_data (rtp, 0xBEDE, wordlen_new);
|
2012-08-22 07:46:38 +00:00
|
|
|
gst_rtp_buffer_get_extension_data (rtp, &bits, (gpointer) & pdata, &wordlen);
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
pdata += offset;
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
pdata[0] = (id << 4) | (0x0F & (size - 1));
|
|
|
|
memcpy (pdata + 1, data, size);
|
2010-08-20 16:54:38 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
if (extlen % 4)
|
|
|
|
memset (pdata + 1 + size, 0, 4 - (extlen % 4));
|
2010-08-20 16:54:38 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2010-08-20 21:13:06 +00:00
|
|
|
|
2010-08-22 23:44:38 +00:00
|
|
|
|
|
|
|
static guint
|
2014-10-03 11:28:30 +00:00
|
|
|
get_twobytes_header_end_offset (const guint8 * pdata, guint wordlen)
|
2010-08-22 23:44:38 +00:00
|
|
|
{
|
|
|
|
guint offset = 0;
|
|
|
|
guint bytelen = wordlen * 4;
|
|
|
|
guint paddingcount = 0;
|
|
|
|
|
|
|
|
while (offset + 2 < bytelen) {
|
|
|
|
guint8 read_id, read_len;
|
|
|
|
|
|
|
|
read_id = GST_READ_UINT8 (pdata + offset);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* ID 0 means its padding, skip */
|
|
|
|
if (read_id == 0) {
|
|
|
|
paddingcount++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
paddingcount = 0;
|
|
|
|
|
|
|
|
read_len = GST_READ_UINT8 (pdata + offset);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* Ignore extension headers where the size does not fit */
|
|
|
|
if (offset + read_len > bytelen)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
offset += read_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset - paddingcount;
|
|
|
|
}
|
|
|
|
|
2010-08-20 21:13:06 +00:00
|
|
|
/**
|
|
|
|
* gst_rtp_buffer_add_extension_twobytes_header:
|
2011-03-27 11:55:15 +00:00
|
|
|
* @rtp: the RTP packet
|
2010-08-20 21:13:06 +00:00
|
|
|
* @appbits: Application specific bits
|
|
|
|
* @id: The ID of the header extension
|
2012-07-07 06:42:13 +00:00
|
|
|
* @data: (array length=size) (element-type guint8): location for data
|
2010-08-20 21:13:06 +00:00
|
|
|
* @size: the size of the data in bytes
|
|
|
|
*
|
|
|
|
* Adds a RFC 5285 header extension with a two bytes header to the end of the
|
|
|
|
* RTP header. If there is already a RFC 5285 header extension with a two bytes
|
|
|
|
* header, the new extension will be appended.
|
|
|
|
* It will not work if there is already a header extension that does not follow
|
2019-08-29 17:42:39 +00:00
|
|
|
* the mechanism described in RFC 5285 or if there is a header extension with
|
2010-08-20 21:13:06 +00:00
|
|
|
* a one byte header as described in RFC 5285. In that case, use
|
|
|
|
* gst_rtp_buffer_add_extension_onebyte_header()
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if header extension could be added
|
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean
|
2011-03-27 11:55:15 +00:00
|
|
|
gst_rtp_buffer_add_extension_twobytes_header (GstRTPBuffer * rtp,
|
2016-07-26 14:46:02 +00:00
|
|
|
guint8 appbits, guint8 id, gconstpointer data, guint size)
|
2010-08-20 21:13:06 +00:00
|
|
|
{
|
|
|
|
guint16 bits;
|
2011-11-04 07:41:00 +00:00
|
|
|
guint8 *pdata = 0;
|
2010-08-20 21:13:06 +00:00
|
|
|
guint wordlen;
|
|
|
|
gboolean has_bit;
|
2012-08-22 07:46:38 +00:00
|
|
|
gulong offset = 0;
|
|
|
|
guint extlen;
|
2010-08-20 21:13:06 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail ((appbits & 0xF0) == 0, FALSE);
|
|
|
|
g_return_val_if_fail (size < 256, FALSE);
|
2011-03-27 11:55:15 +00:00
|
|
|
g_return_val_if_fail (gst_buffer_is_writable (rtp->buffer), FALSE);
|
2010-08-20 21:13:06 +00:00
|
|
|
|
2011-03-27 11:55:15 +00:00
|
|
|
has_bit = gst_rtp_buffer_get_extension_data (rtp, &bits,
|
2010-08-20 21:13:06 +00:00
|
|
|
(gpointer) & pdata, &wordlen);
|
|
|
|
|
|
|
|
if (has_bit) {
|
|
|
|
if (bits != ((0x100 << 4) | (appbits & 0x0f)))
|
|
|
|
return FALSE;
|
|
|
|
|
2010-08-22 23:44:38 +00:00
|
|
|
offset = get_twobytes_header_end_offset (pdata, wordlen);
|
2012-08-22 07:46:38 +00:00
|
|
|
if (offset == 0)
|
2010-08-20 21:13:06 +00:00
|
|
|
return FALSE;
|
2012-08-22 07:46:38 +00:00
|
|
|
}
|
2010-08-20 21:13:06 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
/* the required size of the new extension data */
|
|
|
|
extlen = offset + size + 2;
|
|
|
|
/* calculate amount of words */
|
|
|
|
wordlen = extlen / 4 + ((extlen % 4) ? 1 : 0);
|
2010-08-20 21:13:06 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
gst_rtp_buffer_set_extension_data (rtp, (0x100 << 4) | (appbits & 0x0F),
|
|
|
|
wordlen);
|
|
|
|
gst_rtp_buffer_get_extension_data (rtp, &bits, (gpointer) & pdata, &wordlen);
|
2010-08-20 21:13:06 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
pdata += offset;
|
2010-08-20 21:13:06 +00:00
|
|
|
|
2012-08-22 07:46:38 +00:00
|
|
|
pdata[0] = id;
|
|
|
|
pdata[1] = size;
|
|
|
|
memcpy (pdata + 2, data, size);
|
|
|
|
if (extlen % 4)
|
|
|
|
memset (pdata + 2 + size, 0, 4 - (extlen % 4));
|
2010-08-20 21:13:06 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|