FS-7513: move code to core

This commit is contained in:
Anthony Minessale 2015-03-04 11:22:37 -06:00 committed by Michael Jerris
parent 7fe734e1f9
commit 5755b7849e
2 changed files with 9 additions and 9 deletions

View File

@ -1595,7 +1595,6 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_
{ {
conference_member_t *member = (conference_member_t *) obj; conference_member_t *member = (conference_member_t *) obj;
void *pop; void *pop;
int loops = 0;
while(switch_test_flag(member, MFLAG_RUNNING) || switch_queue_size(member->mux_out_queue)) { while(switch_test_flag(member, MFLAG_RUNNING) || switch_queue_size(member->mux_out_queue)) {
switch_frame_t *frame; switch_frame_t *frame;
@ -1604,12 +1603,6 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_
if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) { if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) {
if (!pop) continue; if (!pop) continue;
if (loops == 0 || loops == 50) {
switch_core_media_gen_key_frame(member->session);
switch_core_session_request_video_refresh(member->session);
}
loops++;
frame = (switch_frame_t *) pop; frame = (switch_frame_t *) pop;
if (switch_test_flag(frame, SFF_ENCODED)) { if (switch_test_flag(frame, SFF_ENCODED)) {
switch_core_session_write_encoded_video_frame(member->session, frame, 0, 0); switch_core_session_write_encoded_video_frame(member->session, frame, 0, 0);

View File

@ -4726,16 +4726,23 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
} }
if (read_frame->img) { if (read_frame->img) {
if (++vloops > 5) { if (vloops > 5) {
switch_channel_set_flag(channel, CF_VIDEO_READY); switch_channel_set_flag(channel, CF_VIDEO_READY);
smh->vid_params.width = read_frame->img->d_w; smh->vid_params.width = read_frame->img->d_w;
smh->vid_params.height = read_frame->img->d_h; smh->vid_params.height = read_frame->img->d_h;
} }
} else if (read_frame->datalen > 2 && !switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ) && ++vloops > 20) { } else if (read_frame->datalen > 2 && !switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ) && vloops > 20) {
switch_channel_set_flag(channel, CF_VIDEO_READY); switch_channel_set_flag(channel, CF_VIDEO_READY);
} }
} }
if (vloops < 300 && (vloops % 100) == 0) {
switch_core_media_gen_key_frame(session);
switch_core_session_request_video_refresh(session);
}
vloops++;
if (!buf) { if (!buf) {
int buflen = SWITCH_RECOMMENDED_BUFFER_SIZE * 4; int buflen = SWITCH_RECOMMENDED_BUFFER_SIZE * 4;
buf = switch_core_session_alloc(session, buflen); buf = switch_core_session_alloc(session, buflen);