FS-7500: fix some regressions regarding passthru video

This commit is contained in:
Anthony Minessale 2015-03-27 14:02:07 -05:00 committed by Michael Jerris
parent 0fc2c54b11
commit 84ca513353
3 changed files with 13 additions and 10 deletions

View File

@ -1966,8 +1966,11 @@ SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch
ACTIVE = 1;
}
if (flag == CF_VIDEO_PASSIVE && channel->flags[flag]) {
CLEAR = 1;
if (flag == CF_VIDEO_PASSIVE) {
channel->flags[CF_VIDEO_READY] = 1;
if (channel->flags[flag]) {
CLEAR = 1;
}
}
channel->flags[flag] = 0;

View File

@ -4698,6 +4698,10 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
xloops = 0;
}
if (!switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ) && (xloops > 20 || switch_channel_test_flag(channel, CF_VIDEO_PASSIVE))) {
switch_channel_set_flag(channel, CF_VIDEO_READY);
}
if (switch_channel_test_flag(channel, CF_VIDEO_PASSIVE) || do_sleep) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Video thread paused. Echo is %s\n",
switch_channel_get_name(session->channel), switch_channel_test_flag(channel, CF_VIDEO_ECHO) ? "on" : "off");
@ -4742,24 +4746,22 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
if (!smh->video_write_fh || !switch_channel_test_flag(channel, CF_VIDEO_READY)) {
status = switch_core_session_read_video_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
if (!SWITCH_READ_ACCEPTABLE(status)) {
switch_cond_next();
continue;
}
if (switch_test_flag(read_frame, SFF_CNG)) {
continue;
}
if (read_frame->img) {
if (++viloops > 10) {
switch_channel_set_flag(channel, CF_VIDEO_READY);
smh->vid_params.width = read_frame->img->d_w;
smh->vid_params.height = read_frame->img->d_h;
}
} else if (read_frame->datalen > 2 && !switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ) && vloops > 20) {
switch_channel_set_flag(channel, CF_VIDEO_READY);
}
}
@ -4770,7 +4772,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
vloops++;
if (!buf) {
if (!buf && switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ)) {
int buflen = SWITCH_RECOMMENDED_BUFFER_SIZE * 4;
buf = switch_core_session_alloc(session, buflen);
fr.packet = buf;

View File

@ -63,7 +63,6 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
switch_core_session_request_video_refresh(vh->session_b);
while (switch_channel_up_nosig(channel) && switch_channel_up_nosig(b_channel) && vh->up == 1) {
if (switch_channel_media_up(channel)) {
switch_codec_t *a_codec = switch_core_session_get_video_read_codec(vh->session_a);
switch_codec_t *b_codec = switch_core_session_get_video_write_codec(vh->session_b);
@ -92,7 +91,6 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
continue;
}
}
}
switch_core_session_kill_channel(vh->session_b, SWITCH_SIG_BREAK);