summaryrefslogtreecommitdiff
path: root/tests/check/elements/flvmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/check/elements/flvmux.c')
-rw-r--r--tests/check/elements/flvmux.c75
1 files changed, 39 insertions, 36 deletions
diff --git a/tests/check/elements/flvmux.c b/tests/check/elements/flvmux.c
index 7353ced3d..8ce29f5cb 100644
--- a/tests/check/elements/flvmux.c
+++ b/tests/check/elements/flvmux.c
@@ -157,8 +157,8 @@ static GstBuffer *
create_buffer (guint8 * data, gsize size,
GstClockTime timestamp, GstClockTime duration)
{
- GstBuffer * buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
- data, size, 0, size, NULL, NULL);
+ GstBuffer *buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
+ data, size, 0, size, NULL, NULL);
GST_BUFFER_PTS (buf) = timestamp;
GST_BUFFER_DTS (buf) = timestamp;
GST_BUFFER_DURATION (buf) = duration;
@@ -169,43 +169,43 @@ create_buffer (guint8 * data, gsize size,
GST_START_TEST (test_speex_streamable)
{
- GstBuffer * buf;
+ GstBuffer *buf;
GstMapInfo map = GST_MAP_INFO_INIT;
guint8 header0[] = {
- 0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20,
- 0x31, 0x2e, 0x32, 0x72, 0x63, 0x31, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x50, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ 0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20, 0x20,
+ 0x31, 0x2e, 0x32, 0x72, 0x63, 0x31, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x50, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
guint8 header1[] = {
- 0x1f, 0x00, 0x00, 0x00, 0x45, 0x6e, 0x63, 0x6f,
- 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68,
- 0x20, 0x47, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
- 0x65, 0x72, 0x20, 0x53, 0x70, 0x65, 0x65, 0x78,
- 0x65, 0x6e, 0x63, 0x00, 0x00, 0x00, 0x00, 0x01
+ 0x1f, 0x00, 0x00, 0x00, 0x45, 0x6e, 0x63, 0x6f,
+ 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68,
+ 0x20, 0x47, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
+ 0x65, 0x72, 0x20, 0x53, 0x70, 0x65, 0x65, 0x78,
+ 0x65, 0x6e, 0x63, 0x00, 0x00, 0x00, 0x00, 0x01
};
guint8 buffer[] = {
- 0x36, 0x9d, 0x1b, 0x9a, 0x20, 0x00, 0x01, 0x68,
- 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0x84,
- 0x00, 0xb4, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74,
- 0x74, 0x42, 0x00, 0x5a, 0x3a, 0x3a, 0x3a, 0x3a,
- 0x3a, 0x3a, 0x3a, 0x21, 0x00, 0x2d, 0x1d, 0x1d,
- 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1b, 0x3b, 0x60,
- 0xab, 0xab, 0xab, 0xab, 0xab, 0x0a, 0xba, 0xba,
- 0xba, 0xba, 0xb0, 0xab, 0xab, 0xab, 0xab, 0xab,
- 0x0a, 0xba, 0xba, 0xba, 0xba, 0xb7
+ 0x36, 0x9d, 0x1b, 0x9a, 0x20, 0x00, 0x01, 0x68,
+ 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0x84,
+ 0x00, 0xb4, 0x74, 0x74, 0x74, 0x74, 0x74, 0x74,
+ 0x74, 0x42, 0x00, 0x5a, 0x3a, 0x3a, 0x3a, 0x3a,
+ 0x3a, 0x3a, 0x3a, 0x21, 0x00, 0x2d, 0x1d, 0x1d,
+ 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1b, 0x3b, 0x60,
+ 0xab, 0xab, 0xab, 0xab, 0xab, 0x0a, 0xba, 0xba,
+ 0xba, 0xba, 0xb0, 0xab, 0xab, 0xab, 0xab, 0xab,
+ 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,
"channels", G_TYPE_INT, 1,
NULL);
@@ -214,7 +214,7 @@ GST_START_TEST (test_speex_streamable)
const GstClockTime duration_ms = 20;
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);
g_object_set (h->element, "streamable", 1, NULL);
@@ -226,11 +226,11 @@ GST_START_TEST (test_speex_streamable)
/* push speex data */
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),
- base_time + duration, duration));
+ base_time + duration, duration));
/* pull out stream-start event */
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 */
{
- GstEvent * event = gst_harness_pull_event (h);
- const GstSegment * segment;
+ GstEvent *event = gst_harness_pull_event (h);
+ const GstSegment *segment;
gst_event_parse_segment (event, &segment);
fail_unless_equals_int (GST_FORMAT_TIME, segment->format);
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 (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_END (buf));
+ fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
+ GST_BUFFER_OFFSET_END (buf));
gst_buffer_map (buf, &map, GST_MAP_READ);
/* 0x08 means it is audio */
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 (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_END (buf));
+ fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
+ GST_BUFFER_OFFSET_END (buf));
gst_buffer_map (buf, &map, GST_MAP_READ);
/* 0x08 means it is audio */
fail_unless_equals_int (0x08, map.data[0]);
@@ -328,6 +330,7 @@ GST_START_TEST (test_speex_streamable)
gst_harness_teardown (h);
}
+
GST_END_TEST;
static Suite *