mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-15 15:54:13 +00:00
FS-7499 FS-7500: combat black screen disease
This commit is contained in:
1 parent
23e0062bc7
commit
a8a2c32ac3
8 files changed
+66
-27
No files matched your search
@@ -3935,6 +3935,7 @@ SWITCH_STANDARD_API(uuid_video_refresh_function)
|
||||
|
||||
if ((lsession = switch_core_session_locate(argv[0]))) {
|
||||
switch_core_session_video_reinit(lsession);
|
||||
switch_channel_video_sync(switch_core_session_get_channel(lsession));
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
switch_core_session_rwunlock(lsession);
|
||||
}
|
||||
|
||||
@@ -1806,6 +1806,8 @@ static int flush_video_queue(switch_queue_t *q)
|
||||
void *pop;
|
||||
int r = 0;
|
||||
|
||||
if (!q) return 0;
|
||||
|
||||
while (switch_queue_trypop(q, &pop) == SWITCH_STATUS_SUCCESS && pop) {
|
||||
img = (switch_image_t *)pop;
|
||||
switch_img_free(&img);
|
||||
@@ -2000,8 +2002,13 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
}
|
||||
size = switch_queue_size(imember->video_queue);
|
||||
} while(size > 0);
|
||||
if (!img) {
|
||||
if (!img && switch_test_flag(imember, MFLAG_CAN_BE_SEEN)) {
|
||||
imember->blanks++;
|
||||
|
||||
if (imember->blanks == conference->video_fps.fps || (imember->blanks % (int)(conference->video_fps.fps * 10)) == 0) {
|
||||
switch_core_session_request_video_refresh(imember->session);
|
||||
}
|
||||
|
||||
if (imember->blanks == conference->video_fps.fps * 2) {
|
||||
check_avatar(imember, SWITCH_TRUE);
|
||||
if (layer && imember->avatar_png_img) {
|
||||
@@ -2015,6 +2022,8 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
if (flushed && imember->blanks) {
|
||||
switch_img_free(&imember->avatar_png_img);
|
||||
imember->blanks = 0;
|
||||
switch_core_session_request_video_refresh(imember->session);
|
||||
switch_channel_video_sync(imember->channel);
|
||||
}
|
||||
|
||||
img = imember->avatar_png_img;
|
||||
@@ -4775,7 +4784,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
|
||||
if (switch_test_flag(member->conference, CFLAG_VIDEO_MUXING)) {
|
||||
switch_image_t *img_copy = NULL;
|
||||
|
||||
if (frame->img && !member->conference->playing_video_file) {
|
||||
if (frame->img && !member->conference->playing_video_file && switch_queue_size(member->video_queue) < 3) {
|
||||
switch_img_copy(frame->img, &img_copy);
|
||||
switch_queue_push(member->video_queue, img_copy);
|
||||
}
|
||||
@@ -8302,6 +8311,8 @@ static switch_status_t conf_api_sub_vmute(conference_member_t *member, switch_st
|
||||
|
||||
if (member->channel) {
|
||||
switch_channel_set_flag(member->channel, CF_VIDEO_PAUSE_READ);
|
||||
switch_core_session_request_video_refresh(member->session);
|
||||
switch_channel_video_sync(member->channel);
|
||||
}
|
||||
|
||||
if (!(data) || !strstr((char *) data, "quiet")) {
|
||||
@@ -8358,6 +8369,8 @@ static switch_status_t conf_api_sub_unvmute(conference_member_t *member, switch_
|
||||
|
||||
if (member->channel) {
|
||||
switch_channel_clear_flag(member->channel, CF_VIDEO_PAUSE_READ);
|
||||
switch_core_session_request_video_refresh(member->session);
|
||||
switch_channel_video_sync(member->channel);
|
||||
}
|
||||
|
||||
if (!(data) || !strstr((char *) data, "quiet")) {
|
||||
|
||||
@@ -772,7 +772,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
|
||||
if (context->is_vp9) {
|
||||
is_keyframe = IS_VP9_KEY_FRAME(*(unsigned char *)frame->data);
|
||||
} else { // vp8
|
||||
is_keyframe = IS_VP8_KEY_FRAME((uint8_t *)frame->data);
|
||||
is_keyframe = (*(unsigned char *)frame->data & 0x10) || IS_VP8_KEY_FRAME((uint8_t *)frame->data);
|
||||
}
|
||||
|
||||
// if (is_keyframe) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "got key %d\n", is_keyframe);
|
||||
@@ -843,7 +843,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
|
||||
err = vpx_codec_decode(decoder, data, (unsigned int)len, NULL, 0);
|
||||
|
||||
if (err != VPX_CODEC_OK) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error decoding %" SWITCH_SIZE_T_FMT " bytes, [%d:%s:%s]\n",
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Error decoding %" SWITCH_SIZE_T_FMT " bytes, [%d:%s:%s]\n",
|
||||
len, err, vpx_codec_error(decoder), vpx_codec_error_detail(decoder));
|
||||
switch_goto_status(SWITCH_STATUS_RESTART, end);
|
||||
}
|
||||
@@ -869,9 +869,9 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
|
||||
|
||||
end:
|
||||
|
||||
if (status == SWITCH_STATUS_RESTART) {
|
||||
context->need_decoder_reset = 1;
|
||||
}
|
||||
//if (status == SWITCH_STATUS_RESTART) {
|
||||
// context->need_decoder_reset = 1;
|
||||
//}
|
||||
|
||||
if (!frame->img || status == SWITCH_STATUS_RESTART) {
|
||||
status = SWITCH_STATUS_MORE_DATA;
|
||||
|
||||
Reference in new issue
Block a user