mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
FS-7500: add ability to insert a custom callback to the core video thread
the callback will be called on each loop on read video frame, or the callback function call run it's own loop to take over the core loop so it can read video from session by itself. the callback function can - return SWITCH_STATUS_SUCCESS to wait another loop return SWITCH_STATUS_CONTINUE to continue use the default behaviour return anything else will break the core video loop and end the core thread
This commit is contained in:
@@ -4518,6 +4518,14 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
|
||||
continue;
|
||||
}
|
||||
|
||||
status = switch_core_session_video_thread_callback(session, read_frame);
|
||||
|
||||
if (status != SWITCH_STATUS_CONTINUE) {
|
||||
if (status == SWITCH_STATUS_SUCCESS) continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_VIDEO_ECHO)) {
|
||||
switch_core_session_write_video_frame(session, read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user