-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3225 from metalefty/v0.10-h264
[v0.10] H264 cherry picks
- Loading branch information
Showing
25 changed files
with
960 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[codec] | ||
order = [ "H.264", "RFX" ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
# inherits default | ||
|
||
[x264.wan] | ||
vbv_max_bitrate = 15000 | ||
vbv_buffer_size = 1500 | ||
|
||
[x264.broadband_high] | ||
preset = "superfast" | ||
vbv_max_bitrate = 8000 | ||
vbv_buffer_Size = 800 | ||
|
||
[x264.satellite] | ||
preset = "superfast" | ||
vbv_max_bitrate = 5000 | ||
vbv_buffer_size = 500 | ||
|
||
[x264.broadband_low] | ||
preset = "veryfast" | ||
tune = "zerolatency" | ||
vbv_max_bitrate = 1600 | ||
vbv_buffer_size = 66 | ||
|
||
[x264.modem] | ||
preset = "fast" | ||
tune = "zerolatency" | ||
vbv_max_bitrate = 1200 | ||
vbv_buffer_size = 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[codec] | ||
order = [ "H.264" ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[codec] | ||
order = [ "H.264", "RFX" ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[codec] | ||
order = [ ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[codec] | ||
order = [ "RFX" ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[codec] | ||
order = [ "RFX", "H.264" ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[codec] | ||
order = [ "RFX", "H.264", "RFX" ] | ||
|
||
[x264.default] | ||
preset = "ultrafast" | ||
tune = "zerolatency" | ||
profile = "main" # profile is forced to baseline if preset == ultrafast | ||
vbv_max_bitrate = 0 | ||
vbv_buffer_size = 0 | ||
fps_num = 24 | ||
fps_den = 1 | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[codec] | ||
order = [ "H.264", "RFX" ] | ||
|
||
[x264.lan] | ||
[x264.wan] | ||
[x264.broadband_high] | ||
[x264.satellite] | ||
[x264.broadband_low] | ||
[x264.modem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#if defined(HAVE_CONFIG_H) | ||
#include "config_ac.h" | ||
#endif | ||
|
||
#include "xrdp_tconfig.h" | ||
#include "test_xrdp.h" | ||
#include "xrdp.h" | ||
|
||
#define GFXCONF_STUBDIR XRDP_TOP_SRCDIR "/tests/xrdp/gfx/" | ||
|
||
START_TEST(test_tconfig_gfx_always_success) | ||
{ | ||
ck_assert_int_eq(1, 1); | ||
} | ||
END_TEST | ||
|
||
START_TEST(test_tconfig_gfx_x264_load_basic) | ||
{ | ||
struct xrdp_tconfig_gfx gfxconfig; | ||
int rv = tconfig_load_gfx(GFXCONF_STUBDIR "/gfx.toml", &gfxconfig); | ||
|
||
ck_assert_int_eq(rv, 0); | ||
|
||
/* default */ | ||
ck_assert_str_eq(gfxconfig.x264_param[0].preset, "ultrafast"); | ||
ck_assert_str_eq(gfxconfig.x264_param[0].tune, "zerolatency"); | ||
ck_assert_str_eq(gfxconfig.x264_param[0].profile, "main"); | ||
ck_assert_int_eq(gfxconfig.x264_param[0].vbv_max_bitrate, 0); | ||
ck_assert_int_eq(gfxconfig.x264_param[0].vbv_buffer_size, 0); | ||
ck_assert_int_eq(gfxconfig.x264_param[0].fps_num, 24); | ||
ck_assert_int_eq(gfxconfig.x264_param[0].fps_den, 1); | ||
|
||
} | ||
END_TEST | ||
|
||
START_TEST(test_tconfig_gfx_codec_order) | ||
{ | ||
struct xrdp_tconfig_gfx gfxconfig; | ||
|
||
/* H264 earlier */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_h264_preferred.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 2); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_H264); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[1], XTC_RFX); | ||
|
||
/* H264 only */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_h264_only.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 1); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_H264); | ||
|
||
/* RFX earlier */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_rfx_preferred.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 2); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_RFX); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[1], XTC_H264); | ||
|
||
/* RFX appears twice like: RFX, H264, RFX */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_rfx_preferred_odd.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 2); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_RFX); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[1], XTC_H264); | ||
|
||
/* RFX only */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_rfx_only.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 1); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_RFX); | ||
|
||
/* H264 is preferred if order undefined */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_order_undefined.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 2); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_H264); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[1], XTC_RFX); | ||
} | ||
END_TEST | ||
|
||
START_TEST(test_tconfig_gfx_missing_file) | ||
{ | ||
struct xrdp_tconfig_gfx gfxconfig; | ||
|
||
/* Check RFX config is returned if the file doesn't exist */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/no_such_file.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 1); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_RFX); | ||
} | ||
END_TEST | ||
|
||
START_TEST(test_tconfig_gfx_missing_h264) | ||
{ | ||
struct xrdp_tconfig_gfx gfxconfig; | ||
|
||
/* Check RFX config only is returned if H.264 parameters are missing */ | ||
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_missing_h264.toml", &gfxconfig); | ||
ck_assert_int_eq(gfxconfig.codec.codec_count, 1); | ||
ck_assert_int_eq(gfxconfig.codec.codecs[0], XTC_RFX); | ||
} | ||
END_TEST | ||
|
||
/******************************************************************************/ | ||
Suite * | ||
make_suite_tconfig_load_gfx(void) | ||
{ | ||
Suite *s; | ||
TCase *tc_tconfig_load_gfx; | ||
|
||
s = suite_create("GfxLoad"); | ||
|
||
tc_tconfig_load_gfx = tcase_create("xrdp_tconfig_load_gfx"); | ||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_always_success); | ||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_x264_load_basic); | ||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_codec_order); | ||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_missing_file); | ||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_missing_h264); | ||
|
||
suite_add_tcase(s, tc_tconfig_load_gfx); | ||
|
||
return s; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.