mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
tests: fix RTP and RTCP unit tests
This commit is contained in:
parent
5261475bba
commit
e33b73f9df
4 changed files with 10 additions and 15 deletions
|
@ -287,9 +287,7 @@ gst_rtcp_buffer_unmap (GstRTCPBuffer * rtcp)
|
|||
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;
|
||||
|
|
|
@ -427,20 +427,21 @@ gboolean
|
|||
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;
|
||||
}
|
||||
|
@ -451,7 +452,7 @@ gst_rtp_buffer_unmap (GstRTPBuffer * rtp)
|
|||
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;
|
||||
|
||||
|
|
|
@ -50,13 +50,9 @@ struct _GstRTPBuffer
|
|||
{
|
||||
GstBuffer *buffer;
|
||||
GstMapFlags flags;
|
||||
guint8 *data;
|
||||
gsize size;
|
||||
gsize maxsize;
|
||||
|
||||
guint8 *data;
|
||||
gsize data_size;
|
||||
guint8 *payload;
|
||||
gsize payload_size;
|
||||
};
|
||||
|
||||
/* creating buffers */
|
||||
|
|
|
@ -35,7 +35,7 @@ GST_START_TEST (test_rtp_buffer)
|
|||
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);
|
||||
|
@ -225,7 +225,7 @@ GST_START_TEST (test_rtp_buffer_set_extension_data)
|
|||
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);
|
||||
|
@ -676,7 +676,7 @@ GST_START_TEST (test_rtcp_buffer)
|
|||
GstRTCPPacket packet;
|
||||
guint8 *data;
|
||||
gsize size;
|
||||
GstRTCPBuffer rtcp;
|
||||
GstRTCPBuffer rtcp = { NULL, };
|
||||
|
||||
buf = gst_rtcp_buffer_new (1400);
|
||||
fail_unless (buf != NULL);
|
||||
|
|
Loading…
Reference in a new issue