Update WP8 build
Add 1500mils delay for outgoing SIP INFOs(fast update) Detect RTCP-fb features at session start up after best codec is known
This commit is contained in:
parent
8579d2ce82
commit
b24ba08f11
|
@ -79,7 +79,7 @@ namespace doubango_rt
|
|||
};
|
||||
|
||||
public enum class rt_tmedia_pref_video_size_t
|
||||
{
|
||||
{/* must be sorted like this */
|
||||
tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
|
||||
tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
|
||||
tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
|
||||
|
@ -87,8 +87,10 @@ namespace doubango_rt
|
|||
tmedia_pref_video_size_hvga = tmedia_pref_video_size_hvga, // 480 x 320
|
||||
tmedia_pref_video_size_vga = tmedia_pref_video_size_vga, // 640 x 480
|
||||
tmedia_pref_video_size_4cif = tmedia_pref_video_size_4cif, // 704 x 576
|
||||
tmedia_pref_video_size_wvga = tmedia_pref_video_size_wvga, // 800 x 480
|
||||
tmedia_pref_video_size_svga = tmedia_pref_video_size_svga, // 800 x 600
|
||||
tmedia_pref_video_size_480p = tmedia_pref_video_size_480p, // 852 x 480
|
||||
tmedia_pref_video_size_xga = tmedia_pref_video_size_xga, // 1024 x 768
|
||||
tmedia_pref_video_size_720p = tmedia_pref_video_size_720p, // 1280 x 720
|
||||
tmedia_pref_video_size_16cif = tmedia_pref_video_size_16cif, // 1408 x 1152
|
||||
tmedia_pref_video_size_1080p = tmedia_pref_video_size_1080p, // 1920 x 1080
|
||||
|
|
|
@ -285,6 +285,10 @@ namespace doubango_rt
|
|||
bool setRtcpMux(bool enabled);
|
||||
bool setICE(bool enabled);
|
||||
bool setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength);
|
||||
bool setVideoFps(int32_t fps);
|
||||
bool setVideoBandwidthUploadMax(int32_t max);
|
||||
bool setVideoBandwidthDownloadMax(int32_t max);
|
||||
bool setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size);
|
||||
bool hold(rtActionConfig^ config);
|
||||
bool hold();
|
||||
bool resume(rtActionConfig^ config);
|
||||
|
|
|
@ -161,6 +161,26 @@ bool rtCallSession::setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t
|
|||
return m_pSipSession->setQoS((tmedia_qos_stype_t) type, (tmedia_qos_strength_t) strength);
|
||||
}
|
||||
|
||||
bool rtCallSession::setVideoFps(int32_t fps)
|
||||
{
|
||||
return m_pSipSession->setVideoFps(fps);
|
||||
}
|
||||
|
||||
bool rtCallSession::setVideoBandwidthUploadMax(int32_t max)
|
||||
{
|
||||
return m_pSipSession->setVideoBandwidthUploadMax(max);
|
||||
}
|
||||
|
||||
bool rtCallSession::setVideoBandwidthDownloadMax(int32_t max)
|
||||
{
|
||||
return m_pSipSession->setVideoBandwidthDownloadMax(max);
|
||||
}
|
||||
|
||||
bool rtCallSession::setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size)
|
||||
{
|
||||
return m_pSipSession->setVideoPrefSize((tmedia_pref_video_size_t)pref_video_size);
|
||||
}
|
||||
|
||||
bool rtCallSession::hold(rtActionConfig^ config)
|
||||
{
|
||||
return m_pSipSession->hold(config ? config->getWrappedActionConfig() : tsk_null);
|
||||
|
|
|
@ -591,6 +591,33 @@ int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_co
|
|||
}
|
||||
}
|
||||
|
||||
// Check if "RTCP-NACK", "RTC-FIR", "RTCP-GOOG-REMB".... are supported by the selected encoder
|
||||
self->is_fb_fir_neg = self->is_fb_nack_neg = self->is_fb_googremb_neg = tsk_false;
|
||||
if (TMEDIA_SESSION(self)->M.ro) {
|
||||
// a=rtcp-fb:* ccm fir
|
||||
// a=rtcp-fb:* nack
|
||||
// a=rtcp-fb:* goog-remb
|
||||
char attr_fir[256], attr_nack[256], attr_goog_remb[256];
|
||||
int index = 0;
|
||||
const tsdp_header_A_t* A;
|
||||
|
||||
sprintf(attr_fir, "%s ccm fir", best_codec->neg_format);
|
||||
sprintf(attr_nack, "%s nack", best_codec->neg_format);
|
||||
sprintf(attr_goog_remb, "%s goog-remb", best_codec->neg_format);
|
||||
|
||||
while ((A = tsdp_header_M_findA_at(TMEDIA_SESSION(self)->M.ro, "rtcp-fb", index++))) {
|
||||
if (!self->is_fb_fir_neg) {
|
||||
self->is_fb_fir_neg = (tsk_striequals(A->value, "* ccm fir") || tsk_striequals(A->value, attr_fir));
|
||||
}
|
||||
if (!self->is_fb_nack_neg) {
|
||||
self->is_fb_nack_neg = (tsk_striequals(A->value, "* nack") || tsk_striequals(A->value, attr_nack));
|
||||
}
|
||||
if (!self->is_fb_googremb_neg) {
|
||||
self->is_fb_googremb_neg = (tsk_striequals(A->value, "* goog-remb") || tsk_striequals(A->value, attr_goog_remb));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self->rtp_manager) {
|
||||
int ret;
|
||||
tmedia_param_t* media_param = tsk_null;
|
||||
|
|
|
@ -1112,6 +1112,7 @@ static int tdav_session_video_start(tmedia_session_t* self)
|
|||
tsk_mutex_lock(video->encoder.h_mutex);
|
||||
TSK_OBJECT_SAFE_FREE(video->encoder.codec);
|
||||
video->encoder.codec = tsk_object_ref((tsk_object_t*)codec);
|
||||
|
||||
// initialize the encoder using user-defined values
|
||||
if ((ret = tdav_session_av_init_encoder(base, video->encoder.codec))) {
|
||||
TSK_DEBUG_ERROR("Failed to initialize the encoder [%s] codec", video->encoder.codec->plugin->desc);
|
||||
|
@ -1218,36 +1219,6 @@ static int tdav_session_video_set_ro(tmedia_session_t* self, const tsdp_header_M
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Check if "RTCP-NACK" and "RTC-FIR" are supported
|
||||
{
|
||||
const tmedia_codec_t* codec;
|
||||
base->is_fb_fir_neg = base->is_fb_nack_neg = base->is_fb_googremb_neg = tsk_false;
|
||||
if ((codec = tdav_session_av_get_best_neg_codec(base))) {
|
||||
// a=rtcp-fb:* ccm fir
|
||||
// a=rtcp-fb:* nack
|
||||
// a=rtcp-fb:* goog-remb
|
||||
char attr_fir[256], attr_nack[256], attr_goog_remb[256];
|
||||
int index = 0;
|
||||
const tsdp_header_A_t* A;
|
||||
|
||||
sprintf(attr_fir, "%s ccm fir", codec->neg_format);
|
||||
sprintf(attr_nack, "%s nack", codec->neg_format);
|
||||
sprintf(attr_goog_remb, "%s goog-remb", codec->neg_format);
|
||||
|
||||
while ((A = tsdp_header_M_findA_at(m, "rtcp-fb", index++))) {
|
||||
if (!base->is_fb_fir_neg) {
|
||||
base->is_fb_fir_neg = (tsk_striequals(A->value, "* ccm fir") || tsk_striequals(A->value, attr_fir));
|
||||
}
|
||||
if (!base->is_fb_nack_neg) {
|
||||
base->is_fb_nack_neg = (tsk_striequals(A->value, "* nack") || tsk_striequals(A->value, attr_nack));
|
||||
}
|
||||
if (!base->is_fb_googremb_neg) {
|
||||
base->is_fb_googremb_neg = (tsk_striequals(A->value, "* goog-remb") || tsk_striequals(A->value, attr_goog_remb));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
// set callbacks
|
||||
ret = _tdav_session_video_set_callbacks(self);
|
||||
|
|
|
@ -54,6 +54,7 @@ typedef struct tsip_dialog_invite
|
|||
tsk_bool_t is_cancelling; // whether we're cancelling the outgoing INVITE
|
||||
uint32_t rseq;
|
||||
uint32_t cseq_out_media_update; // CSeq for the last media update request (INVITE or UPDATE).
|
||||
uint64_t last_out_fastupdate_time;
|
||||
|
||||
tsip_timer_t timershutdown;
|
||||
tsip_timer_t timer100rel;
|
||||
|
|
|
@ -53,6 +53,12 @@
|
|||
|
||||
#include "tsk_debug.h"
|
||||
|
||||
#if METROPOLIS
|
||||
# define TSIP_INFO_FASTUPDATE_OUT_INTERVAL_MIN 0 // millis
|
||||
#else
|
||||
# define TSIP_INFO_FASTUPDATE_OUT_INTERVAL_MIN 1500 // millis
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBXML2
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
|
@ -1799,6 +1805,8 @@ static int tsip_dialog_invite_msession_rfc5168_cb(const void* usrdata, const str
|
|||
|
||||
if (self) {
|
||||
if (command == tmedia_session_rfc5168_cmd_picture_fast_update) {
|
||||
uint64_t now = tsk_time_now();
|
||||
if ((now - self->last_out_fastupdate_time) > TSIP_INFO_FASTUPDATE_OUT_INTERVAL_MIN) {
|
||||
char* content_ptr = tsk_null;
|
||||
static const char* __content_type = "application/media_control+xml";
|
||||
static const void* __content_format =
|
||||
|
@ -1814,8 +1822,14 @@ static int tsip_dialog_invite_msession_rfc5168_cb(const void* usrdata, const str
|
|||
" </media_control>\r\n";
|
||||
TSK_DEBUG_INFO("Media session is asking the sigaling layer to send SIP INFO('picture_fast_update')");
|
||||
tsk_sprintf(&content_ptr, __content_format, session->id);
|
||||
self->last_out_fastupdate_time = now;
|
||||
return send_INFO(self, __content_type, content_ptr, tsk_strlen(content_ptr));
|
||||
}
|
||||
else {
|
||||
/* if too close don't update "last_fir_time" to "now" to be sure interval will increase */
|
||||
TSK_DEBUG_INFO("Outgoing SIP INFO ('picture_fast_update') requested but delay too close");
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue