Commit 63938ef7 authored by Sebastian Dröge's avatar Sebastian Dröge

gst: Don't declare variables inside the for loop header

This is a C99 feature.
parent fe2ae2c0
......@@ -174,8 +174,10 @@ gst_rtp_vp9_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
}
if (p_bit && f_bit) {
gint i;
/* At least one P_DIFF|N, up to three times */
for (gint i = 0; i < 3; i++) {
for (i = 0; i < 3; i++) {
guint p_diff, n_bit;
if (G_UNLIKELY (size < hdrsize + 1))
......
This diff is collapsed.
......@@ -138,6 +138,7 @@ GST_START_TEST (test_rtxsend_rtxreceive)
GstBuffer *inbufs[5];
GstHarness *hrecv = gst_harness_new ("rtprtxreceive");
GstHarness *hsend = gst_harness_new ("rtprtxsend");
gint i;
pt_map = gst_structure_new ("application/x-rtp-pt-map",
"96", G_TYPE_UINT, rtx_pt, NULL);
......@@ -154,7 +155,7 @@ GST_START_TEST (test_rtxsend_rtxreceive)
"encoding-name = (string)RAW");
/* Push 'packets_num' packets through rtxsend to rtxreceive */
for (gint i = 0; i < packets_num; ++i) {
for (i = 0; i < packets_num; ++i) {
inbufs[i] = create_rtp_buffer (master_ssrc, master_pt, 100 + i);
gst_harness_push (hsend, gst_buffer_ref (inbufs[i]));
gst_harness_push (hrecv, gst_harness_pull (hsend));
......@@ -169,7 +170,7 @@ GST_START_TEST (test_rtxsend_rtxreceive)
Push RTX packets from rtxsend to rtxreceive and
check that the packet produced out of RTX packet is the same
as an original packet */
for (gint i = 0; i < packets_num; ++i) {
for (i = 0; i < packets_num; ++i) {
GstBuffer *outbuf;
gst_harness_push_upstream_event (hrecv,
create_rtx_event (master_ssrc, master_pt, 100 + i));
......@@ -221,6 +222,7 @@ GST_START_TEST (test_rtxsend_rtxreceive_with_packet_loss)
GstStructure *pt_map;
GstHarness *hrecv = gst_harness_new ("rtprtxreceive");
GstHarness *hsend = gst_harness_new ("rtprtxsend");
gint drop_nth_packet, i;
pt_map = gst_structure_new ("application/x-rtp-pt-map",
"96", G_TYPE_UINT, rtx_pt, NULL);
......@@ -244,8 +246,8 @@ GST_START_TEST (test_rtxsend_rtxreceive_with_packet_loss)
/* Push 'packets_num' packets through rtxsend to rtxreceive loosing every
'drop_every_n_packets' packet. When we loose the packet we send RTX event
through rtxreceive to rtxsend, and verify the packet was retransmitted */
for (gint drop_nth_packet = 2; drop_nth_packet < 10; ++drop_nth_packet) {
for (gint i = 0; i < packets_num; ++i, ++seqnum) {
for (drop_nth_packet = 2; drop_nth_packet < 10; ++drop_nth_packet) {
for (i = 0; i < packets_num; ++i, ++seqnum) {
GstBuffer *outbuf;
GstBuffer *inbuf = create_rtp_buffer (master_ssrc, master_pt, seqnum);
gboolean drop_this_packet = ((i + 1) % drop_nth_packet) == 0;
......@@ -326,8 +328,9 @@ create_rtxsenders (RtxSender * senders, guint senders_num)
{
GstStructure *recv_pt_map =
gst_structure_new_empty ("application/x-rtp-pt-map");
gint i;
for (gint i = 0; i < senders_num; ++i) {
for (i = 0; i < senders_num; ++i) {
gchar *master_pt_str;
gchar *master_caps_str;
GstStructure *send_pt_map;
......@@ -366,7 +369,9 @@ static guint
check_rtxsenders_stats_and_teardown (RtxSender * senders, guint senders_num)
{
guint total_pakets_num = 0;
for (gint i = 0; i < senders_num; ++i) {
gint i;
for (i = 0; i < senders_num; ++i) {
guint rtx_requests;
guint rtx_packets;
g_object_get (G_OBJECT (senders[i].h->element),
......@@ -390,6 +395,7 @@ GST_START_TEST (test_multi_rtxsend_rtxreceive_with_packet_loss)
RtxSender senders[5];
GstStructure *pt_map;
GstHarness *hrecv = gst_harness_new ("rtprtxreceive");
gint drop_nth_packet, i, j;
pt_map = create_rtxsenders (senders, 5);
g_object_set (hrecv->element, "payload-type-map", pt_map, NULL);
......@@ -410,8 +416,8 @@ GST_START_TEST (test_multi_rtxsend_rtxreceive_with_packet_loss)
We need to make sure that all other senders will ignore the RTX event they
can't act upon.
*/
for (gint drop_nth_packet = 2; drop_nth_packet < 5; ++drop_nth_packet) {
for (gint i = 0; i < total_pakets_num; ++i) {
for (drop_nth_packet = 2; drop_nth_packet < 5; ++drop_nth_packet) {
for (i = 0; i < total_pakets_num; ++i) {
RtxSender *sender = &senders[i % senders_num];
gboolean drop_this_packet = ((i + 1) % drop_nth_packet) == 0;
GstBuffer *outbuf, *inbuf;
......@@ -432,7 +438,7 @@ GST_START_TEST (test_multi_rtxsend_rtxreceive_with_packet_loss)
rtxevent = gst_harness_pull_upstream_event (hrecv);
/* ... to all the senders */
for (gint j = 0; j < senders_num; ++j)
for (j = 0; j < senders_num; ++j)
gst_harness_push_upstream_event (senders[j].h,
gst_event_ref (rtxevent));
gst_event_unref (rtxevent);
......@@ -457,7 +463,7 @@ GST_START_TEST (test_multi_rtxsend_rtxreceive_with_packet_loss)
We should not have any packets in the harness queue by this point. It
means our senders didn't produce the packets for the unknown RTX event.
*/
for (gint j = 0; j < senders_num; ++j)
for (j = 0; j < senders_num; ++j)
fail_unless_equals_int (gst_harness_buffers_in_queue (senders[j].h), 0);
++sender->seqnum;
......@@ -506,6 +512,7 @@ test_rtxsender_packet_retention (gboolean test_with_time)
"96", G_TYPE_UINT, rtx_pt, NULL);
GstStructure *ssrc_map = gst_structure_new ("application/x-rtp-ssrc-map",
"1234567", G_TYPE_UINT, rtx_ssrc, NULL);
gint i, j;
h = gst_harness_new ("rtprtxsend");
......@@ -525,9 +532,9 @@ test_rtxsender_packet_retention (gboolean test_with_time)
"encoding-name = (string)RAW");
/* Now push all buffers and request retransmission every time for all of them */
for (gint i = 0; i < num_buffers; ++i, timestamp += timestamp_delta) {
for (i = 0; i < num_buffers; ++i, timestamp += timestamp_delta) {
/* Request to retransmit all the previous ones */
for (gint 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));
......
......@@ -25,6 +25,8 @@ GST_START_TEST (test_encode_lag_in_frames)
{
GstHarness *h = gst_harness_new_parse ("vp9enc lag-in-frames=5 cpu-used=8 "
"deadline=1");
gint i;
gst_harness_add_src_parse (h, "videotestsrc is-live=true pattern=black ! "
"capsfilter caps=\"video/x-raw,width=320,height=240,framerate=25/1\"",
TRUE);
......@@ -40,7 +42,7 @@ GST_START_TEST (test_encode_lag_in_frames)
fail_unless (gst_harness_push_event (h, gst_event_new_eos ()));
fail_unless_equals_int (gst_harness_buffers_received (h), 20);
for (gint i = 0; i < 20; i++) {
for (i = 0; i < 20; i++) {
GstBuffer *buffer = gst_harness_pull (h);
if (i == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment