mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 15:56:42 +00:00
tests: fix indentation
This commit is contained in:
parent
69436d5a61
commit
7335d03070
4 changed files with 114 additions and 109 deletions
|
@ -171,8 +171,8 @@ GST_END_TEST;
|
||||||
static GstBuffer *
|
static GstBuffer *
|
||||||
create_buffer (guint8 * data, gsize size)
|
create_buffer (guint8 * data, gsize size)
|
||||||
{
|
{
|
||||||
GstBuffer * buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
|
GstBuffer *buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
|
||||||
data, size, 0, size, NULL, NULL);
|
data, size, 0, size, NULL, NULL);
|
||||||
GST_BUFFER_PTS (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_PTS (buf) = GST_CLOCK_TIME_NONE;
|
||||||
GST_BUFFER_DTS (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_DTS (buf) = GST_CLOCK_TIME_NONE;
|
||||||
GST_BUFFER_DURATION (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_DURATION (buf) = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -184,92 +184,92 @@ create_buffer (guint8 * data, gsize size)
|
||||||
static void
|
static void
|
||||||
flvdemux_pad_added (GstElement * flvdemux, GstPad * srcpad, GstHarness * h)
|
flvdemux_pad_added (GstElement * flvdemux, GstPad * srcpad, GstHarness * h)
|
||||||
{
|
{
|
||||||
(void)flvdemux;
|
(void) flvdemux;
|
||||||
gst_harness_add_element_src_pad (h, srcpad);
|
gst_harness_add_element_src_pad (h, srcpad);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_START_TEST (test_speex)
|
GST_START_TEST (test_speex)
|
||||||
{
|
{
|
||||||
guint8 flv_header0[] = {
|
guint8 flv_header0[] = {
|
||||||
0x46, 0x4c, 0x56, 0x01, 0x04, 0x00, 0x00, 0x00,
|
0x46, 0x4c, 0x56, 0x01, 0x04, 0x00, 0x00, 0x00,
|
||||||
0x09, 0x00, 0x00, 0x00, 0x00
|
0x09, 0x00, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
guint8 flv_header1[] = {
|
guint8 flv_header1[] = {
|
||||||
0x12, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
|
0x12, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x6f, 0x6e,
|
0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x6f, 0x6e,
|
||||||
0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61,
|
0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61,
|
||||||
0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0c, 0x61,
|
0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0c, 0x61,
|
||||||
0x75, 0x64, 0x69, 0x6f, 0x63, 0x6f, 0x64, 0x65,
|
0x75, 0x64, 0x69, 0x6f, 0x63, 0x6f, 0x64, 0x65,
|
||||||
0x63, 0x69, 0x64, 0x00, 0x40, 0x26, 0x00, 0x00,
|
0x63, 0x69, 0x64, 0x00, 0x40, 0x26, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x6d, 0x65,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x6d, 0x65,
|
||||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x63, 0x72,
|
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x63, 0x72,
|
||||||
0x65, 0x61, 0x74, 0x6f, 0x72, 0x02, 0x00, 0x13,
|
0x65, 0x61, 0x74, 0x6f, 0x72, 0x02, 0x00, 0x13,
|
||||||
0x47, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65,
|
0x47, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65,
|
||||||
0x72, 0x20, 0x46, 0x4c, 0x56, 0x20, 0x6d, 0x75,
|
0x72, 0x20, 0x46, 0x4c, 0x56, 0x20, 0x6d, 0x75,
|
||||||
0x78, 0x65, 0x72, 0x00, 0x0c, 0x63, 0x72, 0x65,
|
0x78, 0x65, 0x72, 0x00, 0x0c, 0x63, 0x72, 0x65,
|
||||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74,
|
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74,
|
||||||
0x65, 0x02, 0x00, 0x18, 0x57, 0x65, 0x64, 0x20,
|
0x65, 0x02, 0x00, 0x18, 0x57, 0x65, 0x64, 0x20,
|
||||||
0x53, 0x65, 0x70, 0x20, 0x32, 0x33, 0x20, 0x31,
|
0x53, 0x65, 0x70, 0x20, 0x32, 0x33, 0x20, 0x31,
|
||||||
0x30, 0x3a, 0x34, 0x39, 0x3a, 0x35, 0x36, 0x20,
|
0x30, 0x3a, 0x34, 0x39, 0x3a, 0x35, 0x36, 0x20,
|
||||||
0x32, 0x30, 0x31, 0x35, 0x00, 0x00, 0x09, 0x00,
|
0x32, 0x30, 0x31, 0x35, 0x00, 0x00, 0x09, 0x00,
|
||||||
0x00, 0x00, 0x87,
|
0x00, 0x00, 0x87,
|
||||||
};
|
};
|
||||||
|
|
||||||
guint8 speex_header0[] = {
|
guint8 speex_header0[] = {
|
||||||
0x08, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x00,
|
0x08, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0xb2, 0x53, 0x70, 0x65, 0x65,
|
0x00, 0x00, 0x00, 0xb2, 0x53, 0x70, 0x65, 0x65,
|
||||||
0x78, 0x20, 0x20, 0x20, 0x31, 0x2e, 0x32, 0x72,
|
0x78, 0x20, 0x20, 0x20, 0x31, 0x2e, 0x32, 0x72,
|
||||||
0x63, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x63, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
|
||||||
0x80, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x80, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
0xff, 0xff, 0xff, 0xff, 0x40, 0x01, 0x00, 0x00,
|
0xff, 0xff, 0xff, 0xff, 0x40, 0x01, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c,
|
||||||
};
|
};
|
||||||
|
|
||||||
guint8 speex_header1[] = {
|
guint8 speex_header1[] = {
|
||||||
0x08, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00,
|
0x08, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0xb2, 0x1f, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0xb2, 0x1f, 0x00, 0x00, 0x00,
|
||||||
0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20,
|
0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20,
|
||||||
0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x53, 0x74,
|
0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x53, 0x74,
|
||||||
0x72, 0x65, 0x61, 0x6d, 0x65, 0x72, 0x20, 0x53,
|
0x72, 0x65, 0x61, 0x6d, 0x65, 0x72, 0x20, 0x53,
|
||||||
0x70, 0x65, 0x65, 0x78, 0x65, 0x6e, 0x63, 0x00,
|
0x70, 0x65, 0x65, 0x78, 0x65, 0x6e, 0x63, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34,
|
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34,
|
||||||
};
|
};
|
||||||
|
|
||||||
guint8 buffer[] = {
|
guint8 buffer[] = {
|
||||||
0x08, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00,
|
0x08, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0xb2, 0x36, 0x9d, 0x1b, 0x9a,
|
0x00, 0x00, 0x00, 0xb2, 0x36, 0x9d, 0x1b, 0x9a,
|
||||||
0x20, 0x00, 0x01, 0x68, 0xe8, 0xe8, 0xe8, 0xe8,
|
0x20, 0x00, 0x01, 0x68, 0xe8, 0xe8, 0xe8, 0xe8,
|
||||||
0xe8, 0xe8, 0xe8, 0x84, 0x00, 0xb4, 0x74, 0x74,
|
0xe8, 0xe8, 0xe8, 0x84, 0x00, 0xb4, 0x74, 0x74,
|
||||||
0x74, 0x74, 0x74, 0x74, 0x74, 0x42, 0x00, 0x5a,
|
0x74, 0x74, 0x74, 0x74, 0x74, 0x42, 0x00, 0x5a,
|
||||||
0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x21,
|
0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x3a, 0x21,
|
||||||
0x00, 0x2d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d,
|
0x00, 0x2d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d,
|
||||||
0x1d, 0x1b, 0x3b, 0x60, 0xab, 0xab, 0xab, 0xab,
|
0x1d, 0x1b, 0x3b, 0x60, 0xab, 0xab, 0xab, 0xab,
|
||||||
0xab, 0x0a, 0xba, 0xba, 0xba, 0xba, 0xb0, 0xab,
|
0xab, 0x0a, 0xba, 0xba, 0xba, 0xba, 0xb0, 0xab,
|
||||||
0xab, 0xab, 0xab, 0xab, 0x0a, 0xba, 0xba, 0xba,
|
0xab, 0xab, 0xab, 0xab, 0x0a, 0xba, 0xba, 0xba,
|
||||||
0xba, 0xb7, 0x00, 0x00, 0x00, 0x52,
|
0xba, 0xb7, 0x00, 0x00, 0x00, 0x52,
|
||||||
};
|
};
|
||||||
|
|
||||||
GstHarness * h = gst_harness_new_with_padnames ("flvdemux", "sink", NULL);
|
GstHarness *h = gst_harness_new_with_padnames ("flvdemux", "sink", NULL);
|
||||||
gst_harness_set_src_caps_str (h, "video/x-flv");
|
gst_harness_set_src_caps_str (h, "video/x-flv");
|
||||||
|
|
||||||
g_signal_connect (h->element, "pad-added",
|
g_signal_connect (h->element, "pad-added",
|
||||||
G_CALLBACK (flvdemux_pad_added), h);
|
G_CALLBACK (flvdemux_pad_added), h);
|
||||||
|
|
||||||
gst_harness_push (h, create_buffer (flv_header0, sizeof (flv_header0)));
|
gst_harness_push (h, create_buffer (flv_header0, sizeof (flv_header0)));
|
||||||
gst_harness_push (h, create_buffer (flv_header1, sizeof (flv_header1)));
|
gst_harness_push (h, create_buffer (flv_header1, sizeof (flv_header1)));
|
||||||
gst_harness_push (h, create_buffer (speex_header0, sizeof (speex_header0)));
|
gst_harness_push (h, create_buffer (speex_header0, sizeof (speex_header0)));
|
||||||
gst_harness_push (h, create_buffer (speex_header1, sizeof (speex_header1)));
|
gst_harness_push (h, create_buffer (speex_header1, sizeof (speex_header1)));
|
||||||
gst_harness_push (h, create_buffer (buffer, sizeof (buffer)));
|
gst_harness_push (h, create_buffer (buffer, sizeof (buffer)));
|
||||||
|
|
||||||
{
|
{
|
||||||
GstCaps * caps;
|
GstCaps *caps;
|
||||||
const GstStructure * s;
|
const GstStructure *s;
|
||||||
const GValue *streamheader;
|
const GValue *streamheader;
|
||||||
const GValue *header;
|
const GValue *header;
|
||||||
const GValue *vorbiscomment;
|
const GValue *vorbiscomment;
|
||||||
|
|
|
@ -157,8 +157,8 @@ static GstBuffer *
|
||||||
create_buffer (guint8 * data, gsize size,
|
create_buffer (guint8 * data, gsize size,
|
||||||
GstClockTime timestamp, GstClockTime duration)
|
GstClockTime timestamp, GstClockTime duration)
|
||||||
{
|
{
|
||||||
GstBuffer * buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
|
GstBuffer *buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
|
||||||
data, size, 0, size, NULL, NULL);
|
data, size, 0, size, NULL, NULL);
|
||||||
GST_BUFFER_PTS (buf) = timestamp;
|
GST_BUFFER_PTS (buf) = timestamp;
|
||||||
GST_BUFFER_DTS (buf) = timestamp;
|
GST_BUFFER_DTS (buf) = timestamp;
|
||||||
GST_BUFFER_DURATION (buf) = duration;
|
GST_BUFFER_DURATION (buf) = duration;
|
||||||
|
@ -169,43 +169,43 @@ create_buffer (guint8 * data, gsize size,
|
||||||
|
|
||||||
GST_START_TEST (test_speex_streamable)
|
GST_START_TEST (test_speex_streamable)
|
||||||
{
|
{
|
||||||
GstBuffer * buf;
|
GstBuffer *buf;
|
||||||
GstMapInfo map = GST_MAP_INFO_INIT;
|
GstMapInfo map = GST_MAP_INFO_INIT;
|
||||||
|
|
||||||
guint8 header0[] = {
|
guint8 header0[] = {
|
||||||
0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20,
|
0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20,
|
||||||
0x31, 0x2e, 0x32, 0x72, 0x63, 0x31, 0x00, 0x00,
|
0x31, 0x2e, 0x32, 0x72, 0x63, 0x31, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
0x50, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00,
|
0x50, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||||
0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||||
0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
guint8 header1[] = {
|
guint8 header1[] = {
|
||||||
0x1f, 0x00, 0x00, 0x00, 0x45, 0x6e, 0x63, 0x6f,
|
0x1f, 0x00, 0x00, 0x00, 0x45, 0x6e, 0x63, 0x6f,
|
||||||
0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68,
|
0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68,
|
||||||
0x20, 0x47, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
0x20, 0x47, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||||
0x65, 0x72, 0x20, 0x53, 0x70, 0x65, 0x65, 0x78,
|
0x65, 0x72, 0x20, 0x53, 0x70, 0x65, 0x65, 0x78,
|
||||||
0x65, 0x6e, 0x63, 0x00, 0x00, 0x00, 0x00, 0x01
|
0x65, 0x6e, 0x63, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||||
};
|
};
|
||||||
|
|
||||||
guint8 buffer[] = {
|
guint8 buffer[] = {
|
||||||
0x36, 0x9d, 0x1b, 0x9a, 0x20, 0x00, 0x01, 0x68,
|
0x36, 0x9d, 0x1b, 0x9a, 0x20, 0x00, 0x01, 0x68,
|
||||||
0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0x84,
|
0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0x84,
|
||||||
0x00, 0xb4, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74,
|
0x00, 0xb4, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74,
|
||||||
0x74, 0x42, 0x00, 0x5a, 0x3a, 0x3a, 0x3a, 0x3a,
|
0x74, 0x42, 0x00, 0x5a, 0x3a, 0x3a, 0x3a, 0x3a,
|
||||||
0x3a, 0x3a, 0x3a, 0x21, 0x00, 0x2d, 0x1d, 0x1d,
|
0x3a, 0x3a, 0x3a, 0x21, 0x00, 0x2d, 0x1d, 0x1d,
|
||||||
0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1b, 0x3b, 0x60,
|
0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1b, 0x3b, 0x60,
|
||||||
0xab, 0xab, 0xab, 0xab, 0xab, 0x0a, 0xba, 0xba,
|
0xab, 0xab, 0xab, 0xab, 0xab, 0x0a, 0xba, 0xba,
|
||||||
0xba, 0xba, 0xb0, 0xab, 0xab, 0xab, 0xab, 0xab,
|
0xba, 0xba, 0xb0, 0xab, 0xab, 0xab, 0xab, 0xab,
|
||||||
0x0a, 0xba, 0xba, 0xba, 0xba, 0xb7
|
0x0a, 0xba, 0xba, 0xba, 0xba, 0xb7
|
||||||
};
|
};
|
||||||
|
|
||||||
GstCaps * caps = gst_caps_new_simple ("audio/x-speex",
|
GstCaps *caps = gst_caps_new_simple ("audio/x-speex",
|
||||||
"rate", G_TYPE_INT, 16000,
|
"rate", G_TYPE_INT, 16000,
|
||||||
"channels", G_TYPE_INT, 1,
|
"channels", G_TYPE_INT, 1,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -214,7 +214,7 @@ GST_START_TEST (test_speex_streamable)
|
||||||
const GstClockTime duration_ms = 20;
|
const GstClockTime duration_ms = 20;
|
||||||
const GstClockTime duration = duration_ms * GST_MSECOND;
|
const GstClockTime duration = duration_ms * GST_MSECOND;
|
||||||
|
|
||||||
GstHarness * h = gst_harness_new_with_padnames ("flvmux", "audio", "src");
|
GstHarness *h = gst_harness_new_with_padnames ("flvmux", "audio", "src");
|
||||||
gst_harness_set_src_caps (h, caps);
|
gst_harness_set_src_caps (h, caps);
|
||||||
g_object_set (h->element, "streamable", 1, NULL);
|
g_object_set (h->element, "streamable", 1, NULL);
|
||||||
|
|
||||||
|
@ -226,11 +226,11 @@ GST_START_TEST (test_speex_streamable)
|
||||||
|
|
||||||
/* push speex data */
|
/* push speex data */
|
||||||
gst_harness_push (h, create_buffer (buffer, sizeof (buffer),
|
gst_harness_push (h, create_buffer (buffer, sizeof (buffer),
|
||||||
base_time, duration));
|
base_time, duration));
|
||||||
|
|
||||||
/* push speex data 2*/
|
/* push speex data 2 */
|
||||||
gst_harness_push (h, create_buffer (buffer, sizeof (buffer),
|
gst_harness_push (h, create_buffer (buffer, sizeof (buffer),
|
||||||
base_time + duration, duration));
|
base_time + duration, duration));
|
||||||
|
|
||||||
/* pull out stream-start event */
|
/* pull out stream-start event */
|
||||||
gst_event_unref (gst_harness_pull_event (h));
|
gst_event_unref (gst_harness_pull_event (h));
|
||||||
|
@ -240,8 +240,8 @@ GST_START_TEST (test_speex_streamable)
|
||||||
|
|
||||||
/* pull out segment event and verify we are using GST_FORMAT_TIME */
|
/* pull out segment event and verify we are using GST_FORMAT_TIME */
|
||||||
{
|
{
|
||||||
GstEvent * event = gst_harness_pull_event (h);
|
GstEvent *event = gst_harness_pull_event (h);
|
||||||
const GstSegment * segment;
|
const GstSegment *segment;
|
||||||
gst_event_parse_segment (event, &segment);
|
gst_event_parse_segment (event, &segment);
|
||||||
fail_unless_equals_int (GST_FORMAT_TIME, segment->format);
|
fail_unless_equals_int (GST_FORMAT_TIME, segment->format);
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
@ -294,7 +294,8 @@ GST_START_TEST (test_speex_streamable)
|
||||||
fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf));
|
fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf));
|
||||||
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
|
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
|
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET_END (buf));
|
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
|
||||||
|
GST_BUFFER_OFFSET_END (buf));
|
||||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||||
/* 0x08 means it is audio */
|
/* 0x08 means it is audio */
|
||||||
fail_unless_equals_int (0x08, map.data[0]);
|
fail_unless_equals_int (0x08, map.data[0]);
|
||||||
|
@ -313,7 +314,8 @@ GST_START_TEST (test_speex_streamable)
|
||||||
fail_unless_equals_uint64 (base_time + duration, GST_BUFFER_DTS (buf));
|
fail_unless_equals_uint64 (base_time + duration, GST_BUFFER_DTS (buf));
|
||||||
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
|
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
|
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET_END (buf));
|
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
|
||||||
|
GST_BUFFER_OFFSET_END (buf));
|
||||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||||
/* 0x08 means it is audio */
|
/* 0x08 means it is audio */
|
||||||
fail_unless_equals_int (0x08, map.data[0]);
|
fail_unless_equals_int (0x08, map.data[0]);
|
||||||
|
@ -328,6 +330,7 @@ GST_START_TEST (test_speex_streamable)
|
||||||
|
|
||||||
gst_harness_teardown (h);
|
gst_harness_teardown (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
static Suite *
|
static Suite *
|
||||||
|
|
|
@ -59,6 +59,7 @@ GST_START_TEST (test_h263depay_start_packet_too_small_mode_a)
|
||||||
|
|
||||||
gst_harness_teardown (h);
|
gst_harness_teardown (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
GST_START_TEST (test_h263depay_start_packet_too_small_mode_b)
|
GST_START_TEST (test_h263depay_start_packet_too_small_mode_b)
|
||||||
|
@ -78,6 +79,7 @@ GST_START_TEST (test_h263depay_start_packet_too_small_mode_b)
|
||||||
|
|
||||||
gst_harness_teardown (h);
|
gst_harness_teardown (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
GST_START_TEST (test_h263depay_start_packet_too_small_mode_c)
|
GST_START_TEST (test_h263depay_start_packet_too_small_mode_c)
|
||||||
|
@ -97,6 +99,7 @@ GST_START_TEST (test_h263depay_start_packet_too_small_mode_c)
|
||||||
|
|
||||||
gst_harness_teardown (h);
|
gst_harness_teardown (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
static Suite *
|
static Suite *
|
||||||
|
|
|
@ -649,9 +649,8 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
|
||||||
/* the first lost buffer (buffer 3) out on
|
/* the first lost buffer (buffer 3) out on
|
||||||
* (buffer-timestamp (60) + latency (100) = 160) */
|
* (buffer-timestamp (60) + latency (100) = 160) */
|
||||||
gst_test_clock_wait_for_next_pending_id (testclock, &id);
|
gst_test_clock_wait_for_next_pending_id (testclock, &id);
|
||||||
fail_unless_equals_uint64 (
|
fail_unless_equals_uint64 (3 * PCMU_BUF_DURATION +
|
||||||
3 * PCMU_BUF_DURATION + jb_latency_ms * GST_MSECOND,
|
jb_latency_ms * GST_MSECOND, gst_clock_id_get_time (id));
|
||||||
gst_clock_id_get_time (id));
|
|
||||||
gst_clock_id_unref (id);
|
gst_clock_id_unref (id);
|
||||||
|
|
||||||
/* let the time expire... */
|
/* let the time expire... */
|
||||||
|
@ -1057,8 +1056,8 @@ GST_START_TEST (test_rtx_packet_delay)
|
||||||
* are exceeding the max allowed reorder distance and should request a
|
* are exceeding the max allowed reorder distance and should request a
|
||||||
* retransmission right away */
|
* retransmission right away */
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK,
|
||||||
gst_harness_push (h, generate_test_buffer_full (
|
gst_harness_push (h, generate_test_buffer_full (20 * GST_MSECOND, TRUE, 8,
|
||||||
20 * GST_MSECOND, TRUE, 8, 8 * PCMU_RTP_TS_DURATION)));
|
8 * PCMU_RTP_TS_DURATION)));
|
||||||
|
|
||||||
/* drop reconfigure event */
|
/* drop reconfigure event */
|
||||||
gst_event_unref (gst_harness_pull_upstream_event (h));
|
gst_event_unref (gst_harness_pull_upstream_event (h));
|
||||||
|
@ -1079,8 +1078,8 @@ GST_START_TEST (test_rtx_packet_delay)
|
||||||
|
|
||||||
/* push 9, this should immediately request retransmission of 5 */
|
/* push 9, this should immediately request retransmission of 5 */
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK,
|
||||||
gst_harness_push (h, generate_test_buffer_full (
|
gst_harness_push (h, generate_test_buffer_full (20 * GST_MSECOND, TRUE, 9,
|
||||||
20 * GST_MSECOND, TRUE, 9, 9 * PCMU_RTP_TS_DURATION)));
|
9 * PCMU_RTP_TS_DURATION)));
|
||||||
|
|
||||||
/* we should now receive retransmission requests for 5 */
|
/* we should now receive retransmission requests for 5 */
|
||||||
out_event = gst_harness_pull_upstream_event (h);
|
out_event = gst_harness_pull_upstream_event (h);
|
||||||
|
@ -1203,7 +1202,7 @@ GST_START_TEST (test_gap_exceeds_latency)
|
||||||
|
|
||||||
/* Now data comes in again, a "bulk" lost packet is created for 3 -> 5 */
|
/* Now data comes in again, a "bulk" lost packet is created for 3 -> 5 */
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK,
|
||||||
gst_harness_push (h, generate_test_buffer (16)));
|
gst_harness_push (h, generate_test_buffer (16)));
|
||||||
|
|
||||||
/* FIXME: something is up with the timestamp here!!?! */
|
/* FIXME: something is up with the timestamp here!!?! */
|
||||||
out_event = gst_harness_pull_upstream_event (h);
|
out_event = gst_harness_pull_upstream_event (h);
|
||||||
|
@ -1219,7 +1218,7 @@ GST_START_TEST (test_gap_exceeds_latency)
|
||||||
|
|
||||||
for (i = 8; i < 16; i++) {
|
for (i = 8; i < 16; i++) {
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK,
|
||||||
gst_harness_push (h, generate_test_buffer (i)));
|
gst_harness_push (h, generate_test_buffer (i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: wtf is going on with timestamps and durations here??!? */
|
/* FIXME: wtf is going on with timestamps and durations here??!? */
|
||||||
|
@ -1242,7 +1241,7 @@ GST_START_TEST (test_gap_exceeds_latency)
|
||||||
|
|
||||||
/* 8 */
|
/* 8 */
|
||||||
for (i = 8; i <= 16; i++) {
|
for (i = 8; i <= 16; i++) {
|
||||||
GstBuffer * out_buf = gst_harness_pull (h);
|
GstBuffer *out_buf = gst_harness_pull (h);
|
||||||
GST_DEBUG ("pop %d", i);
|
GST_DEBUG ("pop %d", i);
|
||||||
fail_unless_equals_int (i, get_rtp_seq_num (out_buf));
|
fail_unless_equals_int (i, get_rtp_seq_num (out_buf));
|
||||||
gst_buffer_unref (out_buf);
|
gst_buffer_unref (out_buf);
|
||||||
|
@ -1341,7 +1340,7 @@ GST_START_TEST (test_dts_gap_larger_than_latency)
|
||||||
/* Push packet with DTS larger than latency */
|
/* Push packet with DTS larger than latency */
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK,
|
||||||
gst_harness_push (h, generate_test_buffer_full (dts_after_gap,
|
gst_harness_push (h, generate_test_buffer_full (dts_after_gap,
|
||||||
TRUE, 5, 5 * PCMU_RTP_TS_DURATION)));
|
TRUE, 5, 5 * PCMU_RTP_TS_DURATION)));
|
||||||
|
|
||||||
/* drop GstEventStreamStart & GstEventCaps & GstEventSegment */
|
/* drop GstEventStreamStart & GstEventCaps & GstEventSegment */
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
|
@ -1364,7 +1363,7 @@ GST_END_TEST;
|
||||||
GST_START_TEST (test_push_big_gap)
|
GST_START_TEST (test_push_big_gap)
|
||||||
{
|
{
|
||||||
GstHarness *h = gst_harness_new ("rtpjitterbuffer");
|
GstHarness *h = gst_harness_new ("rtpjitterbuffer");
|
||||||
GstBuffer * buf;
|
GstBuffer *buf;
|
||||||
const gint num_consecutive = 5;
|
const gint num_consecutive = 5;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
@ -1377,7 +1376,7 @@ GST_START_TEST (test_push_big_gap)
|
||||||
fail_unless (gst_harness_crank_single_clock_wait (h));
|
fail_unless (gst_harness_crank_single_clock_wait (h));
|
||||||
|
|
||||||
for (i = 0; i < num_consecutive; i++) {
|
for (i = 0; i < num_consecutive; i++) {
|
||||||
GstBuffer * buf = gst_harness_pull (h);
|
GstBuffer *buf = gst_harness_pull (h);
|
||||||
fail_unless_equals_int (1000 + i, get_rtp_seq_num (buf));
|
fail_unless_equals_int (1000 + i, get_rtp_seq_num (buf));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
|
@ -1391,7 +1390,7 @@ GST_START_TEST (test_push_big_gap)
|
||||||
fail_unless (gst_harness_crank_single_clock_wait (h));
|
fail_unless (gst_harness_crank_single_clock_wait (h));
|
||||||
|
|
||||||
for (i = 0; i < num_consecutive; i++) {
|
for (i = 0; i < num_consecutive; i++) {
|
||||||
GstBuffer * buf = gst_harness_pull (h);
|
GstBuffer *buf = gst_harness_pull (h);
|
||||||
fail_unless_equals_int (20000 + i, get_rtp_seq_num (buf));
|
fail_unless_equals_int (20000 + i, get_rtp_seq_num (buf));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue