From c874fe05d84d54ebc81708bf112941bf88c6c4c7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 20 Nov 2014 16:40:49 -0600 Subject: [PATCH] FS-7500: SQUASH ME WITH THE LAST ONE --- src/mod/applications/mod_fsv/mod_fsv.c | 1 + src/mod/codecs/mod_vpx/mod_vpx.c | 2 -- src/switch_core_media.c | 5 +++++ src/switch_core_session.c | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_fsv/mod_fsv.c b/src/mod/applications/mod_fsv/mod_fsv.c index 21e1fc4d84..883458b8c0 100644 --- a/src/mod/applications/mod_fsv/mod_fsv.c +++ b/src/mod/applications/mod_fsv/mod_fsv.c @@ -724,6 +724,7 @@ static void decode_video_thread(switch_core_session_t *session, void *obj) switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_channel_set_flag(channel, CF_VIDEO_DEBUG_READ); + switch_channel_set_flag(channel, CF_VIDEO_DEBUG_WRITE); while (switch_channel_ready(channel)) { switch_status_t status = switch_core_session_read_video_frame(session, &frame, SWITCH_IO_FLAG_NONE, 0); diff --git a/src/mod/codecs/mod_vpx/mod_vpx.c b/src/mod/codecs/mod_vpx/mod_vpx.c index 77ce0fcb39..8c7bbecc7e 100644 --- a/src/mod/codecs/mod_vpx/mod_vpx.c +++ b/src/mod/codecs/mod_vpx/mod_vpx.c @@ -567,8 +567,6 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t * switch_goto_status(SWITCH_STATUS_NOTFOUND, end); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "IMAGE %dx%d %dx%d\n", frame->img->w,frame->img->h, frame->img->d_w, frame->img->d_h); - switch_buffer_zero(context->vpx_packet_buffer); } diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 88896f712c..17320bae22 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -9750,6 +9750,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core if (switch_channel_test_flag(session->channel, CF_VIDEO_DECODED_READ)) { switch_status_t decode_status = switch_core_codec_decode_video((*frame)->codec, *frame); + if ((*frame)->img && switch_channel_test_flag(session->channel, CF_VIDEO_DEBUG_READ)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IMAGE %dx%d %dx%d\n", + (*frame)->img->w, (*frame)->img->h, (*frame)->img->d_w, (*frame)->img->d_h); + } + if (switch_test_flag((*frame), SFF_WAIT_KEY_FRAME)) { switch_core_session_refresh_video(session); switch_clear_flag((*frame), SFF_WAIT_KEY_FRAME); diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 96b7bc0e9b..e7a4fe369d 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -2681,6 +2681,7 @@ SWITCH_DECLARE(void) switch_core_session_video_reset(switch_core_session_t *sess switch_channel_clear_flag(session->channel, CF_VIDEO_PASSIVE); switch_channel_clear_flag(session->channel, CF_VIDEO_DECODED_READ); switch_channel_clear_flag(session->channel, CF_VIDEO_DEBUG_READ); + switch_channel_clear_flag(session->channel, CF_VIDEO_DEBUG_WRITE); switch_core_session_refresh_video(session); session->image_write_callback = NULL; session->image_write_callback_user_data = NULL;