test: rtpbin_buffer_list: add function to check timestamp

This commit is contained in:
Antonio Ospite 2019-03-12 15:24:26 +01:00 committed by Olivier Crête
parent 31f221f89d
commit b158be0d98

View file

@ -184,6 +184,27 @@ check_seqnum (GstBuffer * buffer, guint16 seqnum)
gst_memory_unref (memory); gst_memory_unref (memory);
} }
static void
check_timestamp (GstBuffer * buffer, guint32 timestamp)
{
GstMemory *memory;
GstMapInfo info;
gboolean ret;
guint32 current_timestamp;
fail_if (buffer == NULL);
memory = gst_buffer_get_memory (buffer, 0);
ret = gst_memory_map (memory, &info, GST_MAP_READ);
fail_if (ret == FALSE);
current_timestamp = g_ntohl (*((guint32 *) & (info.data[4])));
fail_unless (current_timestamp == timestamp);
gst_memory_unmap (memory, &info);
gst_memory_unref (memory);
}
static void static void
check_header (GstBuffer * buffer, guint index) check_header (GstBuffer * buffer, guint index)
{ {