提交 1aa66ef3 authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Michael Jerris

FS-7513: do layers in order and reset when attaching

上级 fcf32fd5
...@@ -976,7 +976,7 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit ...@@ -976,7 +976,7 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit
#define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK || status == SWITCH_STATUS_INUSE) #define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK || status == SWITCH_STATUS_INUSE)
static inline uint32_t switch_parse_bandwidth_string(const char *bwv) static inline int32_t switch_parse_bandwidth_string(const char *bwv)
{ {
int32_t bw = 0; int32_t bw = 0;
......
...@@ -355,6 +355,7 @@ typedef struct mcu_layer_s { ...@@ -355,6 +355,7 @@ typedef struct mcu_layer_s {
mcu_layer_geometry_t geometry; mcu_layer_geometry_t geometry;
int member_id; int member_id;
int idx; int idx;
int tagged;
switch_image_t *img; switch_image_t *img;
switch_image_t *cur_img; switch_image_t *cur_img;
} mcu_layer_t; } mcu_layer_t;
...@@ -931,9 +932,12 @@ static void set_bgcolor(bgcolor_yuv_t *bgcolor, char *bgcolor_str) ...@@ -931,9 +932,12 @@ static void set_bgcolor(bgcolor_yuv_t *bgcolor, char *bgcolor_str)
static void reset_layer(mcu_canvas_t *canvas, mcu_layer_t *layer) static void reset_layer(mcu_canvas_t *canvas, mcu_layer_t *layer)
{ {
int x = 0, y = 0; int x = 0, y = 0;
int screen_w = 0, screen_h = 0; int screen_w = 0, screen_h = 0;
layer->tagged = 0;
screen_w = canvas->img->d_w * layer->geometry.scale / SCALE_FACTOR; screen_w = canvas->img->d_w * layer->geometry.scale / SCALE_FACTOR;
screen_h = canvas->img->d_h * layer->geometry.scale / SCALE_FACTOR; screen_h = canvas->img->d_h * layer->geometry.scale / SCALE_FACTOR;
...@@ -1085,6 +1089,7 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx) ...@@ -1085,6 +1089,7 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
switch_mutex_lock(member->conference->canvas->mutex); switch_mutex_lock(member->conference->canvas->mutex);
layer = &member->conference->canvas->layers[idx]; layer = &member->conference->canvas->layers[idx];
layer->tagged = 0;
if (layer->member_id && layer->member_id == member->id) { if (layer->member_id && layer->member_id == member->id) {
member->video_layer_id = idx; member->video_layer_id = idx;
...@@ -1095,6 +1100,8 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx) ...@@ -1095,6 +1100,8 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
detach_video_layer(member); detach_video_layer(member);
} }
reset_layer(member->conference->canvas, layer);
channel = switch_core_session_get_channel(member->session); channel = switch_core_session_get_channel(member->session);
res_id = switch_channel_get_variable_dup(channel, "video_reservation_id", SWITCH_FALSE, -1); res_id = switch_channel_get_variable_dup(channel, "video_reservation_id", SWITCH_FALSE, -1);
...@@ -1150,6 +1157,7 @@ static void init_canvas_layers(conference_obj_t *conference, video_layout_t *vla ...@@ -1150,6 +1157,7 @@ static void init_canvas_layers(conference_obj_t *conference, video_layout_t *vla
for (i = 0; i < MCU_MAX_LAYERS; i++) { for (i = 0; i < MCU_MAX_LAYERS; i++) {
mcu_layer_t *layer = &conference->canvas->layers[i]; mcu_layer_t *layer = &conference->canvas->layers[i];
layer->member_id = 0; layer->member_id = 0;
layer->tagged = 0;
} }
conference->canvas->layers_used = 0; conference->canvas->layers_used = 0;
...@@ -1444,7 +1452,7 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread ...@@ -1444,7 +1452,7 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
if (layer) { if (layer) {
switch_img_free(&layer->cur_img); switch_img_free(&layer->cur_img);
layer->cur_img = img; layer->cur_img = img;
scale_and_patch(conference, layer); layer->tagged = 1;
} }
} }
...@@ -1457,6 +1465,17 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread ...@@ -1457,6 +1465,17 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
if (remaining) goto top; if (remaining) goto top;
for (i = 0; i < conference->canvas->total_layers; i++) {
mcu_layer_t *layer = &conference->canvas->layers[i];
if (layer->member_id > -1 && layer->cur_img && layer->tagged) {
scale_and_patch(conference, layer);
layer->tagged = 0;
}
}
if (used) { if (used) {
switch_time_t now = switch_micro_time_now(); switch_time_t now = switch_micro_time_now();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论