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

Commit

Permalink
updated to use new speed test
Browse files Browse the repository at this point in the history
  • Loading branch information
sslivins committed Feb 5, 2017
1 parent 5e0f98b commit ca90af8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build_script/build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REM @Echo Off
SET build_config=Release
SET obs_version=17.0.2-ftl.31
SET obs_version=17.0.2-ftl.32
SET coredeps=C:\beam\tachyon_deps
SET QTDIR64=C:\Qt\5.6\msvc2015_64
SET QTDIR32=C:\Qt\5.6\msvc2015
Expand Down
2 changes: 1 addition & 1 deletion plugins/libftl/ftl-sdk
19 changes: 11 additions & 8 deletions plugins/obs-outputs/ftl-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,20 @@ static int send_packet(struct ftl_stream *stream,
static void set_peak_bitrate(struct ftl_stream *stream) {
int speedtest_kbps = 10000;
int speedtest_duration = 2000;
speed_test_t results;
ftl_status_t status_code;

warn("Running speed test: sending %d kbps for %d ms", speedtest_kbps, speedtest_duration);
int peak_kbps;
peak_kbps = ftl_ingest_speed_test(&stream->ftl_handle, speedtest_kbps, speedtest_duration);

stream->params.peak_kbps = peak_kbps;
stream->peak_kbps = peak_kbps;
if ((status_code = ftl_ingest_speed_test_ex(&stream->ftl_handle, speedtest_kbps, speedtest_duration, &results)) == FTL_SUCCESS) {
info("Speed test completed: Peak kbps %d, initial rtt %d, final rtt %d, %3.2f lost packets\n",
results.peak_kbps, results.starting_rtt, results.ending_rtt, (float)results.lost_pkts * 100.f / (float)results.pkts_sent);

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

ftl_ingest_update_params(&stream->ftl_handle, &stream->params);
ftl_ingest_update_params(&stream->ftl_handle, &stream->params);
}
else {
warn("Speed test failed with: %s\n", ftl_status_code_to_string(status_code));
}
}

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

0 comments on commit ca90af8

Please sign in to comment.