SWITCH_DECLARE(int) switch_core_cert_expand_fingerprint(dtls_fingerprint_t *fp, const char *str);
SWITCH_DECLARE(int) switch_core_cert_verify(dtls_fingerprint_t *fp);
SWITCH_DECLARE(switch_status_t) switch_core_session_refresh_video(switch_core_session_t *session);
-
+SWITCH_DECLARE(switch_status_t) switch_core_session_refresh_video_both_ways(switch_core_session_t *session);
SWITCH_DECLARE(int) switch_system(const char *cmd, switch_bool_t wait);
SWITCH_DECLARE(int) switch_stream_system_fork(const char *cmd, switch_stream_handle_t *stream);
SWITCH_DECLARE(int) switch_stream_system(const char *cmd, switch_stream_handle_t *stream);
switch_channel_clear_flag(channel, CF_VIDEO_PASSIVE);
}
/* Tell the channel to request a fresh vid frame */
- switch_core_session_refresh_video(member->session);
+ switch_core_session_refresh_video_both_ways(member->session);
if (conference->video_floor_holder) {
switch_mutex_lock(conference->mutex);
if (conference->video_floor_holder) {
- switch_core_session_refresh_video(conference->video_floor_holder->session);
+ switch_core_session_refresh_video_both_ways(conference->video_floor_holder->session);
// there's already someone hold the floor, tell the core thread start to read video
switch_channel_clear_flag(member->channel, CF_VIDEO_PASSIVE);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding video floor %s\n",
switch_channel_get_name(member->channel));
//switch_channel_set_flag(member->channel, CF_VIDEO_PASSIVE);
- switch_core_session_refresh_video(member->session);
+ switch_core_session_refresh_video_both_ways(member->session);
conference->video_floor_holder = member;
member_update_status_field(member);
} else {
switch_channel_set_flag(imember->channel, CF_VIDEO_BREAK);
switch_core_session_kill_channel(imember->session, SWITCH_SIG_BREAK);
- switch_core_session_refresh_video(imember->session);
+ switch_core_session_refresh_video_both_ways(imember->session);
}
switch_set_flag(conference, CFLAG_FLOOR_CHANGE);
switch_channel_ready(channel_a) && switch_channel_ready(channel_b)) {
if (switch_channel_test_flag(channel_a, CF_VIDEO_REFRESH_REQ)) {
- switch_core_session_refresh_video(session_b);
+ switch_core_session_refresh_video_both_ways(session_b);
switch_channel_clear_flag(channel_a, CF_VIDEO_REFRESH_REQ);
}
switch_mutex_unlock(conference->mutex);
if (want_refresh && session) {
- switch_core_session_refresh_video(session);
+ switch_core_session_refresh_video_both_ways(session);
want_refresh = 0;
}
if (switch_channel_test_flag(channel, CF_VIDEO) && !switch_test_flag(member, MFLAG_ACK_VIDEO)) {
switch_set_flag_locked(member, MFLAG_ACK_VIDEO);
- switch_core_session_refresh_video(member->session);
+ switch_core_session_refresh_video_both_ways(member->session);
conference_set_video_floor_holder(member->conference, member, SWITCH_FALSE);
}
switch_mutex_lock(conference->mutex);
if (!conference->record_fh) conference->record_fh = &fh;
if (conference->video_floor_holder) {
- switch_core_session_refresh_video(conference->video_floor_holder->session);
+ switch_core_session_refresh_video_both_ways(conference->video_floor_holder->session);
}
switch_mutex_unlock(conference->mutex);
switch_mutex_lock(smh->sdp_mutex);
-
for (pmap = engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) {
- exists = (!strcasecmp(name, pmap->iananame) && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime));
+ exists = (!strcasecmp(name, pmap->iananame) && pmap->pt == pt && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime));
if (exists) {
vmatch = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
}
+ //DFF hack out packetization mode 1 need infrastructure here
+ if (switch_stristr("packetization-mode=1", map->rm_fmtp)) {
+ vmatch = 0;
+ }
if (vmatch && (map->rm_rate == imp->samples_per_second)) {
matches[m_idx].imp = imp;
switch_core_media_choose_port(session, SWITCH_MEDIA_TYPE_VIDEO, 0);
}
- if (switch_channel_test_flag(session->channel, CF_WEBRTC)) {
- switch_media_handle_set_media_flag(smh, SCMF_MULTI_ANSWER_VIDEO);
- }
+ //if (switch_channel_test_flag(session->channel, CF_WEBRTC)) {
+ // switch_media_handle_set_media_flag(smh, SCMF_MULTI_ANSWER_VIDEO);
+ //}
if ((v_port = v_engine->adv_sdp_port)) {
int loops;
if (switch_media_handle_test_media_flag(smh, SCMF_MULTI_ANSWER_VIDEO)) {
switch_mutex_lock(smh->sdp_mutex);
for (pmap = v_engine->cur_payload_map; pmap && pmap->allocated; pmap = pmap->next) {
- if (pmap->pt != v_engine->cur_payload_map->pt) {
+ if (pmap->pt != v_engine->cur_payload_map->pt && pmap->negotiated) {
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), " %d", pmap->pt);
}
}
if (!switch_channel_test_flag(session->channel, CF_VIDEO)) {
return SWITCH_STATUS_FALSE;
}
-
- if (cmd == SCC_VIDEO_REFRESH) {
- 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);
- }
}
if (codec) {
msg.from = __FILE__;
msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
switch_core_session_receive_message(session, &msg);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ return SWITCH_STATUS_FALSE;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_session_refresh_video_both_ways(switch_core_session_t *session)
+{
+ if (switch_channel_test_flag(session->channel, CF_VIDEO)) {
+ switch_core_session_refresh_video(session);
switch_core_media_gen_key_frame(session);
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
+
SWITCH_DECLARE(void) switch_core_session_debug_pool(switch_stream_handle_t *stream)
{
stream->write_function(stream, "Thread pool: running:%d busy:%d popping:%d\n",