@@ -68,7 +68,8 @@ typedef enum {
68
68
mediatest_worst = 4 ,
69
69
mediatest_video2_down = 5 ,
70
70
mediatest_wifi = 6 ,
71
- mediatest_video2_back = 7
71
+ mediatest_video2_back = 7 ,
72
+ mediatest_suspension = 8
72
73
} mediatest_id_enum ;
73
74
74
75
typedef enum {
@@ -1121,6 +1122,7 @@ mediatest_ctx_t * mediatest_configure(int media_test_id, mediatest_spec_t * spe
1121
1122
picoquic_tp_t client_parameters ;
1122
1123
mediatest_init_transport_parameters (& client_parameters , 1 );
1123
1124
picoquic_set_transport_parameters (cnx , & client_parameters );
1125
+ picoquic_set_feedback_loss_notification (cnx , 1 );
1124
1126
1125
1127
if (picoquic_start_client_cnx (cnx ) != 0 ) {
1126
1128
picoquic_delete_cnx (cnx );
@@ -1197,6 +1199,7 @@ int mediatest_one(mediatest_id_enum media_test_id, mediatest_spec_t * spec)
1197
1199
if (mt_ctx == NULL ) {
1198
1200
ret = -1 ;
1199
1201
}
1202
+
1200
1203
/* Three special cases in which we manipulate the configuration
1201
1204
* to simulate various downgrade or suspension patterns.
1202
1205
*/
@@ -1210,15 +1213,14 @@ int mediatest_one(mediatest_id_enum media_test_id, mediatest_spec_t * spec)
1210
1213
ret = mediatest_loop (mt_ctx , 2000000 , 1 , & is_finished );
1211
1214
}
1212
1215
}
1213
-
1214
- if (media_test_id == mediatest_video2_down ||
1216
+ else if (media_test_id == mediatest_video2_down ||
1215
1217
media_test_id == mediatest_video2_back ) {
1216
1218
uint64_t picosec_per_byte_ref [2 ];
1217
1219
uint64_t latency_ref [2 ];
1218
1220
uint64_t down_time = (media_test_id == mediatest_video2_down ) ? 4000000 : 2000000 ;
1219
1221
uint64_t back_time = (media_test_id == mediatest_video2_down ) ? 24000000 : 4000000 ;
1220
1222
1221
- /* Run the simulation for 2 second . */
1223
+ /* Run the simulation for the first period . */
1222
1224
ret = mediatest_loop (mt_ctx , down_time , 0 , & is_finished );
1223
1225
/* Drop the bandwidth and increase latency for specified down time */
1224
1226
for (int i = 0 ; i < 2 ; i ++ ) {
@@ -1235,8 +1237,19 @@ int mediatest_one(mediatest_id_enum media_test_id, mediatest_spec_t * spec)
1235
1237
mt_ctx -> link [i ]-> microsec_latency = latency_ref [i ];
1236
1238
}
1237
1239
}
1238
-
1239
- if (media_test_id == mediatest_wifi ) {
1240
+ else if (media_test_id == mediatest_suspension ) {
1241
+ /* Simulate one single wifi suspension, for 150 ms at
1242
+ * t = 4000000 */
1243
+ uint64_t sim_time = 4000000 ;
1244
+ /* Run the simulation for the first period. */
1245
+ ret = mediatest_loop (mt_ctx , sim_time , 0 , & is_finished );
1246
+ /* Simulate the suspension for 150 ms */
1247
+ sim_time += 150000 ;
1248
+ for (int i = 0 ; i < 2 ; i ++ ) {
1249
+ picoquic_test_simlink_suspend (mt_ctx -> link [i ], sim_time , 0 );
1250
+ }
1251
+ }
1252
+ else if (media_test_id == mediatest_wifi ) {
1240
1253
/* For 10 seconds, run a test loop in which the simulated Wi-Fi
1241
1254
* link alternates between 100Mbps, low delay and just blocked,
1242
1255
* 0 bandwidth. The duration of the block unblock phase varies.
@@ -1412,6 +1425,24 @@ int mediatest_worst_test()
1412
1425
}
1413
1426
1414
1427
int mediatest_wifi_test ()
1428
+ {
1429
+ int ret ;
1430
+ mediatest_spec_t spec = { 0 };
1431
+ spec .ccalgo = picoquic_bbr_algorithm ;
1432
+ spec .bandwidth = 0.1 ;
1433
+ spec .do_video = 1 ;
1434
+ spec .do_video2 = 1 ;
1435
+ spec .do_audio = 1 ;
1436
+ spec .data_size = 0 ;
1437
+ spec .latency_average = 60000 ;
1438
+ spec .latency_max = 350000 ;
1439
+ spec .do_not_check_video2 = 1 ;
1440
+ ret = mediatest_one (mediatest_wifi , & spec );
1441
+
1442
+ return ret ;
1443
+ }
1444
+
1445
+ int mediatest_suspension_test ()
1415
1446
{
1416
1447
int ret ;
1417
1448
mediatest_spec_t spec = { 0 };
@@ -1424,7 +1455,7 @@ int mediatest_wifi_test()
1424
1455
spec .latency_average = 50000 ;
1425
1456
spec .latency_max = 300000 ;
1426
1457
spec .do_not_check_video2 = 1 ;
1427
- ret = mediatest_one (mediatest_wifi , & spec );
1458
+ ret = mediatest_one (mediatest_suspension , & spec );
1428
1459
1429
1460
return ret ;
1430
1461
}
0 commit comments