Further changes to selectable H.264 support

- Fix CI errors
- tconfig_load_gfx() removes H.264 from the supported codec list
  if significant errors are found loading the H.264 configuration
- tconfig_load_gfx() always produces a usable config, even if the
  specified file can't be loaded
This commit is contained in:
matt335672
2024-08-29 12:17:45 +01:00
committed by Koichiro Iwao
parent 1ac216da1d
commit 5351511272
5 changed files with 122 additions and 14 deletions
+9
View File
@@ -0,0 +1,9 @@
[codec]
order = [ "H.264", "RFX" ]
[x264.lan]
[x264.wan]
[x264.broadband_high]
[x264.satellite]
[x264.broadband_low]
[x264.modem]
+24
View File
@@ -73,6 +73,28 @@ START_TEST(test_tconfig_gfx_codec_order)
}
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)
@@ -86,6 +108,8 @@ make_suite_tconfig_load_gfx(void)
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);