summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_session_video.h1
-rwxr-xr-xtinyDAV/src/video/tdav_session_video.c8
-rwxr-xr-xtinySIP/src/dialogs/tsip_dialog_layer.c4
3 files changed, 7 insertions, 6 deletions
diff --git a/tinyDAV/include/tinydav/video/tdav_session_video.h b/tinyDAV/include/tinydav/video/tdav_session_video.h
index 54cea1f..bde98b9 100755
--- a/tinyDAV/include/tinydav/video/tdav_session_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_session_video.h
@@ -126,6 +126,7 @@ typedef struct tdav_session_video_s {
unsigned dec_avg_time_n;
unsigned enc_avg_time_n;
tsk_mutex_handle_t* h_mutex_qos;
+ uint64_t last_sendreport_time;
}
tdav_session_video_t;
diff --git a/tinyDAV/src/video/tdav_session_video.c b/tinyDAV/src/video/tdav_session_video.c
index f773ede..755323a 100755
--- a/tinyDAV/src/video/tdav_session_video.c
+++ b/tinyDAV/src/video/tdav_session_video.c
@@ -731,6 +731,7 @@ static int _tdav_session_video_set_defaults(tdav_session_video_t* self)
self->zero_artifacts = tmedia_defaults_get_video_zeroartifacts_enabled();
self->avpf.max = tmedia_defaults_get_avpf_tail_min();
self->encoder.last_frame_time = 0;
+ self->last_sendreport_time = 0;
// Quality metrics
session->qos_metrics.q1 = 0.f, self->q1_n = 0;
session->qos_metrics.q2 = 0.f, self->q2_n = 0;
@@ -1458,7 +1459,7 @@ static int _tdav_session_video_timer_cb(const void* arg, tsk_timer_id_t timer_id
q5 /= 10.f;
#endif
- qavg = q1 * 0.1f + q2 * 0.4f + q3 * 0.1f + q4 * 0.1f + q5 * 0.3f;
+ qavg = q1 * 0.1f + q2 * 0.4f + q3 * 0.1f + q4 * 0.0f + q5 * 0.4f;
c = /*fabs*/(qavg - session->qos_metrics.qvag);
c = c < 0.f ? -c : +c;
TSK_DEBUG_INFO("_tdav_session_video_timer_cb: q1=%f, q2=%f, q3=%f, q4=%f, q5=%f, qavg=%f, c=%f congestion_ctrl_enabled=true", q1, q2, q3, q4, q5, qavg, c);
@@ -1529,8 +1530,7 @@ static int _tdav_session_video_report_bw_usage_and_jcng(tdav_session_video_t* se
// - fps changed or
// - first frame
if (base->congestion_ctrl_enabled && base->rtp_manager && session->qos_metrics.bw_down_est_kbps != 0) {
-# define TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL_HALF (TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL >> 1)
- tsk_bool_t update_info = (self->fps_changed || self->decoder.codec_decoded_frames_count == 0 || session->qos_metrics.last_update_time == 0 || ((tsk_time_now() - session->qos_metrics.last_update_time) > TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL_HALF));
+ tsk_bool_t update_info = (tsk_time_now() - self->last_sendreport_time) > TDAV_SESSION_VIDEO_QOS_COMPUTE_INTERVAL;
if (update_info) {
float jcng_q = 1.f;
if (self->jb && self->jb_enabled) {
@@ -1539,9 +1539,9 @@ static int _tdav_session_video_report_bw_usage_and_jcng(tdav_session_video_t* se
jcng_q = q5;
}
}
- self->fps_changed = tsk_false; // reset
TSK_DEBUG_INFO("video with congestion control enabled: est_bw_down=%llukbps, est_jcng=%f", session->qos_metrics.bw_down_est_kbps, jcng_q);
ret = trtp_manager_set_app_bw_and_jcng(base->rtp_manager, INT_MAX/* unused */, (int32_t)session->qos_metrics.bw_down_est_kbps, jcng_q);
+ self->last_sendreport_time = tsk_time_now();
}
}
return ret;
diff --git a/tinySIP/src/dialogs/tsip_dialog_layer.c b/tinySIP/src/dialogs/tsip_dialog_layer.c
index f91dd33..7177507 100755
--- a/tinySIP/src/dialogs/tsip_dialog_layer.c
+++ b/tinySIP/src/dialogs/tsip_dialog_layer.c
@@ -230,11 +230,11 @@ int tsip_dialog_layer_shutdownAll(tsip_dialog_layer_t *self)
tsk_safeobj_lock(self);
if(tsk_list_count(self->dialogs, pred_find_dialog_by_not_type, &regtype)) {
- /* There are non-register dialogs ==> phase-1 */
+ /* There is no register dialogs ==> phase-1 */
goto phase1;
}
else if(tsk_list_count(self->dialogs, pred_find_dialog_by_type, &regtype)) {
- /* There are one or more register dialogs ==> phase-2 */
+ /* There is at least one or more register dialogs ==> phase-2 */
goto phase2;
}
else {
OpenPOWER on IntegriCloud