rename analyser to analyzer in files for consistency between files' name and content

parent 13994a64
......@@ -44,14 +44,14 @@ enum _MSRateControlActionType{
typedef enum _MSRateControlActionType MSRateControlActionType;
const char *ms_rate_control_action_type_name(MSRateControlActionType t);
enum _MSQosAnalyserNetworkState{
MSQosAnalyserNetworkFine,
MSQosAnalyserNetworkUnstable,
MSQosAnalyserNetworkCongested,
MSQosAnalyserNetworkLossy,
enum _MSQosAnalyzerNetworkState{
MSQosAnalyzerNetworkFine,
MSQosAnalyzerNetworkUnstable,
MSQosAnalyzerNetworkCongested,
MSQosAnalyzerNetworkLossy,
};
typedef enum _MSQosAnalyserNetworkState MSQosAnalyserNetworkState;
const char *ms_qos_analyser_network_state_name(MSQosAnalyserNetworkState state);
typedef enum _MSQosAnalyzerNetworkState MSQosAnalyzerNetworkState;
const char *ms_qos_analyzer_network_state_name(MSQosAnalyzerNetworkState state);
typedef struct _MSRateControlAction{
MSRateControlActionType type;
......@@ -83,23 +83,23 @@ MSBitrateDriver *ms_audio_bitrate_driver_new(RtpSession *session, MSFilter *enco
MSBitrateDriver *ms_av_bitrate_driver_new(RtpSession *asession, MSFilter *aenc, RtpSession *vsession, MSFilter *venc);
MSBitrateDriver *ms_bandwidth_bitrate_driver_new(RtpSession *asession, MSFilter *aenc, RtpSession *vsession, MSFilter *venc);
typedef struct _MSQosAnalyser MSQosAnalyser;
typedef struct _MSQosAnalyserDesc MSQosAnalyserDesc;
typedef struct _MSQosAnalyzer MSQosAnalyzer;
typedef struct _MSQosAnalyzerDesc MSQosAnalyzerDesc;
struct _MSQosAnalyserDesc{
bool_t (*process_rtcp)(MSQosAnalyser *obj, mblk_t *rtcp);
void (*suggest_action)(MSQosAnalyser *obj, MSRateControlAction *action);
bool_t (*has_improved)(MSQosAnalyser *obj);
void (*update)(MSQosAnalyser *);
void (*uninit)(MSQosAnalyser *);
struct _MSQosAnalyzerDesc{
bool_t (*process_rtcp)(MSQosAnalyzer *obj, mblk_t *rtcp);
void (*suggest_action)(MSQosAnalyzer *obj, MSRateControlAction *action);
bool_t (*has_improved)(MSQosAnalyzer *obj);
void (*update)(MSQosAnalyzer *);
void (*uninit)(MSQosAnalyzer *);
};
/**
* A MSQosAnalyser is responsible to analyze RTCP feedback and suggest actions on bitrate or packet rate accordingly.
* A MSQosAnalyzer is responsible to analyze RTCP feedback and suggest actions on bitrate or packet rate accordingly.
* This is an abstract interface.
**/
struct _MSQosAnalyser{
MSQosAnalyserDesc *desc;
struct _MSQosAnalyzer{
MSQosAnalyzerDesc *desc;
int refcnt;
enum {
......@@ -109,38 +109,38 @@ struct _MSQosAnalyser{
};
MSQosAnalyser * ms_qos_analyser_ref(MSQosAnalyser *obj);
void ms_qos_analyser_unref(MSQosAnalyser *obj);
void ms_qos_analyser_suggest_action(MSQosAnalyser *obj, MSRateControlAction *action);
bool_t ms_qos_analyser_has_improved(MSQosAnalyser *obj);
bool_t ms_qos_analyser_process_rtcp(MSQosAnalyser *obj, mblk_t *rtcp);
void ms_qos_analyser_update(MSQosAnalyser *obj);
MSQosAnalyzer * ms_qos_analyzer_ref(MSQosAnalyzer *obj);
void ms_qos_analyzer_unref(MSQosAnalyzer *obj);
void ms_qos_analyzer_suggest_action(MSQosAnalyzer *obj, MSRateControlAction *action);
bool_t ms_qos_analyzer_has_improved(MSQosAnalyzer *obj);
bool_t ms_qos_analyzer_process_rtcp(MSQosAnalyzer *obj, mblk_t *rtcp);
void ms_qos_analyzer_update(MSQosAnalyzer *obj);
/**
* The simple qos analyser is an implementation of MSQosAnalyser that performs analysis for single stream.
* The simple qos analyzer is an implementation of MSQosAnalyzer that performs analysis for single stream.
**/
MSQosAnalyser * ms_simple_qos_analyser_new(RtpSession *session);
MSQosAnalyzer * ms_simple_qos_analyzer_new(RtpSession *session);
MSQosAnalyser * ms_stateful_qos_analyser_new(RtpSession *session);
MSQosAnalyzer * ms_stateful_qos_analyzer_new(RtpSession *session);
/**
* The audio/video qos analyser is an implementation of MSQosAnalyser that performs analysis of two audio and video streams.
* The audio/video qos analyzer is an implementation of MSQosAnalyzer that performs analysis of two audio and video streams.
**/
/*MSQosAnalyser * ms_av_qos_analyser_new(RtpSession *asession, RtpSession *vsession);*/
/*MSQosAnalyzer * ms_av_qos_analyzer_new(RtpSession *asession, RtpSession *vsession);*/
/**
* The MSBitrateController the overall behavior and state machine of the adaptive rate control system.
* It requires a MSQosAnalyser to obtain analyse of the quality of service, and a MSBitrateDriver
* It requires a MSQosAnalyzer to obtain analyse of the quality of service, and a MSBitrateDriver
* to run the actions on media streams, like decreasing or increasing bitrate.
**/
typedef struct _MSBitrateController MSBitrateController;
/**
* Instanciates MSBitrateController
* @param qosanalyser a Qos analyser object
* @param qosanalyzer a Qos analyzer object
* @param driver a bitrate driver object.
* The newly created bitrate controller owns references to the analyser and the driver.
* The newly created bitrate controller owns references to the analyzer and the driver.
**/
MSBitrateController *ms_bitrate_controller_new(MSQosAnalyser *qosanalyser, MSBitrateDriver *driver);
MSBitrateController *ms_bitrate_controller_new(MSQosAnalyzer *qosanalyzer, MSBitrateDriver *driver);
/**
* Asks the bitrate controller to process a newly received RTCP packet.
......@@ -155,14 +155,14 @@ void ms_bitrate_controller_process_rtcp(MSBitrateController *obj, mblk_t *rtcp);
void ms_bitrate_controller_update(MSBitrateController *obj);
/**
* Return the QoS analyser associated to the bitrate controller
* Return the QoS analyzer associated to the bitrate controller
**/
const MSQosAnalyser * ms_bitrate_controller_get_qos_analyser(MSBitrateController *obj);
const MSQosAnalyzer * ms_bitrate_controller_get_qos_analyzer(MSBitrateController *obj);
/**
* Destroys the bitrate controller
*
* If no other entity holds references to the underlyings MSQosAnalyser and MSBitrateDriver object,
* If no other entity holds references to the underlyings MSQosAnalyzer and MSBitrateDriver object,
* then they will be destroyed too.
**/
void ms_bitrate_controller_destroy(MSBitrateController *obj);
......@@ -175,7 +175,7 @@ void ms_bitrate_controller_destroy(MSBitrateController *obj);
* This function actually calls internally:
* <br>
* \code
* ms_bitrate_controller_new(ms_simple_qos_analyser_new(session),ms_audio_bitrate_driver_new(encoder));
* ms_bitrate_controller_new(ms_simple_qos_analyzer_new(session),ms_audio_bitrate_driver_new(encoder));
* \endcode
**/
MSBitrateController *ms_audio_bitrate_controller_new(RtpSession *session, MSFilter *encoder, unsigned int flags);
......@@ -189,7 +189,7 @@ MSBitrateController *ms_audio_bitrate_controller_new(RtpSession *session, MSFilt
* This function actually calls internally:
* <br>
* \code
* ms_bitrate_controller_new(ms_av_qos_analyser_new(asession,vsession),ms_av_bitrate_driver_new(aenc,venc));
* ms_bitrate_controller_new(ms_av_qos_analyzer_new(asession,vsession),ms_av_bitrate_driver_new(aenc,venc));
* \endcode
**/
MSBitrateController *ms_av_bitrate_controller_new(RtpSession *asession, MSFilter *aenc, RtpSession *vsession, MSFilter *venc);
......
......@@ -42,7 +42,7 @@ const char *state_name(enum state_t st){
}
struct _MSBitrateController{
MSQosAnalyser *analyser;
MSQosAnalyzer *analyzer;
MSBitrateDriver *driver;
enum state_t state;
int stable_count;
......@@ -50,9 +50,9 @@ struct _MSBitrateController{
};
MSBitrateController *ms_bitrate_controller_new(MSQosAnalyser *qosanalyser, MSBitrateDriver *driver){
MSBitrateController *ms_bitrate_controller_new(MSQosAnalyzer *qosanalyzer, MSBitrateDriver *driver){
MSBitrateController *obj=ms_new0(MSBitrateController,1);
obj->analyser=ms_qos_analyser_ref(qosanalyser);
obj->analyzer=ms_qos_analyzer_ref(qosanalyzer);
obj->driver=ms_bitrate_driver_ref(driver);
return obj;
}
......@@ -67,7 +67,7 @@ static void state_machine(MSBitrateController *obj){
case Stable:
obj->stable_count++;
case Init:
ms_qos_analyser_suggest_action(obj->analyser,&action);
ms_qos_analyzer_suggest_action(obj->analyzer,&action);
if (action.type!=MSRateControlActionDoNothing){
execute_action(obj,&action);
obj->state=Probing;
......@@ -81,10 +81,10 @@ static void state_machine(MSBitrateController *obj){
break;
case Probing:
obj->stable_count=0;
if (ms_qos_analyser_has_improved(obj->analyser)){
if (ms_qos_analyzer_has_improved(obj->analyzer)){
obj->state=Stable;
}else{
ms_qos_analyser_suggest_action(obj->analyser,&action);
ms_qos_analyzer_suggest_action(obj->analyzer,&action);
if (action.type!=MSRateControlActionDoNothing){
execute_action(obj,&action);
}
......@@ -93,7 +93,7 @@ static void state_machine(MSBitrateController *obj){
case ProbingUp:
obj->stable_count=0;
obj->probing_up_count++;
ms_qos_analyser_suggest_action(obj->analyser,&action);
ms_qos_analyzer_suggest_action(obj->analyzer,&action);
if (action.type!=MSRateControlActionDoNothing){
execute_action(obj,&action);
obj->state=Probing;
......@@ -119,40 +119,40 @@ static void state_machine(MSBitrateController *obj){
void ms_bitrate_controller_process_rtcp(MSBitrateController *obj, mblk_t *rtcp){
if (ms_qos_analyser_process_rtcp(obj->analyser,rtcp)){
if (ms_qos_analyzer_process_rtcp(obj->analyzer,rtcp)){
state_machine(obj);
}
}
void ms_bitrate_controller_update(MSBitrateController *obj){
ms_qos_analyser_update(obj->analyser);
ms_qos_analyzer_update(obj->analyzer);
}
const MSQosAnalyser * ms_bitrate_controller_get_qos_analyser(MSBitrateController *obj){
return obj->analyser;
const MSQosAnalyzer * ms_bitrate_controller_get_qos_analyzer(MSBitrateController *obj){
return obj->analyzer;
}
void ms_bitrate_controller_destroy(MSBitrateController *obj){
ms_qos_analyser_unref(obj->analyser);
ms_qos_analyzer_unref(obj->analyzer);
ms_bitrate_driver_unref(obj->driver);
ms_free(obj);
}
MSBitrateController *ms_audio_bitrate_controller_new(RtpSession *session, MSFilter *encoder, unsigned int flags){
return ms_bitrate_controller_new(
ms_simple_qos_analyser_new(session),
ms_simple_qos_analyzer_new(session),
ms_audio_bitrate_driver_new(session, encoder));
}
MSBitrateController *ms_av_bitrate_controller_new(RtpSession *asession, MSFilter *aenc, RtpSession *vsession, MSFilter *venc){
return ms_bitrate_controller_new(
ms_simple_qos_analyser_new(vsession),
ms_simple_qos_analyzer_new(vsession),
ms_av_bitrate_driver_new(asession, aenc, vsession, venc));
}
MSBitrateController *ms_bandwidth_bitrate_controller_new(RtpSession *asession, MSFilter *aenc, RtpSession *vsession, MSFilter *venc){
return ms_bitrate_controller_new(
ms_stateful_qos_analyser_new(vsession?vsession:asession),
ms_stateful_qos_analyzer_new(vsession?vsession:asession),
ms_bandwidth_bitrate_driver_new(asession, aenc, vsession, venc));
}
This diff is collapsed.
......@@ -42,15 +42,15 @@ extern "C" {
float rt_prop; /*round trip propagation*/
}rtpstats_t;
typedef struct _MSSimpleQosAnalyser{
MSQosAnalyser parent;
typedef struct _MSSimpleQosAnalyzer{
MSQosAnalyzer parent;
RtpSession *session;
int clockrate;
rtpstats_t stats[STATS_HISTORY];
int curindex;
bool_t rt_prop_doubled;
bool_t pad[3];
}MSSimpleQosAnalyser;
}MSSimpleQosAnalyzer;
typedef struct rtcpstatspoint{
time_t timestamp;
......@@ -59,21 +59,21 @@ extern "C" {
double rtt;
} rtcpstatspoint_t;
typedef enum _MSStatefulQosAnalyserBurstState{
MSStatefulQosAnalyserBurstDisable,
MSStatefulQosAnalyserBurstInProgress,
MSStatefulQosAnalyserBurstEnable,
}MSStatefulQosAnalyserBurstState;
typedef enum _MSStatefulQosAnalyzerBurstState{
MSStatefulQosAnalyzerBurstDisable,
MSStatefulQosAnalyzerBurstInProgress,
MSStatefulQosAnalyzerBurstEnable,
}MSStatefulQosAnalyzerBurstState;
typedef struct _MSStatefulQosAnalyser{
MSQosAnalyser parent;
typedef struct _MSStatefulQosAnalyzer{
MSQosAnalyzer parent;
RtpSession *session;
int clockrate;
rtpstats_t stats[STATS_HISTORY];
int curindex;
bool_t rt_prop_doubled;
MSQosAnalyserNetworkState network_state;
MSQosAnalyzerNetworkState network_state;
MSList *rtcpstatspoint;
rtcpstatspoint_t *latest;
double network_loss_rate;
......@@ -82,7 +82,7 @@ extern "C" {
int cum_loss_prev;
int previous_ext_high_seq_num_rec;
MSStatefulQosAnalyserBurstState burst_state;
MSStatefulQosAnalyzerBurstState burst_state;
struct timeval start_time;
uint32_t upload_bandwidth_count;
......@@ -94,7 +94,7 @@ extern "C" {
double burst_ratio;
double burst_duration_ms;
}MSStatefulQosAnalyser;
}MSStatefulQosAnalyzer;
#ifdef __cplusplus
}
#endif
......
......@@ -85,7 +85,7 @@ typedef struct _audio_stats_t {
typedef struct _video_stats_t {
float loss;
float rtt;
MSQosAnalyserNetworkState network_state;
MSQosAnalyzerNetworkState network_state;
float loss_estim;
float congestion_bw_estim;
} video_stats_t;
......@@ -227,12 +227,12 @@ static void handle_queue_events(stream_manager_t * stream_mgr, OrtpEvQueue * evq
if (rb && stream_mgr->type==VideoStreamType) {
if (stream_mgr->video_stream->ms.use_rc){
const MSQosAnalyser *analyser=ms_bitrate_controller_get_qos_analyser(stream_mgr->video_stream->ms.rc);
if (analyser->type==Stateful){
const MSStatefulQosAnalyser *stateful_analyser=((const MSStatefulQosAnalyser*)analyser);
stream_mgr->video_stats.network_state=stateful_analyser->network_state;
stream_mgr->video_stats.loss_estim =100*stateful_analyser->network_loss_rate;
stream_mgr->video_stats.congestion_bw_estim =stateful_analyser->congestion_bandwidth;
const MSQosAnalyzer *analyzer=ms_bitrate_controller_get_qos_analyzer(stream_mgr->video_stream->ms.rc);
if (analyzer->type==Stateful){
const MSStatefulQosAnalyzer *stateful_analyzer=((const MSStatefulQosAnalyzer*)analyzer);
stream_mgr->video_stats.network_state=stateful_analyzer->network_state;
stream_mgr->video_stats.loss_estim =100*stateful_analyzer->network_loss_rate;
stream_mgr->video_stats.congestion_bw_estim =stateful_analyzer->congestion_bandwidth;
}
}
......@@ -441,17 +441,17 @@ static void stability_network_detection() {
OrtpEvQueue * evq;
evq=start_adaptive_stream(VideoStreamType, &marielle, &margaux, VP8_PAYLOAD_TYPE, 300000, 0, 0, 500, 0);
iterate_adaptive_stream(marielle, margaux, evq, timeout_receive_rtcp(9), NULL, 0);
CU_ASSERT_EQUAL(marielle->video_stats.network_state, MSQosAnalyserNetworkFine);
CU_ASSERT_EQUAL(marielle->video_stats.network_state, MSQosAnalyzerNetworkFine);
DEINIT();
evq=start_adaptive_stream(VideoStreamType, &marielle, &margaux, VP8_PAYLOAD_TYPE, 300000, 70000, 0, 250,0);
iterate_adaptive_stream(marielle, margaux, evq, timeout_receive_rtcp(9), NULL, 0);
CU_ASSERT_EQUAL(marielle->video_stats.network_state, MSQosAnalyserNetworkCongested);
CU_ASSERT_EQUAL(marielle->video_stats.network_state, MSQosAnalyzerNetworkCongested);
DEINIT();
evq=start_adaptive_stream(VideoStreamType, &marielle, &margaux, VP8_PAYLOAD_TYPE, 300000, 0, 15, 250,0);
iterate_adaptive_stream(marielle, margaux, evq, timeout_receive_rtcp(9), NULL, 0);
CU_ASSERT_EQUAL(marielle->video_stats.network_state, MSQosAnalyserNetworkLossy);
CU_ASSERT_EQUAL(marielle->video_stats.network_state, MSQosAnalyzerNetworkLossy);
DEINIT();
}
......
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