From d33e5659f6d9debdc363be28ecb8cda439e72e83 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 27 Aug 2014 07:11:08 +0800 Subject: [PATCH] FS-7514: refresh req on vlc channel --- src/mod/formats/mod_vlc/mod_vlc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mod/formats/mod_vlc/mod_vlc.c b/src/mod/formats/mod_vlc/mod_vlc.c index 8c0d14e255..12bdb2d888 100644 --- a/src/mod/formats/mod_vlc/mod_vlc.c +++ b/src/mod/formats/mod_vlc/mod_vlc.c @@ -114,6 +114,7 @@ struct vlc_video_context { int height; int force_width; int force_height; + int video_refresh_req; }; typedef struct vlc_video_context vlc_video_context_t; @@ -345,6 +346,11 @@ static void vlc_video_channel_unlock_callback(void *data, void *id, void *const context->last_video_ts = now; } + if (context->video_refresh_req > 0) { + flag |= SFF_WAIT_KEY_FRAME; + context->video_refresh_req--; + } + switch_core_codec_encode_video(codec, context->img, frame->data, &encoded_data_len, &flag); while(encoded_data_len) { @@ -1465,6 +1471,9 @@ static switch_status_t vlc_receive_message(switch_core_session_t *session, switc break; case SWITCH_MESSAGE_INDICATE_JITTER_BUFFER: break; + case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ: + tech_pvt->context->video_refresh_req = 1; + break; default: break; }