static GstBuffer *
create_rtp_buffer_with_timestamp (guint32 ssrc, guint8 payload_type,
- guint16 seqnum, guint32 timestamp)
+ guint16 seqnum, guint32 timestamp, GstClockTime pts)
{
guint payload_size = 29;
GstRTPBuffer *rtpbuf = create_rtp_buffer_ex (ssrc, payload_type, seqnum,
gst_rtp_buffer_unmap (rtpbuf);
g_free (rtpbuf);
+
+ GST_BUFFER_PTS (ret) = pts;
+
return ret;
}
g_object_set (h->element, "payload-type-map", pt_map, NULL);
gst_harness_set_src_caps_str (h, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
/* push a packet */
fail_unless_equals_int (GST_FLOW_OK,
g_object_set (h->element, "ssrc-map", ssrc_map, NULL);
gst_harness_set_src_caps_str (h, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
/* push, pull, request-rtx, verify nothing arrives */
fail_unless_equals_int (GST_FLOW_OK,
"96", G_TYPE_UINT, rtx_pt, NULL);
g_object_set (h->element, "payload-type-map", pt_map, NULL);
gst_harness_set_src_caps_str (h, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
/* Assosiating master stream & rtx stream */
gst_harness_push_upstream_event (h,
g_object_set (hsend->element, "payload-type-map", pt_map, NULL);
gst_harness_set_src_caps_str (hsend, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
gst_harness_set_src_caps_str (hrecv, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
/* Push 'packets_num' packets through rtxsend to rtxreceive */
for (i = 0; i < packets_num; i++) {
g_object_set (hsend->element, "payload-type-map", pt_map, NULL);
gst_harness_set_src_caps_str (hsend, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
gst_harness_set_src_caps_str (hrecv, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
/* Getting rid of reconfigure event. Making sure there is no upstream
events in the queue. Preparation step before the test. */
pt_map = create_rtxsenders (senders, 5);
g_object_set (hrecv->element, "payload-type-map", pt_map, NULL);
gst_harness_set_src_caps_str (hrecv, "application/x-rtp, "
- "media = (string)video, payload = (int)80, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ "clock-rate = (int)90000");
/* Getting rid of reconfigure event. Making sure there is no upstream
events in the queue. Preparation step before the test. */
GST_END_TEST;
static void
-test_rtxsender_packet_retention (gboolean test_with_time)
+test_rtxsender_packet_retention (gboolean test_with_time,
+ gboolean clock_rate_in_caps)
{
guint master_ssrc = 1234567;
guint master_pt = 96;
GstStructure *ssrc_map = gst_structure_new ("application/x-rtp-ssrc-map",
"1234567", G_TYPE_UINT, rtx_ssrc, NULL);
gint i, j;
+ GstClockTime pts = 0;
h = gst_harness_new ("rtprtxsend");
"max-size-time", test_with_time ? 499 : 0,
"payload-type-map", pt_map, "ssrc-map", ssrc_map, NULL);
- gst_harness_set_src_caps_str (h, "application/x-rtp, "
- "media = (string)video, payload = (int)96, "
- "ssrc = (uint)1234567, clock-rate = (int)90000, "
- "encoding-name = (string)RAW");
+ if (clock_rate_in_caps) {
+ gst_harness_set_src_caps_str (h, "application/x-rtp, "
+ "clock-rate = (int)90000");
+ } else {
+ gst_harness_set_src_caps_str (h, "application/x-rtp");
+ }
/* Now push all buffers and request retransmission every time for all of them */
- for (i = 0; i < num_buffers; ++i, timestamp += timestamp_delta) {
+ for (i = 0; i < num_buffers; i++) {
+ pts += GST_SECOND / 30;
+ timestamp += timestamp_delta;
/* Request to retransmit all the previous ones */
- for (j = 0; j < i; ++j) {
+ for (j = 0; j < i; j++) {
guint rtx_seqnum = 0x100 + j;
gst_harness_push_upstream_event (h,
create_rtx_event (master_ssrc, master_pt, rtx_seqnum));
to be sure, rtprtxsend can handle it properly */
push_pull_and_verify (h,
create_rtp_buffer_with_timestamp (master_ssrc, master_pt, 0x100 + i,
- timestamp), FALSE, master_ssrc, master_pt, 0x100 + i);
+ timestamp, pts), FALSE, master_ssrc, master_pt, 0x100 + i);
}
gst_structure_free (pt_map);
GST_START_TEST (test_rtxsender_max_size_packets)
{
- test_rtxsender_packet_retention (FALSE);
+ test_rtxsender_packet_retention (FALSE, TRUE);
}
GST_END_TEST;
GST_START_TEST (test_rtxsender_max_size_time)
{
- test_rtxsender_packet_retention (TRUE);
+ test_rtxsender_packet_retention (TRUE, TRUE);
+}
+
+GST_END_TEST;
+
+GST_START_TEST (test_rtxsender_max_size_time_no_clock_rate)
+{
+ test_rtxsender_packet_retention (TRUE, FALSE);
}
GST_END_TEST;
tcase_add_test (tc_chain, test_multi_rtxsend_rtxreceive_with_packet_loss);
tcase_add_test (tc_chain, test_rtxsender_max_size_packets);
tcase_add_test (tc_chain, test_rtxsender_max_size_time);
+ tcase_add_test (tc_chain, test_rtxsender_max_size_time_no_clock_rate);
+
tcase_add_test (tc_chain, test_rtxqueue_max_size_packets);
tcase_add_test (tc_chain, test_rtxqueue_max_size_time);
tcase_add_test (tc_chain, test_rtxsender_clock_rate_map);