float fps = 15.0f;
switch_image_t *last_frame = NULL;
int last_w = 0, last_h = 0, kps = 0;
+ switch_status_t res;
if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
return NULL;
if (!(smh = session->media_handle)) {
switch_core_session_rwunlock(session);
+
return NULL;
}
- switch_core_session_get_partner(session, &b_session);
+ res = switch_core_session_get_partner(session, &b_session);
+ (void)res;
switch_channel_set_flag(session->channel, CF_VIDEO_WRITING);
fr.buflen = buflen - 12;
switch_core_media_gen_key_frame(session);
-
if (smh->video_write_fh) {
if (smh->video_write_fh->mm.fps) {
fps = smh->video_write_fh->mm.fps;
switch_channel_up_nosig(session->channel) && smh->video_write_fh && switch_test_flag(smh->video_write_fh, SWITCH_FILE_OPEN)) {
switch_status_t wstatus = SWITCH_STATUS_FALSE;
-
-
switch_core_timer_next(&timer);
switch_mutex_lock(v_engine->mh.file_write_mutex);
switch_set_flag_locked(smh->video_write_fh, SWITCH_FILE_FLAG_VIDEO_EOF);
}
}
+
switch_mutex_unlock(v_engine->mh.file_write_mutex);
}
if (last_frame) {
int x = 0;
switch_rgb_color_t bgcolor;
+
switch_color_set_rgb(&bgcolor, "#000000");
switch_img_fill(last_frame, 0, 0, last_frame->d_w, last_frame->d_h, &bgcolor);
fr.img = last_frame;
fr.flags = SFF_USE_VIDEO_TIMESTAMP|SFF_RAW_RTP|SFF_RAW_RTP_PARSE_FRAME;
switch_core_session_write_video_frame(session, &fr, SWITCH_IO_FLAG_FORCE, 0);
}
+
switch_core_media_gen_key_frame(session);
switch_core_session_request_video_refresh(session);
switch_img_free(&last_frame);
}
-
switch_core_timer_destroy(&timer);
switch_core_session_rwunlock(session);
switch_core_session_rwunlock(b_session);
}
-
v_engine->thread_write_lock = 0;
switch_mutex_unlock(smh->write_mutex[SWITCH_MEDIA_TYPE_VIDEO]);