while (gst_rtcp_packet_move_to_next (&packet));
/* shrink size */
- gst_buffer_set_size (rtcp->buffer, packet.offset);
-
- res = gst_buffer_unmap (rtcp->buffer, rtcp->data, rtcp->size);
+ res = gst_buffer_unmap (rtcp->buffer, rtcp->data, packet.offset);
rtcp->buffer = NULL;
return res;
gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
{
guint8 *data;
- gsize size;
+ gsize size, maxsize;
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);
- data = gst_buffer_map (buffer, &size, NULL, flags);
+ data = gst_buffer_map (buffer, &size, &maxsize, flags);
if (data == NULL)
return FALSE;
rtp->buffer = buffer;
rtp->flags = flags;
rtp->data = data;
- rtp->data_size = size;
+ rtp->size = size;
+ rtp->maxsize = maxsize;
return TRUE;
}
g_return_val_if_fail (rtp != NULL, FALSE);
g_return_val_if_fail (rtp->buffer != NULL, FALSE);
- gst_buffer_unmap (rtp->buffer, rtp->data, rtp->data_size);
+ gst_buffer_unmap (rtp->buffer, rtp->data, rtp->size);
rtp->buffer = NULL;
GstBuffer *buf;
guint8 *data;
gsize size;
- GstRTPBuffer rtp;
+ GstRTPBuffer rtp = { NULL, };
/* check GstRTPHeader structure alignment and packing */
buf = gst_rtp_buffer_new_allocate (16, 4, 0);
gpointer pointer;
guint8 appbits;
gsize bsize;
- GstRTPBuffer rtp;
+ GstRTPBuffer rtp = { NULL, };
/* check GstRTPHeader structure alignment and packing */
buf = gst_rtp_buffer_new_allocate (4, 0, 0);
GstRTCPPacket packet;
guint8 *data;
gsize size;
- GstRTCPBuffer rtcp;
+ GstRTCPBuffer rtcp = { NULL, };
buf = gst_rtcp_buffer_new (1400);
fail_unless (buf != NULL);