提交 a2b806c0 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-8876 make function public and use it in conference also

上级 1540546c
...@@ -2735,6 +2735,8 @@ SWITCH_DECLARE(const char *)switch_version_revision_human(void); ...@@ -2735,6 +2735,8 @@ SWITCH_DECLARE(const char *)switch_version_revision_human(void);
SWITCH_DECLARE(const char *)switch_version_full(void); SWITCH_DECLARE(const char *)switch_version_full(void);
SWITCH_DECLARE(const char *)switch_version_full_human(void); SWITCH_DECLARE(const char *)switch_version_full_human(void);
SWITCH_DECLARE(void) switch_core_autobind_cpu(void);
SWITCH_END_EXTERN_C SWITCH_END_EXTERN_C
#endif #endif
/* For Emacs: /* For Emacs:
......
...@@ -1486,6 +1486,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_ ...@@ -1486,6 +1486,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
return NULL; return NULL;
} }
switch_core_autobind_cpu();
while(conference_utils_member_test_flag(member, MFLAG_RUNNING)) { while(conference_utils_member_test_flag(member, MFLAG_RUNNING)) {
if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) { if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) {
mcu_layer_t *layer = NULL; mcu_layer_t *layer = NULL;
......
...@@ -5147,9 +5147,11 @@ int next_cpu(void) ...@@ -5147,9 +5147,11 @@ int next_cpu(void)
return x; return x;
} }
static void bind_cpu(void) SWITCH_DECLARE(void) switch_core_autobind_cpu(void)
{ {
switch_core_thread_set_cpu_affinity(next_cpu()); if (video_globals.cpu_count > 1) {
switch_core_thread_set_cpu_affinity(next_cpu());
}
} }
...@@ -5174,7 +5176,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi ...@@ -5174,7 +5176,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
return NULL; return NULL;
} }
bind_cpu(); switch_core_autobind_cpu();
if ((var = switch_channel_get_variable(session->channel, "core_video_blank_image"))) { if ((var = switch_channel_get_variable(session->channel, "core_video_blank_image"))) {
blank_img = switch_img_read_png(var, SWITCH_IMG_FMT_I420); blank_img = switch_img_read_png(var, SWITCH_IMG_FMT_I420);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论