Commit 4991c87e authored by Simon Morlat's avatar Simon Morlat
Browse files

send rtcp report more frequently at the beginning

parent fd74240c
......@@ -61,12 +61,14 @@ struct _AudioStream
OrtpEvQueue *evq;
MSAudioBitrateController *rc;
MSQualityIndicator *qi;
time_t start_time;
bool_t play_dtmfs;
bool_t use_gc;
bool_t use_agc;
bool_t eq_active;
bool_t use_ng;/*noise gate*/
bool_t use_rc;
bool_t is_beginning;
};
#ifdef __cplusplus
......
......@@ -129,6 +129,7 @@ RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){
rtp_session_signal_connect(rtpr,"timestamp_jump",(RtpCallback)rtp_session_resync,(long)NULL);
rtp_session_signal_connect(rtpr,"ssrc_changed",(RtpCallback)rtp_session_resync,(long)NULL);
rtp_session_set_ssrc_changed_threshold(rtpr,0);
rtp_session_set_rtcp_report_interval(rtpr,2500); /*at the beginning of the session send more reports*/
return rtpr;
}
......@@ -169,7 +170,10 @@ static void audio_stream_process_rtcp(AudioStream *stream, mblk_t *m){
}
void audio_stream_iterate(AudioStream *stream){
if (stream->is_beginning && ms_time(NULL)-stream->start_time>15){
rtp_session_set_rtcp_report_interval(stream->session,5000);
stream->is_beginning=FALSE;
}
if (stream->evq){
OrtpEvent *ev=ortp_ev_queue_get(stream->evq);
if (ev!=NULL){
......@@ -411,6 +415,9 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
ms_ticker_attach(stream->ticker,stream->soundread);
ms_ticker_attach(stream->ticker,stream->rtprecv);
stream->start_time=ms_time(NULL);
stream->is_beginning=TRUE;
return 0;
}
......
......@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define STATS_HISTORY 3
static const float unacceptable_loss_rate=20;
static const int big_jitter=40; /*ms */
static const int big_jitter=20; /*ms */
static const float significant_delay=0.2; /*seconds*/
static const int max_ptime=100;
......@@ -89,6 +89,7 @@ struct _MSAudioBitrateController{
int cur_ptime;
int cur_bitrate;
int stable_count;
int probing_up_count;
};
MSAudioBitrateController *ms_audio_bitrate_controller_new(RtpSession *session, MSFilter *encoder, unsigned int flags){
......@@ -236,6 +237,7 @@ static void state_machine(MSAudioBitrateController *obj){
action.type=IncreaseQuality;
execute_action(obj,&action);
obj->state=ProbingUp;
obj->probing_up_count=0;
}
break;
case Probing:
......@@ -251,16 +253,20 @@ static void state_machine(MSAudioBitrateController *obj){
break;
case ProbingUp:
obj->stable_count=0;
obj->probing_up_count++;
analyse_quality(obj,&action);
if (action.type!=DoNothing){
execute_action(obj,&action);
obj->state=Probing;
}else{
/*continue*/
action.type=IncreaseQuality;
if (execute_action(obj,&action)==-1){
/* we reached the maximum*/
obj->state=Init;
/*continue with slow ramp up*/
if (obj->probing_up_count==2){
action.type=IncreaseQuality;
if (execute_action(obj,&action)==-1){
/* we reached the maximum*/
obj->state=Init;
}
obj->probing_up_count=0;
}
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment