Quality indicator getter methods should take a const reference in argument

parent 29b6bbe3
......@@ -50,22 +50,22 @@ MS2_PUBLIC void ms_quality_indicator_update_local(MSQualityIndicator *qi);
/**
* Return the real time rating of the session. Its value is between 0 (worse) and 5.0 (best).
**/
MS2_PUBLIC float ms_quality_indicator_get_rating(MSQualityIndicator *qi);
MS2_PUBLIC float ms_quality_indicator_get_rating(const MSQualityIndicator *qi);
/**
* Returns the average rating of the session, that is the rating for all the duration of the session.
**/
MS2_PUBLIC float ms_quality_indicator_get_average_rating(MSQualityIndicator *qi);
MS2_PUBLIC float ms_quality_indicator_get_average_rating(const MSQualityIndicator *qi);
/**
* Return the real time rating of the listening quality of the session. Its value is between 0.0 (worse) and 5.0 (best).
**/
MS2_PUBLIC float ms_quality_indicator_get_lq_rating(MSQualityIndicator *qi);
MS2_PUBLIC float ms_quality_indicator_get_lq_rating(const MSQualityIndicator *qi);
/**
* Returns the average rating of the listening quality of the session, that is the rating of the listening quality for all the duration of the session.
**/
MS2_PUBLIC float ms_quality_indicator_get_average_lq_rating(MSQualityIndicator *qi);
MS2_PUBLIC float ms_quality_indicator_get_average_lq_rating(const MSQualityIndicator *qi);
/**
* Returns the local loss rate, as computed internally by ms_quality_indicator_update_local().
......
......@@ -59,11 +59,11 @@ MSQualityIndicator *ms_quality_indicator_new(RtpSession *session){
return qi;
}
float ms_quality_indicator_get_rating(MSQualityIndicator *qi){
float ms_quality_indicator_get_rating(const MSQualityIndicator *qi){
return qi->rating;
}
float ms_quality_indicator_get_lq_rating(MSQualityIndicator *qi) {
float ms_quality_indicator_get_lq_rating(const MSQualityIndicator *qi) {
return qi->lq_rating;
}
......@@ -172,12 +172,12 @@ void ms_quality_indicator_update_local(MSQualityIndicator *qi){
update_global_rating(qi);
}
float ms_quality_indicator_get_average_rating(MSQualityIndicator *qi){
float ms_quality_indicator_get_average_rating(const MSQualityIndicator *qi){
if (qi->count==0) return -1; /*no rating available*/
return (float)(qi->sum_ratings/(double)qi->count);
}
float ms_quality_indicator_get_average_lq_rating(MSQualityIndicator *qi) {
float ms_quality_indicator_get_average_lq_rating(const MSQualityIndicator *qi) {
if (qi->count == 0) return -1; /* No rating available */
return (float)(qi->sum_lq_ratings / (double)qi->count);
}
......
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