mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +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));
|
while (gst_rtcp_packet_move_to_next (&packet));
|
||||||
|
|
||||||
/* shrink size */
|
/* shrink size */
|
||||||
gst_buffer_set_size (rtcp->buffer, packet.offset);
|
res = gst_buffer_unmap (rtcp->buffer, rtcp->data, packet.offset);
|
||||||
|
|
||||||
res = gst_buffer_unmap (rtcp->buffer, rtcp->data, rtcp->size);
|
|
||||||
rtcp->buffer = NULL;
|
rtcp->buffer = NULL;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -427,20 +427,21 @@ gboolean
|
||||||
gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
|
gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
|
||||||
{
|
{
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gsize size;
|
gsize size, maxsize;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
|
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
|
||||||
g_return_val_if_fail (rtp != NULL, FALSE);
|
g_return_val_if_fail (rtp != NULL, FALSE);
|
||||||
g_return_val_if_fail (rtp->buffer == 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)
|
if (data == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
rtp->buffer = buffer;
|
rtp->buffer = buffer;
|
||||||
rtp->flags = flags;
|
rtp->flags = flags;
|
||||||
rtp->data = data;
|
rtp->data = data;
|
||||||
rtp->data_size = size;
|
rtp->size = size;
|
||||||
|
rtp->maxsize = maxsize;
|
||||||
|
|
||||||
return TRUE;
|
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 != NULL, FALSE);
|
||||||
g_return_val_if_fail (rtp->buffer != 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;
|
rtp->buffer = NULL;
|
||||||
|
|
||||||
|
|
|
@ -50,13 +50,9 @@ struct _GstRTPBuffer
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstMapFlags flags;
|
GstMapFlags flags;
|
||||||
|
guint8 *data;
|
||||||
gsize size;
|
gsize size;
|
||||||
gsize maxsize;
|
gsize maxsize;
|
||||||
|
|
||||||
guint8 *data;
|
|
||||||
gsize data_size;
|
|
||||||
guint8 *payload;
|
|
||||||
gsize payload_size;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* creating buffers */
|
/* creating buffers */
|
||||||
|
|
|
@ -35,7 +35,7 @@ GST_START_TEST (test_rtp_buffer)
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gsize size;
|
gsize size;
|
||||||
GstRTPBuffer rtp;
|
GstRTPBuffer rtp = { NULL, };
|
||||||
|
|
||||||
/* check GstRTPHeader structure alignment and packing */
|
/* check GstRTPHeader structure alignment and packing */
|
||||||
buf = gst_rtp_buffer_new_allocate (16, 4, 0);
|
buf = gst_rtp_buffer_new_allocate (16, 4, 0);
|
||||||
|
@ -225,7 +225,7 @@ GST_START_TEST (test_rtp_buffer_set_extension_data)
|
||||||
gpointer pointer;
|
gpointer pointer;
|
||||||
guint8 appbits;
|
guint8 appbits;
|
||||||
gsize bsize;
|
gsize bsize;
|
||||||
GstRTPBuffer rtp;
|
GstRTPBuffer rtp = { NULL, };
|
||||||
|
|
||||||
/* check GstRTPHeader structure alignment and packing */
|
/* check GstRTPHeader structure alignment and packing */
|
||||||
buf = gst_rtp_buffer_new_allocate (4, 0, 0);
|
buf = gst_rtp_buffer_new_allocate (4, 0, 0);
|
||||||
|
@ -676,7 +676,7 @@ GST_START_TEST (test_rtcp_buffer)
|
||||||
GstRTCPPacket packet;
|
GstRTCPPacket packet;
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gsize size;
|
gsize size;
|
||||||
GstRTCPBuffer rtcp;
|
GstRTCPBuffer rtcp = { NULL, };
|
||||||
|
|
||||||
buf = gst_rtcp_buffer_new (1400);
|
buf = gst_rtcp_buffer_new (1400);
|
||||||
fail_unless (buf != NULL);
|
fail_unless (buf != NULL);
|
||||||
|
|
Loading…
Reference in a new issue