From 0151b8edddc1fc718ef2e87ab4178b615ec01a59 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 25 May 2016 10:59:15 -0500 Subject: [PATCH] FS-9106 followup and tweaks on this patch after some testing --- src/mod/applications/mod_conference/conference_video.c | 4 ++-- src/switch_vpx.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 90f3144071..eb69e2e192 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1480,7 +1480,7 @@ void conference_video_launch_muxing_write_thread(conference_member_t *member) switch_mutex_lock(conference_globals.hash_mutex); if (!member->video_muxing_write_thread) { switch_threadattr_create(&thd_attr, member->pool); - switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); + //switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&member->video_muxing_write_thread, thd_attr, conference_video_muxing_write_thread_run, member, member->pool); } @@ -1493,7 +1493,7 @@ void conference_video_launch_muxing_thread(conference_obj_t *conference, mcu_can switch_mutex_lock(conference_globals.hash_mutex); if (!canvas->video_muxing_thread) { switch_threadattr_create(&thd_attr, conference->pool); - switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); + //switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); conference_utils_set_flag(conference, CFLAG_VIDEO_MUXING); switch_thread_create(&canvas->video_muxing_thread, thd_attr, diff --git a/src/switch_vpx.c b/src/switch_vpx.c index 6ad449f14e..ebfe51da97 100644 --- a/src/switch_vpx.c +++ b/src/switch_vpx.c @@ -360,7 +360,7 @@ static switch_status_t init_encoder(switch_codec_t *codec) vpx_codec_enc_cfg_t *config = &context->config; int token_parts = 1; int cpus = switch_core_cpu_count(); - int sane; + int sane, threads = 1; if (!context->codec_settings.video.width) { context->codec_settings.video.width = 1280; @@ -404,7 +404,9 @@ static switch_status_t init_encoder(switch_codec_t *codec) config->rc_target_bitrate = context->bandwidth; config->g_lag_in_frames = 0; config->kf_max_dist = 360;//2000; - config->g_threads = cpus - 1;//(cpus > 1) ? 2 : 1; + threads = cpus / 4; + if (threads < 0) threads = 1; + config->g_threads = threads; if (context->is_vp9) { //config->rc_dropframe_thresh = 2;