mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-22 09:37:04 +00:00
video tweaks for echo app
This commit is contained in:
parent
2249e1dfc6
commit
4e085205d2
@ -580,11 +580,24 @@ static void *SWITCH_THREAD_FUNC echo_video_thread(switch_thread_t *thread, void
|
|||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
switch_frame_t *read_frame;
|
switch_frame_t *read_frame;
|
||||||
|
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);
|
||||||
|
|
||||||
eh->up = 1;
|
eh->up = 1;
|
||||||
while (switch_channel_ready(channel)) {
|
while (switch_channel_ready(channel)) {
|
||||||
status = switch_core_session_read_video_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
status = switch_core_session_read_video_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||||
|
|
||||||
|
|
||||||
|
if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
|
||||||
|
switch_core_session_receive_message(session, &msg);
|
||||||
|
switch_channel_clear_flag(channel, CF_VIDEO_REFRESH_REQ);
|
||||||
|
}
|
||||||
|
|
||||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -606,6 +619,8 @@ SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session, swi
|
|||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
switch_frame_t *read_frame;
|
switch_frame_t *read_frame;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
int orig_vid = switch_channel_test_flag(channel, CF_VIDEO);
|
||||||
|
|
||||||
#ifdef SWITCH_VIDEO_IN_THREADS
|
#ifdef SWITCH_VIDEO_IN_THREADS
|
||||||
struct echo_helper eh = { 0 };
|
struct echo_helper eh = { 0 };
|
||||||
switch_thread_t *thread;
|
switch_thread_t *thread;
|
||||||
@ -615,6 +630,9 @@ SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session, swi
|
|||||||
if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
|
if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
restart:
|
||||||
|
|
||||||
#ifdef SWITCH_VIDEO_IN_THREADS
|
#ifdef SWITCH_VIDEO_IN_THREADS
|
||||||
if (switch_channel_test_flag(channel, CF_VIDEO)) {
|
if (switch_channel_test_flag(channel, CF_VIDEO)) {
|
||||||
eh.session = session;
|
eh.session = session;
|
||||||
@ -630,6 +648,12 @@ SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session, swi
|
|||||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!orig_vid && switch_channel_test_flag(channel, CF_VIDEO)) {
|
||||||
|
orig_vid = 1;
|
||||||
|
goto restart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_ivr_parse_all_events(session);
|
switch_ivr_parse_all_events(session);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user