codec = &engine->write_codec;
}
- if (cmd == SCC_VIDEO_REFRESH && mtype == SWITCH_MEDIA_TYPE_VIDEO) {
- switch_core_session_refresh_video(session);
+ if (mtype == SWITCH_MEDIA_TYPE_VIDEO) {
+ if (!switch_channel_test_flag(session->channel, CF_VIDEO)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (cmd == SCC_VIDEO_REFRESH) {
+ switch_core_session_message_t msg = { 0 };
+ msg.from = __FILE__;
+ msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
+ switch_core_session_receive_message(session, &msg);
+ }
}
if (codec) {
switch_media_handle_t *smh;
switch_image_t *img = frame->img;
switch_status_t encode_status;
+ switch_frame_t write_frame = {0};
switch_assert(session);
return SWITCH_STATUS_FALSE;
}
+ if (!codec) {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s has no video codec\n", switch_core_session_get_name(session));
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_channel_test_flag(session->channel, CF_VIDEO_PAUSE)) {
return SWITCH_STATUS_SUCCESS;
}
return raw_write_video(session, frame, flags, stream_id);
}
+ write_frame = *frame;
+ frame = &write_frame;
+
if (!switch_test_flag(frame, SFF_USE_VIDEO_TIMESTAMP)) {
if (!(timer = switch_core_media_get_timer(session, SWITCH_MEDIA_TYPE_VIDEO))) {