if (su_casematch(name, "CT"))
modifier = sdp_bw_ct, name = NULL;
- else if (su_casematch(name, "AS") == 0)
+ else if (su_casematch(name, "TIAS") == 1)
+ modifier = sdp_bw_tias, name = NULL;
+ else if (su_casematch(name, "AS") == 1)
modifier = sdp_bw_as, name = NULL;
else
modifier = sdp_bw_x;
switch (b->b_modifier) {
case sdp_bw_ct: name = "CT"; break;
case sdp_bw_as: name = "AS"; break;
+ case sdp_bw_tias: name = "TIAS"; break;
default: name = b->b_modifier_name; break;
}
sdp_bw_x, /**< Unknown bandwidth type */
sdp_bw_ct, /**< Conference total */
sdp_bw_as, /**< Application-specific */
+ sdp_bw_tias, /**< Application-specific */
} sdp_bandwidth_e;
/** Session or media bandwidth. */
SWITCH_DECLARE(int) switch_core_cert_gen_fingerprint(const char *prefix, dtls_fingerprint_t *fp);
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(switch_status_t) switch_core_session_request_video_refresh(switch_core_session_t *session);
+SWITCH_DECLARE(switch_status_t) switch_core_session_send_and_request_video_refresh(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);
context->img->stride[2] = picture->linesize[2];
frame->img = context->img;
-
}
av_frame_free(&picture);
}
switch_buffer_zero(context->nalu_buffer);
+ //switch_set_flag(frame, SFF_USE_VIDEO_TIMESTAMP);
return SWITCH_STATUS_SUCCESS;
}
switch_channel_ready(channel_a) && switch_channel_ready(channel_b)) {
if (switch_channel_test_flag(channel_a, CF_VIDEO_REFRESH_REQ)) {
- switch_core_session_video_reinit(session_b);
+ switch_core_session_request_video_refresh(session_b);
switch_channel_clear_flag(channel_a, CF_VIDEO_REFRESH_REQ);
}
goto do_continue;
}
- //memcpy(buf, vid_frame->packet, vid_frame->packetlen);
-
+ //memcpy(buf, vid_frame->packet, vid_frame->packelen);
+
switch_mutex_unlock(conference->mutex);
switch_mutex_lock(conference->mutex);
want_refresh = 0;
switch_mutex_unlock(conference->mutex);
if (want_refresh && session) {
- switch_core_session_video_reinit(session);
+ switch_core_session_request_video_refresh(session);
want_refresh = 0;
}
switch_core_session_get_read_impl(session, &read_impl);
switch_channel_answer(channel);
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "");
switch_frame_t *read_frame;
switch_codec_implementation_t read_impl = { 0 };
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
switch_core_session_get_read_impl(session, &read_impl);
}
switch_channel_answer(channel);
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
switch_core_media_start_video_function(session, decode_video_thread, &max_pictures);
switch_ivr_play_file(session, NULL, moh, NULL);
switch_goto_status(SWITCH_STATUS_RESTART, end);
}
}
-
+ //switch_set_flag(frame, SFF_USE_VIDEO_TIMESTAMP);
switch_buffer_zero(context->nalu_buffer);
status = SWITCH_STATUS_SUCCESS;
}
switch_yield(10000);
}
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_BREAK);
switch_core_session_kill_channel(tech_pvt->session, SWITCH_SIG_BREAK);
}
-SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_refresh_video(void * jarg1) {
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_request_video_refresh(void * jarg1) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
switch_status_t result;
arg1 = (switch_core_session_t *)jarg1;
- result = (switch_status_t)switch_core_session_refresh_video(arg1);
+ result = (switch_status_t)switch_core_session_request_video_refresh(arg1);
jresult = result;
return jresult;
}
return ret;
}
- public static switch_status_t switch_core_session_refresh_video(SWIGTYPE_p_switch_core_session session) {
- switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_refresh_video(SWIGTYPE_p_switch_core_session.getCPtr(session));
+ public static switch_status_t switch_core_session_request_video_refresh(SWIGTYPE_p_switch_core_session session) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_request_video_refresh(SWIGTYPE_p_switch_core_session.getCPtr(session));
return ret;
}
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_cert_verify")]
public static extern int switch_core_cert_verify(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_refresh_video")]
- public static extern int switch_core_session_refresh_video(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_request_video_refresh")]
+ public static extern int switch_core_session_request_video_refresh(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_stream_system_fork")]
public static extern int switch_stream_system_fork(string jarg1, HandleRef jarg2);
#define MAX_CODEC_CHECK_FRAMES 50//x:mod_sofia.h
#define MAX_MISMATCH_FRAMES 5//x:mod_sofia.h
#define type2str(type) type == SWITCH_MEDIA_TYPE_VIDEO ? "video" : "audio"
-#define VIDEO_REFRESH_FREQ 1000000
+#define VIDEO_REFRESH_FREQ 50000
typedef enum {
SMF_INIT = (1 << 0),
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Video thread started. Echo is %s\n",
switch_channel_get_name(session->channel), switch_channel_test_flag(channel, CF_VIDEO_ECHO) ? "on" : "off");
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
while (switch_channel_up_nosig(channel)) {
if (!switch_channel_test_flag(channel, CF_VIDEO)) {
switch_thread_cond_wait(mh->cond, mh->cond_mutex);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Video thread resumed Echo is %s\n",
switch_channel_get_name(session->channel), switch_channel_test_flag(channel, CF_VIDEO_ECHO) ? "on" : "off");
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
}
if (switch_channel_test_flag(channel, CF_VIDEO_PASSIVE)) {
continue;
}
- if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
- switch_core_session_refresh_video(session);
- switch_channel_clear_flag(channel, CF_VIDEO_REFRESH_REQ);
- }
-
if (switch_test_flag(read_frame, SFF_CNG)) {
continue;
}
flags[SWITCH_RTP_FLAG_USE_TIMER] = 0;
flags[SWITCH_RTP_FLAG_NOBLOCK] = 0;
flags[SWITCH_RTP_FLAG_VIDEO]++;
+
+ if (v_engine->fir) {
+ flags[SWITCH_RTP_FLAG_FIR]++;
+ }
+
+ if (v_engine->pli) {
+ flags[SWITCH_RTP_FLAG_PLI]++;
+ }
v_engine->rtp_session = switch_rtp_new(a_engine->local_sdp_ip,
v_engine->local_sdp_port,
if (bw > 0) {
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=AS:%d\n", bw);
+ //switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=TIAS:%d\n", bw);
}
}
/* DFF nack pli etc */
- nack = v_engine->nack = 0; //pli = v_engine->pli = 0;
+ nack = v_engine->nack = 0;
+ //pli = v_engine->pli = 0;
+
for (pmap = v_engine->cur_payload_map; pmap && pmap->allocated; pmap = pmap->next) {
if (!v_engine->codec_negotiated ||
}
-SWITCH_DECLARE(switch_status_t) switch_core_session_refresh_video(switch_core_session_t *session)
+SWITCH_DECLARE(switch_status_t) switch_core_session_request_video_refresh(switch_core_session_t *session)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_media_handle_t *smh = NULL;
return SWITCH_STATUS_FALSE;
}
-SWITCH_DECLARE(switch_status_t) switch_core_session_refresh_video_both_ways(switch_core_session_t *session)
+SWITCH_DECLARE(switch_status_t) switch_core_session_send_and_request_video_refresh(switch_core_session_t *session)
{
if (switch_channel_test_flag(session->channel, CF_VIDEO)) {
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
switch_core_media_gen_key_frame(session);
return SWITCH_STATUS_SUCCESS;
}
smh->video_init = 0;
smh->video_last_key_time = 0;
- switch_core_session_refresh_video_both_ways(session);
+ switch_core_session_send_and_request_video_refresh(session);
}
SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags,
}
if (!smh->video_init && smh->mparams->video_key_first && (now - smh->video_last_key_time) > smh->mparams->video_key_first) {
- switch_core_session_refresh_video_both_ways(smh->session);
+ switch_core_media_gen_key_frame(session);
if (smh->video_last_key_time) {
smh->video_init = 1;
}
if (switch_test_flag((*frame), SFF_WAIT_KEY_FRAME)) {
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
switch_clear_flag((*frame), SFF_WAIT_KEY_FRAME);
}
switch_channel_clear_flag(session->channel, CF_VIDEO_DECODED_READ);
switch_channel_clear_flag(session->channel, CF_VIDEO_DEBUG_READ);
switch_channel_clear_flag(session->channel, CF_VIDEO_DEBUG_WRITE);
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
}
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flags(switch_core_session_t *session, const char *app,
}
if (!switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA) && (switch_channel_test_flag(session->channel, CF_VIDEO))) {
- switch_core_session_refresh_video(session);
+ switch_core_session_request_video_refresh(session);
}
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
if (state < CS_HANGUP && switch_channel_get_callstate(session->channel) == CCS_UNHELD) { \
switch_channel_set_callstate(session->channel, CCS_ACTIVE); \
} \
- switch_core_session_refresh_video(session); \
+ switch_core_session_request_video_refresh(session); \
if (!driver_state_handler->on_##__STATE || (driver_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
)) { \
while (do_extra_handlers && (application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) { \
switch_core_session_read_lock(vh->session_a);
switch_core_session_read_lock(vh->session_b);
- switch_core_session_refresh_video(vh->session_a);
- switch_core_session_refresh_video(vh->session_b);
+ switch_core_session_request_video_refresh(vh->session_a);
+ switch_core_session_request_video_refresh(vh->session_b);
while (switch_channel_up_nosig(channel) && switch_channel_up_nosig(b_channel) && vh->up == 1) {
switch_core_session_kill_channel(vh->session_b, SWITCH_SIG_BREAK);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(vh->session_a), SWITCH_LOG_DEBUG, "%s video thread ended.\n", switch_channel_get_name(channel));
- switch_core_session_refresh_video(vh->session_a);
- switch_core_session_refresh_video(vh->session_b);
+ switch_core_session_request_video_refresh(vh->session_a);
+ switch_core_session_request_video_refresh(vh->session_b);
switch_core_session_rwunlock(vh->session_a);
switch_core_session_rwunlock(vh->session_b);
rtp_session->fir_countdown = FIR_COUNTDOWN;
if (rtp_session->session && switch_core_session_get_partner(rtp_session->session, &other_session) == SWITCH_STATUS_SUCCESS) {
- switch_core_session_refresh_video(other_session);
+ switch_core_session_request_video_refresh(other_session);
switch_core_session_rwunlock(other_session);
}
}
}
} else {
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
- if (switch_core_timer_init(&rtp_session->timer, "soft", 1, 90, pool) == SWITCH_STATUS_SUCCESS) {
+ if (switch_core_timer_init(&rtp_session->timer, "soft", 10, 900, pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Starting video timer.\n");
}
} else {
if ((extp->header.fmt == 4) || (extp->header.fmt == 1)) { /* FIR || PLI */
switch_core_media_gen_key_frame(rtp_session->session);
+ switch_channel_set_flag(switch_core_session_get_channel(rtp_session->session), CF_VIDEO_REFRESH_REQ);
}
} else
uint32_t len, ts = 0;
switch_payload_t payload = 0;
rtp_msg_t *send_msg = NULL;
+ rtp_msg_t local_send_msg = { {0} };
if (!switch_rtp_ready(rtp_session) || !rtp_session->remote_addr) {
return -1;
if (fwd) {
send_msg = frame->packet;
+ local_send_msg = *send_msg;
+ send_msg = &local_send_msg;
len = frame->packetlen;
ts = 0;