static void loss_rate_estimation() { bool_t supported = ms_filter_codec_supported("pcma"); if( supported ) { LossRateEstimatorCtx ctx; stream_manager_t * marielle, * margaux; int loss_rate = 15; start_adaptive_stream(MSAudio, &marielle, &margaux, PCMA8_PAYLOAD_TYPE, 8000, 0, loss_rate, 0, 0); ctx.estimator=ortp_loss_rate_estimator_new(120, 2500, marielle->audio_stream->ms.sessions.rtp_session); ctx.q = ortp_ev_queue_new(); rtp_session_register_event_queue(marielle->audio_stream->ms.sessions.rtp_session, ctx.q); ctx.loss_rate = loss_rate; /*loss rate should be the initial one*/ wait_for_until_with_parse_events(&marielle->audio_stream->ms, &margaux->audio_stream->ms, &loss_rate, 100, 10000, event_queue_cb,&ctx,NULL,NULL); /*let's set some duplication. loss rate should NOT be changed */ rtp_session_set_duplication_ratio(marielle->audio_stream->ms.sessions.rtp_session, 10); wait_for_until_with_parse_events(&marielle->audio_stream->ms, &margaux->audio_stream->ms, &loss_rate, 100, 10000, event_queue_cb,&ctx,NULL,NULL); stop_adaptive_stream(marielle,margaux); ortp_loss_rate_estimator_destroy(ctx.estimator); ortp_ev_queue_destroy(ctx.q); } }
void ms_qos_analyzer_unref(MSQosAnalyzer *obj){ obj->refcnt--; if (obj->refcnt<=0){ if (obj->desc->uninit) obj->desc->uninit(obj); if (obj->label) ms_free(obj->label); if (obj->lre) ortp_loss_rate_estimator_destroy(obj->lre); ms_free(obj); } }
static void simple_analyzer_uninit(MSQosAnalyzer *objbase){ MSSimpleQosAnalyzer *obj=(MSSimpleQosAnalyzer*)objbase; ortp_loss_rate_estimator_destroy(obj->lre); }