Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit ca90af8

Browse files
committed
updated to use new speed test
1 parent 5e0f98b commit ca90af8

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

build_script/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
REM @Echo Off
22
SET build_config=Release
3-
SET obs_version=17.0.2-ftl.31
3+
SET obs_version=17.0.2-ftl.32
44
SET coredeps=C:\beam\tachyon_deps
55
SET QTDIR64=C:\Qt\5.6\msvc2015_64
66
SET QTDIR32=C:\Qt\5.6\msvc2015

plugins/libftl/ftl-sdk

plugins/obs-outputs/ftl-stream.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,20 @@ static int send_packet(struct ftl_stream *stream,
385385
static void set_peak_bitrate(struct ftl_stream *stream) {
386386
int speedtest_kbps = 10000;
387387
int speedtest_duration = 2000;
388+
speed_test_t results;
389+
ftl_status_t status_code;
388390

389-
warn("Running speed test: sending %d kbps for %d ms", speedtest_kbps, speedtest_duration);
390-
int peak_kbps;
391-
peak_kbps = ftl_ingest_speed_test(&stream->ftl_handle, speedtest_kbps, speedtest_duration);
392-
393-
stream->params.peak_kbps = peak_kbps;
394-
stream->peak_kbps = peak_kbps;
391+
if ((status_code = ftl_ingest_speed_test_ex(&stream->ftl_handle, speedtest_kbps, speedtest_duration, &results)) == FTL_SUCCESS) {
392+
info("Speed test completed: Peak kbps %d, initial rtt %d, final rtt %d, %3.2f lost packets\n",
393+
results.peak_kbps, results.starting_rtt, results.ending_rtt, (float)results.lost_pkts * 100.f / (float)results.pkts_sent);
395394

396-
warn("Running speed test complete: setting peak bitrate to %d\n", stream->params.peak_kbps);
395+
stream->peak_kbps = stream->params.peak_kbps = results.peak_kbps;
397396

398-
ftl_ingest_update_params(&stream->ftl_handle, &stream->params);
397+
ftl_ingest_update_params(&stream->ftl_handle, &stream->params);
398+
}
399+
else {
400+
warn("Speed test failed with: %s\n", ftl_status_code_to_string(status_code));
401+
}
399402
}
400403

401404
static inline bool send_headers(struct ftl_stream *stream, int64_t dts_usec);

0 commit comments

Comments
 (0)