setup_audiodecodertester (GstStaticPadTemplate * sinktemplate,
GstStaticPadTemplate * srctemplate)
{
- GstHarness * h;
- GstElement * dec;
+ GstHarness *h;
+ GstElement *dec;
if (sinktemplate == NULL)
sinktemplate = &sinktemplate_default;
gst_harness_set_src_caps (h,
gst_caps_new_simple ("audio/x-test-custom",
- "channels", G_TYPE_INT, 2,
- "rate", G_TYPE_INT, 44100,
- NULL));
+ "channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL));
gst_object_unref (dec);
return h;
GstHarness *h = setup_audiodecodertester (NULL, NULL);
/* push a gap event to force audiodecoder to push a caps event */
- fail_unless (gst_harness_push_event (h, gst_event_new_gap (0,
- GST_SECOND)));
+ fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, GST_SECOND)));
fail_unless_equals_int (0, gst_harness_buffers_in_queue (h));
check_audiodecoder_negotiation (h);
((GstAudioDecoderTester *) h->element)->setoutputformat_on_decoding = TRUE;
/* push a gap event to force audiodecoder to push a caps event */
- fail_unless (gst_harness_push_event (h, gst_event_new_gap (0,
- GST_SECOND)));
+ fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, GST_SECOND)));
fail_unless_equals_int (0, gst_harness_buffers_in_queue (h));
check_audiodecoder_negotiation (h);
GstHarness *h = setup_audiodecodertester (NULL, NULL);
/* push a gap */
- fail_unless (gst_harness_push_event (h, gst_event_new_gap (0,
- GST_SECOND)));
+ fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, GST_SECOND)));
/* make sure the usual events have been received */
{
tags = gst_tag_list_new (GST_TAG_TRACK_NUMBER, i, NULL);
fail_unless (gst_harness_push_event (h, gst_event_new_tag (tags)));
} else {
- fail_unless (gst_harness_push (h, create_test_buffer (i)) == GST_FLOW_OK);
+ fail_unless (gst_harness_push (h,
+ create_test_buffer (i)) == GST_FLOW_OK);
}
}
} else {
/* Compound packet with padding in the last packet. Padding is included in
* the length of the last packet. */
guint8 rtcp_pkt[] = {
- 0x80, 0xC9, 0x00, 0x07, /* Type RR, length = 7 */
+ 0x80, 0xC9, 0x00, 0x07, /* Type RR, length = 7 */
0x97, 0x6d, 0x21, 0x6a,
0x4d, 0x16, 0xaf, 0x14,
0x10, 0x1f, 0xd9, 0x91,
0x3b, 0x79, 0x31, 0x50,
0xbe, 0x19, 0x12, 0xa8,
0xbb, 0xce, 0x9e, 0x3e,
- 0xA0, 0xCA, 0x00, 0x0A, /* P=1, Type SDES, length = 10 (includes padding) */
+ 0xA0, 0xCA, 0x00, 0x0A, /* P=1, Type SDES, length = 10 (includes padding) */
0x97, 0x6d, 0x21, 0x6a,
- 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
+ 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
+ 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
- 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
+ 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
+ 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
};
fail_unless (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
}
+
GST_END_TEST;
GST_START_TEST (test_rtcp_validate_with_padding_wrong_padlength)
/* Compound packet with padding in the last packet. Padding is included in
* the length of the last packet. */
guint8 rtcp_pkt[] = {
- 0x80, 0xC9, 0x00, 0x07, /* Type RR, length = 7 */
+ 0x80, 0xC9, 0x00, 0x07, /* Type RR, length = 7 */
0x97, 0x6d, 0x21, 0x6a,
0x4d, 0x16, 0xaf, 0x14,
0x10, 0x1f, 0xd9, 0x91,
0x3b, 0x79, 0x31, 0x50,
0xbe, 0x19, 0x12, 0xa8,
0xbb, 0xce, 0x9e, 0x3e,
- 0xA0, 0xCA, 0x00, 0x0A, /* P=1, Type SDES, length = 10 (includes padding) */
+ 0xA0, 0xCA, 0x00, 0x0A, /* P=1, Type SDES, length = 10 (includes padding) */
0x97, 0x6d, 0x21, 0x6a,
- 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
+ 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
+ 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
- 0x00, 0x00, 0x00, 0x03 /* RTCP padding (wrong length) */
+ 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
+ 0x00, 0x00, 0x00, 0x03 /* RTCP padding (wrong length) */
};
fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
}
+
GST_END_TEST;
GST_START_TEST (test_rtcp_validate_with_padding_excluded_from_length)
/* Compound packet with padding in the last packet. Padding is not included
* in the length. */
guint8 rtcp_pkt[] = {
- 0x80, 0xC9, 0x00, 0x07, /* Type RR, length = 7 */
+ 0x80, 0xC9, 0x00, 0x07, /* Type RR, length = 7 */
0x97, 0x6d, 0x21, 0x6a,
0x4d, 0x16, 0xaf, 0x14,
0x10, 0x1f, 0xd9, 0x91,
0x3b, 0x79, 0x31, 0x50,
0xbe, 0x19, 0x12, 0xa8,
0xbb, 0xce, 0x9e, 0x3e,
- 0xA0, 0xCA, 0x00, 0x09, /* P=1, Type SDES, length = 9 (excludes padding) */
+ 0xA0, 0xCA, 0x00, 0x09, /* P=1, Type SDES, length = 9 (excludes padding) */
0x97, 0x6d, 0x21, 0x6a,
- 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
+ 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
+ 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
- 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
+ 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
+ 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
};
fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
}
+
GST_END_TEST;
GST_START_TEST (test_rtcp_validate_with_padding_set_in_first_packet)
/* Compound packet with padding in the last packet but with the pad
bit set on first packet */
guint8 rtcp_pkt[] = {
- 0xA0, 0xC9, 0x00, 0x07, /* P=1, Type RR, length = 7 */
+ 0xA0, 0xC9, 0x00, 0x07, /* P=1, Type RR, length = 7 */
0x97, 0x6d, 0x21, 0x6a,
0x4d, 0x16, 0xaf, 0x14,
0x10, 0x1f, 0xd9, 0x91,
0x3b, 0x79, 0x31, 0x50,
0xbe, 0x19, 0x12, 0xa8,
0xbb, 0xce, 0x9e, 0x3e,
- 0x80, 0xCA, 0x00, 0x0a, /* Type SDES, length = 10 (include padding) */
+ 0x80, 0xCA, 0x00, 0x0a, /* Type SDES, length = 10 (include padding) */
0x97, 0x6d, 0x21, 0x6a,
- 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
+ 0x01, 0x0F, 0x00, 0x00, /* Type 1 (CNAME), length 15 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
+ 0x00, 0x02, 0x09, 0x00, /* Type 2 (NAME), length 9 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
- 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
+ 0x00, 0x00, 0x00, 0x00, /* Type 0 (no length, 2 unused bytes) */
+ 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
};
fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
}
+
GST_END_TEST;
GST_START_TEST (test_rtcp_validate_reduced_without_padding)
{
/* Reduced size packet without padding */
guint8 rtcp_pkt[] = {
- 0x80, 0xcd, 0x00, 0x07, /* Type FB, length = 8 */
+ 0x80, 0xcd, 0x00, 0x07, /* Type FB, length = 8 */
0x97, 0x6d, 0x21, 0x6a,
0x4d, 0x16, 0xaf, 0x14,
0x10, 0x1f, 0xd9, 0x91,
0xbb, 0xce, 0x9e, 0x3e,
};
- fail_unless (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt, sizeof (rtcp_pkt)));
+ fail_unless (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt,
+ sizeof (rtcp_pkt)));
}
+
GST_END_TEST;
GST_START_TEST (test_rtcp_validate_reduced_with_padding)
{
/* Reduced size packet with padding. */
guint8 rtcp_pkt[] = {
- 0xA0, 0xcd, 0x00, 0x08, /* P=1, Type FB, length = 8 */
+ 0xA0, 0xcd, 0x00, 0x08, /* P=1, Type FB, length = 8 */
0x97, 0x6d, 0x21, 0x6a,
0x4d, 0x16, 0xaf, 0x14,
0x10, 0x1f, 0xd9, 0x91,
0x3b, 0x79, 0x31, 0x50,
0xbe, 0x19, 0x12, 0xa8,
0xbb, 0xce, 0x9e, 0x3e,
- 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
+ 0x00, 0x00, 0x00, 0x04 /* RTCP padding */
};
fail_if (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt, sizeof (rtcp_pkt)));
}
+
GST_END_TEST;
GST_START_TEST (test_rtp_ntp64_extension)
tcase_add_test (tc_chain, test_rtcp_reduced_buffer);
tcase_add_test (tc_chain, test_rtcp_validate_with_padding);
tcase_add_test (tc_chain, test_rtcp_validate_with_padding_wrong_padlength);
- tcase_add_test (tc_chain, test_rtcp_validate_with_padding_excluded_from_length);
- tcase_add_test (tc_chain, test_rtcp_validate_with_padding_set_in_first_packet);
+ tcase_add_test (tc_chain,
+ test_rtcp_validate_with_padding_excluded_from_length);
+ tcase_add_test (tc_chain,
+ test_rtcp_validate_with_padding_set_in_first_packet);
tcase_add_test (tc_chain, test_rtcp_validate_reduced_without_padding);
tcase_add_test (tc_chain, test_rtcp_validate_reduced_with_padding);
tcase_add_test (tc_chain, test_rtp_ntp64_extension);
State *state;
state = create_payloader ("video/x-raw,framerate=(fraction)1/4", &sinktmpl,
- "perfect-rtptime", FALSE,
- NULL);
+ "perfect-rtptime", FALSE, NULL);
set_state (state, GST_STATE_PLAYING);
- push_buffer (state,
- "pts", 0 * GST_SECOND,
- NULL);
+ push_buffer (state, "pts", 0 * GST_SECOND, NULL);
set_state (state, GST_STATE_NULL);
validate_buffers_received (1);
- validate_buffer (0,
- "pts", 0 * GST_SECOND,
- NULL);
+ validate_buffer (0, "pts", 0 * GST_SECOND, NULL);
validate_events_received (3);
validate_normal_start_events (0);
- validate_event (1, "caps",
- "a-framerate", "0.25",
- NULL);
+ validate_event (1, "caps", "a-framerate", "0.25", NULL);
destroy_payloader (state);
}
{
State *state;
- state = create_payloader (
- "video/x-raw,framerate=(fraction)0/1,max-framerate=(fraction)1/8",
- &sinktmpl,
- "perfect-rtptime", FALSE,
- NULL);
+ state =
+ create_payloader
+ ("video/x-raw,framerate=(fraction)0/1,max-framerate=(fraction)1/8",
+ &sinktmpl, "perfect-rtptime", FALSE, NULL);
set_state (state, GST_STATE_PLAYING);
- push_buffer (state,
- "pts", 0 * GST_SECOND,
- NULL);
+ push_buffer (state, "pts", 0 * GST_SECOND, NULL);
set_state (state, GST_STATE_NULL);
validate_buffers_received (1);
- validate_buffer (0,
- "pts", 0 * GST_SECOND,
- NULL);
+ validate_buffer (0, "pts", 0 * GST_SECOND, NULL);
validate_events_received (3);
validate_normal_start_events (0);
- validate_event (1, "caps",
- "a-framerate", "0.125",
- NULL);
+ validate_event (1, "caps", "a-framerate", "0.125", NULL);
destroy_payloader (state);
}