From 827be99f9b514f50cdbe90070af570b051435394 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 6 Sep 2018 12:02:09 +0800 Subject: [PATCH] FS-11189 add some default config to be consistent if default xml config is missing --- conf/vanilla/autoload_configs/vpx.conf.xml | 1 + src/switch_vpx.c | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/conf/vanilla/autoload_configs/vpx.conf.xml b/conf/vanilla/autoload_configs/vpx.conf.xml index 1228468d3d..111c4890f9 100644 --- a/conf/vanilla/autoload_configs/vpx.conf.xml +++ b/conf/vanilla/autoload_configs/vpx.conf.xml @@ -116,6 +116,7 @@ + diff --git a/src/switch_vpx.c b/src/switch_vpx.c index 31ae7c0acd..558c0a9197 100644 --- a/src/switch_vpx.c +++ b/src/switch_vpx.c @@ -1383,7 +1383,36 @@ static void load_config() vpx_globals.max_bitrate = 0; vpx_globals.vp8.cpuused = -6; + vpx_globals.vp8.enc_cfg.g_profile = 2; + vpx_globals.vp8.enc_cfg.g_timebase.den = 1000; + vpx_globals.vp8.enc_cfg.g_error_resilient = VPX_ERROR_RESILIENT_PARTITIONS; + vpx_globals.vp8.enc_cfg.rc_resize_allowed = 1; + vpx_globals.vp8.enc_cfg.rc_end_usage = VPX_CBR; + vpx_globals.vp8.enc_cfg.rc_target_bitrate = switch_parse_bandwidth_string("1mb"); + vpx_globals.vp8.enc_cfg.rc_min_quantizer = 4; + vpx_globals.vp8.enc_cfg.rc_max_quantizer = 63; + vpx_globals.vp8.enc_cfg.rc_overshoot_pct = 50; + vpx_globals.vp8.enc_cfg.rc_buf_sz = 5000; + vpx_globals.vp8.enc_cfg.rc_buf_initial_sz = 1000; + vpx_globals.vp8.enc_cfg.rc_buf_optimal_sz = 1000; + vpx_globals.vp8.enc_cfg.kf_max_dist = 360; + vpx_globals.vp9.cpuused = -6; + vpx_globals.vp9.enc_cfg.g_profile = 2; + vpx_globals.vp9.enc_cfg.g_timebase.den = 1000; + vpx_globals.vp9.enc_cfg.g_error_resilient = VPX_ERROR_RESILIENT_PARTITIONS; + vpx_globals.vp9.enc_cfg.rc_resize_allowed = 1; + vpx_globals.vp9.enc_cfg.rc_end_usage = VPX_CBR; + vpx_globals.vp9.enc_cfg.rc_target_bitrate = switch_parse_bandwidth_string("1mb"); + vpx_globals.vp9.enc_cfg.rc_min_quantizer = 4; + vpx_globals.vp9.enc_cfg.rc_max_quantizer = 63; + vpx_globals.vp9.enc_cfg.rc_overshoot_pct = 50; + vpx_globals.vp9.enc_cfg.rc_buf_sz = 5000; + vpx_globals.vp9.enc_cfg.rc_buf_initial_sz = 1000; + vpx_globals.vp9.enc_cfg.rc_buf_optimal_sz = 1000; + vpx_globals.vp9.enc_cfg.kf_max_dist = 360; + vpx_globals.vp9.tune_content = VP9E_CONTENT_SCREEN; + vpx_globals.vp10.cpuused = -6; xml = switch_xml_open_cfg("vpx.conf", &cfg, NULL);