Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
f40d6689
Commit
f40d6689
authored
Sep 23, 2013
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: remove timeouts from check
Timeouts make the test unreliable and are not needed.
parent
ae389aeb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
43 deletions
+30
-43
tests/check/elements/rtpjitterbuffer.c
tests/check/elements/rtpjitterbuffer.c
+30
-43
No files found.
tests/check/elements/rtpjitterbuffer.c
View file @
f40d6689
...
@@ -588,7 +588,6 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
...
@@ -588,7 +588,6 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
{
{
TestData
data
;
TestData
data
;
GstClockID
id
,
test_id
;
GstClockID
id
,
test_id
;
guint64
timeout
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstEvent
*
out_event
;
GstEvent
*
out_event
;
gint
jb_latency_ms
=
200
;
gint
jb_latency_ms
=
200
;
...
@@ -596,7 +595,6 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
...
@@ -596,7 +595,6 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
setup_testharness
(
&
data
);
setup_testharness
(
&
data
);
timeout
=
20
*
G_USEC_PER_SEC
;
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
...
@@ -615,7 +613,7 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
...
@@ -615,7 +613,7 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
==
id
);
==
id
);
/* check for the buffer coming out that was pushed in */
/* check for the buffer coming out that was pushed in */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
0
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
0
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
0
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
0
);
...
@@ -637,16 +635,13 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
...
@@ -637,16 +635,13 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* release the wait */
/* release the wait */
GST_DEBUG
(
"wait for id"
);
gst_test_clock_wait_for_next_pending_id
(
GST_TEST_CLOCK
(
data
.
clock
),
&
id
);
gst_test_clock_wait_for_next_pending_id
(
GST_TEST_CLOCK
(
data
.
clock
),
&
id
);
GST_DEBUG
(
"got wait id %p"
,
id
);
gst_test_clock_advance_time
(
GST_TEST_CLOCK
(
data
.
clock
),
GST_MSECOND
*
20
);
gst_test_clock_advance_time
(
GST_TEST_CLOCK
(
data
.
clock
),
GST_MSECOND
*
20
);
test_id
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
test_id
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
GST_DEBUG
(
"process id %p"
,
test_id
);
g_assert
(
id
==
test_id
);
g_assert
(
id
==
test_id
);
/* we should now receive a packet-lost-event for buffers 1 through 489 */
/* we should now receive a packet-lost-event for buffers 1 through 489 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
1
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
1
);
verify_lost_event
(
out_event
,
1
,
1
*
GST_MSECOND
*
20
,
GST_MSECOND
*
20
*
490
,
verify_lost_event
(
out_event
,
1
,
1
*
GST_MSECOND
*
20
,
GST_MSECOND
*
20
*
490
,
...
@@ -663,7 +658,7 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
...
@@ -663,7 +658,7 @@ GST_START_TEST (test_only_one_lost_event_on_large_gaps)
}
}
}
}
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
...
@@ -685,7 +680,6 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -685,7 +680,6 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
{
{
TestData
data
;
TestData
data
;
GstClockID
id
;
GstClockID
id
;
guint64
timeout
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstEvent
*
out_event
;
GstEvent
*
out_event
;
gint
jb_latency_ms
=
100
;
gint
jb_latency_ms
=
100
;
...
@@ -694,7 +688,6 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -694,7 +688,6 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
setup_testharness
(
&
data
);
setup_testharness
(
&
data
);
timeout
=
20
*
G_USEC_PER_SEC
;
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
...
@@ -707,7 +700,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -707,7 +700,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
gst_test_clock_set_time
(
GST_TEST_CLOCK
(
data
.
clock
),
now
);
gst_test_clock_set_time
(
GST_TEST_CLOCK
(
data
.
clock
),
now
);
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
==
id
);
==
id
);
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
/* push some buffers arriving in perfect time! */
/* push some buffers arriving in perfect time! */
...
@@ -718,7 +711,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -718,7 +711,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* check for the buffer coming out that was pushed in */
/* check for the buffer coming out that was pushed in */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
buffer_time
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
buffer_time
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
buffer_time
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
buffer_time
);
...
@@ -743,7 +736,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -743,7 +736,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
==
id
);
==
id
);
/* we should now receive a packet-lost-event for buffer 3 */
/* we should now receive a packet-lost-event for buffer 3 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
1
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
1
);
verify_lost_event
(
out_event
,
3
,
3
*
GST_MSECOND
*
20
,
GST_MSECOND
*
20
,
verify_lost_event
(
out_event
,
3
,
3
*
GST_MSECOND
*
20
,
GST_MSECOND
*
20
,
...
@@ -756,7 +749,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -756,7 +749,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* verify that buffer 4 made it through! */
/* verify that buffer 4 made it through! */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
...
@@ -764,7 +757,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
...
@@ -764,7 +757,7 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
gst_rtp_buffer_unmap
(
&
rtp
);
gst_rtp_buffer_unmap
(
&
rtp
);
/* and see that buffer 5 now arrives in a normal fashion */
/* and see that buffer 5 now arrives in a normal fashion */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
!
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
g_assert
(
!
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
...
@@ -783,7 +776,6 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
...
@@ -783,7 +776,6 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
{
{
TestData
data
;
TestData
data
;
GstClockID
id
;
GstClockID
id
;
guint64
timeout
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstEvent
*
out_event
;
GstEvent
*
out_event
;
gint
jb_latency_ms
=
10
;
gint
jb_latency_ms
=
10
;
...
@@ -792,7 +784,6 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
...
@@ -792,7 +784,6 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
setup_testharness
(
&
data
);
setup_testharness
(
&
data
);
timeout
=
20
*
G_USEC_PER_SEC
;
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
...
@@ -805,7 +796,7 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
...
@@ -805,7 +796,7 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
gst_test_clock_wait_for_next_pending_id
(
GST_TEST_CLOCK
(
data
.
clock
),
&
id
);
gst_test_clock_wait_for_next_pending_id
(
GST_TEST_CLOCK
(
data
.
clock
),
&
id
);
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
==
id
);
==
id
);
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
/* push some buffers in! */
/* push some buffers in! */
...
@@ -815,7 +806,7 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
...
@@ -815,7 +806,7 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* check for the buffer coming out that was pushed in */
/* check for the buffer coming out that was pushed in */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
buffer_time
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
buffer_time
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
buffer_time
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
buffer_time
);
...
@@ -828,14 +819,14 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
...
@@ -828,14 +819,14 @@ GST_START_TEST (test_late_packets_still_makes_lost_events)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* we should now receive a packet-lost-event for buffer 3 and 4 */
/* we should now receive a packet-lost-event for buffer 3 and 4 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
1
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
1
);
verify_lost_event
(
out_event
,
3
,
3
*
GST_MSECOND
*
20
,
GST_MSECOND
*
20
*
2
,
verify_lost_event
(
out_event
,
3
,
3
*
GST_MSECOND
*
20
,
GST_MSECOND
*
20
*
2
,
TRUE
);
TRUE
);
/* verify that buffer 5 made it through! */
/* verify that buffer 5 made it through! */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
...
@@ -854,7 +845,6 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
...
@@ -854,7 +845,6 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
{
{
TestData
data
;
TestData
data
;
GstClockID
id
;
GstClockID
id
;
guint64
timeout
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstEvent
*
out_event
;
GstEvent
*
out_event
;
gint
jb_latency_ms
=
10
;
gint
jb_latency_ms
=
10
;
...
@@ -862,7 +852,6 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
...
@@ -862,7 +852,6 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
setup_testharness
(
&
data
);
setup_testharness
(
&
data
);
timeout
=
20
*
G_USEC_PER_SEC
;
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
g_object_set
(
data
.
jitter_buffer
,
"latency"
,
jb_latency_ms
,
NULL
);
...
@@ -875,7 +864,7 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
...
@@ -875,7 +864,7 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
gst_test_clock_wait_for_next_pending_id
(
GST_TEST_CLOCK
(
data
.
clock
),
&
id
);
gst_test_clock_wait_for_next_pending_id
(
GST_TEST_CLOCK
(
data
.
clock
),
&
id
);
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
==
id
);
==
id
);
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
/* push some buffers in! */
/* push some buffers in! */
...
@@ -884,7 +873,7 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
...
@@ -884,7 +873,7 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* check for the buffer coming out that was pushed in */
/* check for the buffer coming out that was pushed in */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
0
);
g_assert_cmpint
(
GST_BUFFER_DTS
(
out_buf
),
==
,
0
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
0
);
g_assert_cmpint
(
GST_BUFFER_PTS
(
out_buf
),
==
,
0
);
...
@@ -896,18 +885,18 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
...
@@ -896,18 +885,18 @@ GST_START_TEST (test_all_packets_are_timestamped_zero)
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
g_assert_cmpint
(
gst_pad_push
(
data
.
test_src_pad
,
in_buf
),
==
,
GST_FLOW_OK
);
/* we should now receive a packet-lost-event for buffer 3 and 4 */
/* we should now receive a packet-lost-event for buffer 3 and 4 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_lost_event
(
out_event
,
3
,
0
,
0
,
FALSE
);
verify_lost_event
(
out_event
,
3
,
0
,
0
,
FALSE
);
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_lost_event
(
out_event
,
4
,
0
,
0
,
FALSE
);
verify_lost_event
(
out_event
,
4
,
0
,
0
,
FALSE
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
2
);
g_assert_cmpint
(
data
.
lost_event_count
,
==
,
2
);
/* verify that buffer 5 made it through! */
/* verify that buffer 5 made it through! */
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
g_assert
(
GST_BUFFER_FLAG_IS_SET
(
out_buf
,
GST_BUFFER_FLAG_DISCONT
));
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
...
@@ -929,7 +918,6 @@ GST_START_TEST (test_rtx_expected_next)
...
@@ -929,7 +918,6 @@ GST_START_TEST (test_rtx_expected_next)
GstBuffer
*
in_buf
,
*
out_buf
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstEvent
*
out_event
;
GstEvent
*
out_event
;
gint
jb_latency_ms
=
200
;
gint
jb_latency_ms
=
200
;
GstClockTime
timeout
=
20
*
G_USEC_PER_SEC
;
setup_testharness
(
&
data
);
setup_testharness
(
&
data
);
g_object_set
(
data
.
jitter_buffer
,
"do-retransmission"
,
TRUE
,
NULL
);
g_object_set
(
data
.
jitter_buffer
,
"do-retransmission"
,
TRUE
,
NULL
);
...
@@ -954,7 +942,7 @@ GST_START_TEST (test_rtx_expected_next)
...
@@ -954,7 +942,7 @@ GST_START_TEST (test_rtx_expected_next)
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
g_assert
(
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
))
==
id
);
==
id
);
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
,
20
*
GST_MSECOND
);
...
@@ -964,7 +952,7 @@ GST_START_TEST (test_rtx_expected_next)
...
@@ -964,7 +952,7 @@ GST_START_TEST (test_rtx_expected_next)
tid
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
tid
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
g_assert
(
id
==
tid
);
g_assert
(
id
==
tid
);
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
60
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
60
,
20
*
GST_MSECOND
);
...
@@ -973,7 +961,7 @@ GST_START_TEST (test_rtx_expected_next)
...
@@ -973,7 +961,7 @@ GST_START_TEST (test_rtx_expected_next)
tid
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
tid
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
g_assert
(
id
==
tid
);
g_assert
(
id
==
tid
);
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
100
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
100
,
20
*
GST_MSECOND
);
...
@@ -982,7 +970,7 @@ GST_START_TEST (test_rtx_expected_next)
...
@@ -982,7 +970,7 @@ GST_START_TEST (test_rtx_expected_next)
tid
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
tid
=
gst_test_clock_process_next_clock_id
(
GST_TEST_CLOCK
(
data
.
clock
));
g_assert
(
id
==
tid
);
g_assert
(
id
==
tid
);
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
...
@@ -992,7 +980,7 @@ GST_START_TEST (test_rtx_expected_next)
...
@@ -992,7 +980,7 @@ GST_START_TEST (test_rtx_expected_next)
==
id
);
==
id
);
/* we should now receive a packet-lost-event for buffer 2 */
/* we should now receive a packet-lost-event for buffer 2 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_lost_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
*
GST_MSECOND
,
FALSE
);
verify_lost_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
*
GST_MSECOND
,
FALSE
);
...
@@ -1008,7 +996,6 @@ GST_START_TEST (test_rtx_two_missing)
...
@@ -1008,7 +996,6 @@ GST_START_TEST (test_rtx_two_missing)
GstBuffer
*
in_buf
,
*
out_buf
;
GstBuffer
*
in_buf
,
*
out_buf
;
GstEvent
*
out_event
;
GstEvent
*
out_event
;
gint
jb_latency_ms
=
200
;
gint
jb_latency_ms
=
200
;
GstClockTime
timeout
=
20
*
G_USEC_PER_SEC
;
gint
i
;
gint
i
;
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
GstRTPBuffer
rtp
=
GST_RTP_BUFFER_INIT
;
...
@@ -1042,10 +1029,10 @@ GST_START_TEST (test_rtx_two_missing)
...
@@ -1042,10 +1029,10 @@ GST_START_TEST (test_rtx_two_missing)
==
id
);
==
id
);
/* we should have 2 events now, one for 2 and another for 3 */
/* we should have 2 events now, one for 2 and another for 3 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
,
20
*
GST_MSECOND
);
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
3
,
60
*
GST_MSECOND
,
0
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
3
,
60
*
GST_MSECOND
,
0
,
20
*
GST_MSECOND
);
...
@@ -1056,10 +1043,10 @@ GST_START_TEST (test_rtx_two_missing)
...
@@ -1056,10 +1043,10 @@ GST_START_TEST (test_rtx_two_missing)
g_assert
(
id
==
tid
);
g_assert
(
id
==
tid
);
/* we should have 2 events now, one for 2 and another for 3 */
/* we should have 2 events now, one for 2 and another for 3 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
60
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
60
,
20
*
GST_MSECOND
);
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
3
,
60
*
GST_MSECOND
,
40
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
3
,
60
*
GST_MSECOND
,
40
,
20
*
GST_MSECOND
);
...
@@ -1079,7 +1066,7 @@ GST_START_TEST (test_rtx_two_missing)
...
@@ -1079,7 +1066,7 @@ GST_START_TEST (test_rtx_two_missing)
g_assert
(
id
==
tid
);
g_assert
(
id
==
tid
);
/* now we only get requests for 2 */
/* now we only get requests for 2 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
src_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
src_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
100
,
20
*
GST_MSECOND
);
verify_rtx_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
100
,
20
*
GST_MSECOND
);
...
@@ -1091,7 +1078,7 @@ GST_START_TEST (test_rtx_two_missing)
...
@@ -1091,7 +1078,7 @@ GST_START_TEST (test_rtx_two_missing)
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
GST_DEBUG
(
"popping %d"
,
i
);
GST_DEBUG
(
"popping %d"
,
i
);
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
g_assert_cmpint
(
gst_rtp_buffer_get_seq
(
&
rtp
),
==
,
i
);
g_assert_cmpint
(
gst_rtp_buffer_get_seq
(
&
rtp
),
==
,
i
);
...
@@ -1105,14 +1092,14 @@ GST_START_TEST (test_rtx_two_missing)
...
@@ -1105,14 +1092,14 @@ GST_START_TEST (test_rtx_two_missing)
g_assert
(
id
==
tid
);
g_assert
(
id
==
tid
);
/* we should now receive a packet-lost-event for buffer 2 */
/* we should now receive a packet-lost-event for buffer 2 */
out_event
=
g_async_queue_
timeout_pop
(
data
.
sink_event_queue
,
timeout
);
out_event
=
g_async_queue_
pop
(
data
.
sink_event_queue
);
g_assert
(
out_event
!=
NULL
);
g_assert
(
out_event
!=
NULL
);
verify_lost_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
*
GST_MSECOND
,
FALSE
);
verify_lost_event
(
out_event
,
2
,
40
*
GST_MSECOND
,
20
*
GST_MSECOND
,
FALSE
);
/* verify that buffers made it through! */
/* verify that buffers made it through! */
for
(
i
=
3
;
i
<
15
;
i
++
)
{
for
(
i
=
3
;
i
<
15
;
i
++
)
{
GST_DEBUG
(
"popping %d"
,
i
);
GST_DEBUG
(
"popping %d"
,
i
);
out_buf
=
g_async_queue_
timeout_pop
(
data
.
buf_queue
,
timeout
);
out_buf
=
g_async_queue_
pop
(
data
.
buf_queue
);
g_assert
(
out_buf
!=
NULL
);
g_assert
(
out_buf
!=
NULL
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
gst_rtp_buffer_map
(
out_buf
,
GST_MAP_READ
,
&
rtp
);
g_assert_cmpint
(
gst_rtp_buffer_get_seq
(
&
rtp
),
==
,
i
);
g_assert_cmpint
(
gst_rtp_buffer_get_seq
(
&
rtp
),
==
,
i
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment