mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 08:05:37 +00:00
FS-7500: allow using the video thread externally - e.g. non rtp based video
This commit is contained in:
parent
e80b40f9f1
commit
90818f137e
@ -146,6 +146,7 @@ typedef struct switch_core_media_params_s {
|
||||
switch_core_media_dtmf_t dtmf_type;
|
||||
switch_payload_t cng_pt;
|
||||
|
||||
|
||||
/* a core_video_thread will be started automatically
|
||||
when uses rtp based media,
|
||||
external_video_source should be set to SWITCH_TRUE and
|
||||
@ -153,6 +154,7 @@ typedef struct switch_core_media_params_s {
|
||||
should be explicitly called to start the video thread
|
||||
if uses the media handle for non-rtp based media
|
||||
*/
|
||||
|
||||
switch_bool_t external_video_source;
|
||||
|
||||
} switch_core_media_params_t;
|
||||
@ -261,7 +263,11 @@ SWITCH_DECLARE(void) switch_core_media_deinit(void);
|
||||
SWITCH_DECLARE(void) switch_core_media_set_stats(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(void) switch_core_session_wake_video_thread(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(void) switch_core_session_clear_crypto(switch_core_session_t *session);
|
||||
<<<<<<< HEAD
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_start_video_thread(switch_core_session_t *session);
|
||||
=======
|
||||
SWITCH_DECLARE(switch_status_t) start_core_video_thread(switch_core_session_t *session);
|
||||
>>>>>>> allow using the video thread externally - e.g. non rtp based video
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core_session_t *session,
|
||||
switch_media_type_t type,
|
||||
|
@ -4541,7 +4541,7 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
|
||||
}
|
||||
|
||||
|
||||
static switch_status_t start_video_thread(switch_core_session_t *session)
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_start_video_thread(switch_core_session_t *session)
|
||||
{
|
||||
switch_threadattr_t *thd_attr = NULL;
|
||||
switch_memory_pool_t *pool = switch_core_session_get_pool(session);
|
||||
@ -4576,11 +4576,6 @@ static switch_status_t start_video_thread(switch_core_session_t *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_start_video_thread(switch_core_session_t *session)
|
||||
{
|
||||
return start_video_thread(session);
|
||||
}
|
||||
|
||||
//?
|
||||
#define RA_PTR_LEN 512
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_session_t *session, const char *sdp_str)
|
||||
@ -4712,7 +4707,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_
|
||||
!switch_channel_test_flag(session->channel, CF_WEBRTC)) {
|
||||
/* Reactivate the NAT buster flag. */
|
||||
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
|
||||
start_video_thread(session);
|
||||
switch_core_media_start_video_thread(session);
|
||||
|
||||
}
|
||||
if (switch_media_handle_test_media_flag(smh, SCMF_AUTOFIX_TIMING)) {
|
||||
@ -5686,7 +5681,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||
v_engine->cur_payload_map->remote_sdp_port, v_engine->cur_payload_map->agreed_pt);
|
||||
|
||||
|
||||
start_video_thread(session);
|
||||
switch_core_media_start_video_thread(session);
|
||||
switch_rtp_set_default_payload(v_engine->rtp_session, v_engine->cur_payload_map->agreed_pt);
|
||||
}
|
||||
}
|
||||
@ -5719,7 +5714,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||
!((val = switch_channel_get_variable(session->channel, "disable_rtp_auto_adjust")) && switch_true(val))) {
|
||||
/* Reactivate the NAT buster flag. */
|
||||
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
|
||||
start_video_thread(session);
|
||||
switch_core_media_start_video_thread(session);
|
||||
}
|
||||
|
||||
}
|
||||
@ -5819,7 +5814,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||
|
||||
switch_rtp_set_payload_map(v_engine->rtp_session, &v_engine->payload_map);
|
||||
|
||||
start_video_thread(session);
|
||||
switch_core_media_start_video_thread(session);
|
||||
switch_channel_set_flag(session->channel, CF_VIDEO);
|
||||
|
||||
if ((ssrc = switch_channel_get_variable(session->channel, "rtp_use_video_ssrc"))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user