end:
+ switch_core_session_request_video_refresh(session);
+
if (b_session) {
+ switch_core_session_request_video_refresh(b_session);
switch_core_session_rwunlock(b_session);
}
frame_ms = (uint32_t) 1000 / fps;
frames = (uint32_t) ms / frame_ms;
+
+
switch_core_media_gen_key_frame(session);
for (i = 0; i < frames; i++) {
+ fr.img = blank_img;
switch_core_session_write_video_frame(session, &fr, SWITCH_IO_FLAG_NONE, 0);
switch_yield(frame_ms * 1000);
}
}
switch_core_media_gen_key_frame(session);
+ switch_core_session_request_video_refresh(session);
if (fh) {
switch_threadattr_t *thd_attr = NULL;
- switch_core_session_write_blank_video(session, 200);
+ switch_core_session_write_blank_video(session, 500);
switch_threadattr_create(&thd_attr, switch_core_session_get_pool(session));
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
smh->video_write_thread_running = 1;
switch_thread_join(&st, smh->video_write_thread);
switch_mutex_lock(v_engine->mh.file_write_mutex);
smh->video_write_thread = NULL;
- switch_core_session_write_blank_video(session, 200);
+ switch_core_session_write_blank_video(session, 500);
}
smh->video_write_fh = fh;
}
if (codec) {
- if (cmd == SCC_VIDEO_GEN_KEYFRAME) {
- switch_time_t now = switch_micro_time_now();
-
- if (smh->last_codec_refresh && (now - smh->last_codec_refresh) < VIDEO_REFRESH_FREQ) {
- return SWITCH_STATUS_BREAK;
- }
-
- smh->last_codec_refresh = now;
- switch_channel_set_flag(session->channel, CF_VIDEO_REFRESH_REQ);
- }
-
return switch_core_codec_control(codec, cmd, ctype, cmd_data, atype, cmd_arg, rtype, ret_data);
}
if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
+ switch_channel_clear_flag(channel, CF_VIDEO_REFRESH_REQ);
refresh_timer = refresh_cnt;
}
if (refresh_timer) {
if (refresh_timer > 0 && (refresh_timer % 100) == 0) {
- switch_core_session_request_video_refresh(vh->session_a);
switch_core_session_request_video_refresh(vh->session_b);
- switch_core_media_gen_key_frame(vh->session_a);
- switch_core_media_gen_key_frame(vh->session_b);
}
refresh_timer--;
}
switch_cond_next();
continue;
}
-
-
- if (switch_test_flag(read_frame, SFF_CNG)) {
- switch_core_session_request_video_refresh(vh->session_a);
- continue;
- }
}
- if (switch_channel_test_flag(channel, CF_LEG_HOLDING) || switch_channel_test_flag(b_channel, CF_VIDEO_READ_FILE_ATTACHED)) {
- switch_channel_video_sync(channel);
- switch_core_session_write_video_frame(session, read_frame, SWITCH_IO_FLAG_NONE, 0);
+ if (switch_test_flag(read_frame, SFF_CNG) ||
+ switch_channel_test_flag(channel, CF_LEG_HOLDING) || switch_channel_test_flag(b_channel, CF_VIDEO_READ_FILE_ATTACHED)) {
continue;
}
-
if (switch_channel_media_up(b_channel)) {
if (switch_core_session_write_video_frame(vh->session_b, read_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && (msg->header.type == _RTCP_PT_RTPFB || msg->header.type == _RTCP_PT_PSFB)) {
rtcp_ext_msg_t *extp = (rtcp_ext_msg_t *) msg;
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1, "PICKED UP %s XRTCP type: %d fmt: %d\n",
- rtp_type(rtp_session), msg->header.type, extp->header.fmt);
+ if (extp->header.fmt != 15) { // <---- REMOVE WHEN BRIA STOPS SENDING UNSOLICITED REMB
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1, "PICKED UP %s XRTCP type: %d fmt: %d\n",
+ rtp_type(rtp_session), msg->header.type, extp->header.fmt);
+ }
if (msg->header.type == _RTCP_PT_PSFB && (extp->header.fmt == _RTCP_PSFB_FIR || extp->header.fmt == _RTCP_PSFB_PLI)) {
switch_core_media_gen_key_frame(rtp_session->session);
if (rtp_session->vbw) {
switch_jb_reset(rtp_session->vbw);
}
+
+ switch_channel_set_flag(switch_core_session_get_channel(rtp_session->session), CF_VIDEO_REFRESH_REQ);
}
if (msg->header.type == _RTCP_PT_RTPFB && extp->header.fmt == _RTCP_RTPFB_NACK) {