提交 ea16f82d authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Michael Jerris

FS-7500: move img test down into read function

上级 ff8bf014
......@@ -211,6 +211,8 @@ struct switch_media_handle_s {
uint64_t vid_frames;
time_t vid_started;
int ready_loops;
};
......@@ -4779,7 +4781,6 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
switch_image_t *blank_img = NULL;
switch_rgb_color_t bgcolor;
switch_rtp_engine_t *v_engine = NULL;
int ready_loops = 0;
const char *var;
if (!(smh = session->media_handle)) {
......@@ -4883,12 +4884,6 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
if (switch_test_flag(read_frame, SFF_CNG)) {
continue;
}
if (read_frame->img && read_frame->img->d_w && read_frame->img->d_h && ++ready_loops > 5) {
switch_channel_set_flag(channel, CF_VIDEO_READY);
smh->vid_params.width = read_frame->img->d_w;
smh->vid_params.height = read_frame->img->d_h;
}
}
if (vloops < 300 && (vloops % 100) == 0) {
......@@ -10377,9 +10372,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
switch_status_t status = SWITCH_STATUS_FALSE;
switch_io_event_hook_video_read_frame_t *ptr;
uint32_t loops = 0;
switch_media_handle_t *smh;
switch_assert(session != NULL);
if (!(smh = session->media_handle)) {
return SWITCH_STATUS_FALSE;
}
top:
loops++;
......@@ -10452,6 +10453,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
(*frame)->img->w, (*frame)->img->h, (*frame)->img->d_w, (*frame)->img->d_h);
}
if ((*frame)->img && (*frame)->img->d_w && (*frame)->img->d_h && ++smh->ready_loops > 5) {
switch_channel_set_flag(session->channel, CF_VIDEO_READY);
smh->vid_params.width = (*frame)->img->d_w;
smh->vid_params.height = (*frame)->img->d_h;
}
if (switch_test_flag((*frame), SFF_WAIT_KEY_FRAME)) {
switch_core_session_request_video_refresh(session);
switch_clear_flag((*frame), SFF_WAIT_KEY_FRAME);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论