Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
dbf3a7de
Commit
dbf3a7de
authored
Oct 20, 2015
by
Sylvain Berfini
🎩
Browse files
Fix future issue in quality reporting if streams index != 0,1,2
parent
02ef798b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
coreapi/quality_reporting.c
coreapi/quality_reporting.c
+28
-16
No files found.
coreapi/quality_reporting.c
View file @
dbf3a7de
...
@@ -160,6 +160,9 @@ static bool_t media_report_enabled(LinphoneCall * call, int stats_type){
...
@@ -160,6 +160,9 @@ static bool_t media_report_enabled(LinphoneCall * call, int stats_type){
if
(
stats_type
==
LINPHONE_CALL_STATS_VIDEO
&&
!
linphone_call_params_video_enabled
(
linphone_call_get_current_params
(
call
)))
if
(
stats_type
==
LINPHONE_CALL_STATS_VIDEO
&&
!
linphone_call_params_video_enabled
(
linphone_call_get_current_params
(
call
)))
return
FALSE
;
return
FALSE
;
if
(
stats_type
==
LINPHONE_CALL_STATS_TEXT
&&
!
linphone_call_params_realtime_text_enabled
(
linphone_call_get_current_params
(
call
)))
return
FALSE
;
return
(
call
->
log
->
reporting
.
reports
[
stats_type
]
!=
NULL
);
return
(
call
->
log
->
reporting
.
reports
[
stats_type
]
!=
NULL
);
}
}
...
@@ -344,11 +347,18 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
...
@@ -344,11 +347,18 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
linphone_content_set_buffer
(
content
,
buffer
,
strlen
(
buffer
));
linphone_content_set_buffer
(
content
,
buffer
,
strlen
(
buffer
));
ms_free
(
buffer
);
ms_free
(
buffer
);
if
(
call
->
log
->
reporting
.
on_report_sent
!=
NULL
){
if
(
call
->
log
->
reporting
.
on_report_sent
!=
NULL
)
{
call
->
log
->
reporting
.
on_report_sent
(
SalStreamType
type
=
SalOther
;
call
,
if
(
report
==
call
->
log
->
reporting
.
reports
[
call
->
main_audio_stream_index
])
{
(
report
==
call
->
log
->
reporting
.
reports
[
0
])
?
LINPHONE_CALL_STATS_AUDIO
:
LINPHONE_CALL_STATS_VIDEO
,
type
=
SalAudio
;
content
);
}
else
if
(
report
==
call
->
log
->
reporting
.
reports
[
call
->
main_video_stream_index
])
{
type
=
SalVideo
;
}
else
if
(
report
==
call
->
log
->
reporting
.
reports
[
call
->
main_text_stream_index
])
{
type
=
SalText
;
}
call
->
log
->
reporting
.
on_report_sent
(
call
,
type
,
content
);
}
}
...
@@ -401,7 +411,7 @@ static const SalStreamDescription * get_media_stream_for_desc(const SalMediaDesc
...
@@ -401,7 +411,7 @@ static const SalStreamDescription * get_media_stream_for_desc(const SalMediaDesc
}
}
static
void
update_ip
(
LinphoneCall
*
call
,
int
stats_type
)
{
static
void
update_ip
(
LinphoneCall
*
call
,
int
stats_type
)
{
SalStreamType
sal_stream_type
=
(
stats_type
==
LINPHONE_CALL_STATS_AUDIO
)
?
SalAudio
:
SalVideo
;
SalStreamType
sal_stream_type
=
(
stats_type
==
LINPHONE_CALL_STATS_AUDIO
)
?
SalAudio
:
(
stats_type
==
LINPHONE_CALL_STATS_VIDEO
)
?
SalVideo
:
SalText
;
const
SalStreamDescription
*
local_desc
=
get_media_stream_for_desc
(
call
->
localdesc
,
sal_stream_type
);
const
SalStreamDescription
*
local_desc
=
get_media_stream_for_desc
(
call
->
localdesc
,
sal_stream_type
);
const
SalStreamDescription
*
remote_desc
=
get_media_stream_for_desc
(
sal_call_get_remote_media_description
(
call
->
op
),
sal_stream_type
);
const
SalStreamDescription
*
remote_desc
=
get_media_stream_for_desc
(
sal_call_get_remote_media_description
(
call
->
op
),
sal_stream_type
);
...
@@ -644,11 +654,12 @@ void linphone_reporting_on_rtcp_update(LinphoneCall *call, SalStreamType stats_t
...
@@ -644,11 +654,12 @@ void linphone_reporting_on_rtcp_update(LinphoneCall *call, SalStreamType stats_t
static
int
publish_report
(
LinphoneCall
*
call
,
const
char
*
event_type
){
static
int
publish_report
(
LinphoneCall
*
call
,
const
char
*
event_type
){
int
ret
=
0
;
int
ret
=
0
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
2
;
i
++
){
for
(
i
=
0
;
i
<
SAL_MEDIA_DESCRIPTION_MAX_STREAMS
;
i
++
){
if
(
media_report_enabled
(
call
,
i
)){
int
stream_index
=
i
==
call
->
main_audio_stream_index
?
LINPHONE_CALL_STATS_AUDIO
:
call
->
main_video_stream_index
?
LINPHONE_CALL_STATS_VIDEO
:
LINPHONE_CALL_STATS_TEXT
;
if
(
media_report_enabled
(
call
,
stream_index
))
{
int
sndret
;
int
sndret
;
linphone_reporting_update_media_info
(
call
,
i
);
linphone_reporting_update_media_info
(
call
,
stream_index
);
sndret
=
send_report
(
call
,
call
->
log
->
reporting
.
reports
[
i
],
event_type
);
sndret
=
send_report
(
call
,
call
->
log
->
reporting
.
reports
[
stream_index
],
event_type
);
if
(
sndret
>
0
){
if
(
sndret
>
0
){
ret
+=
10
+
(
i
+
1
)
*
sndret
;
ret
+=
10
+
(
i
+
1
)
*
sndret
;
}
}
...
@@ -689,12 +700,13 @@ void linphone_reporting_call_state_updated(LinphoneCall *call){
...
@@ -689,12 +700,13 @@ void linphone_reporting_call_state_updated(LinphoneCall *call){
switch
(
state
){
switch
(
state
){
case
LinphoneCallStreamsRunning
:{
case
LinphoneCallStreamsRunning
:{
int
i
=
0
;
int
i
=
0
;
MediaStream
*
streams
[
2
]
=
{(
MediaStream
*
)
call
->
audiostream
,
(
MediaStream
*
)
call
->
videostream
};
MediaStream
*
streams
[
3
]
=
{
(
MediaStream
*
)
call
->
audiostream
,
(
MediaStream
*
)
call
->
videostream
,
(
MediaStream
*
)
call
->
textstream
};
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
SAL_MEDIA_DESCRIPTION_MAX_STREAMS
;
i
++
)
{
bool_t
enabled
=
media_report_enabled
(
call
,
i
);
int
stream_index
=
i
==
call
->
main_audio_stream_index
?
LINPHONE_CALL_STATS_AUDIO
:
call
->
main_video_stream_index
?
LINPHONE_CALL_STATS_VIDEO
:
LINPHONE_CALL_STATS_TEXT
;
if
(
enabled
&&
set_on_action_suggested_cb
(
streams
[
i
],
qos_analyzer_on_action_suggested
,
call
->
log
->
reporting
.
reports
[
i
]))
{
bool_t
enabled
=
media_report_enabled
(
call
,
stream_index
);
call
->
log
->
reporting
.
reports
[
i
]
->
call
=
call
;
if
(
enabled
&&
set_on_action_suggested_cb
(
streams
[
stream_index
],
qos_analyzer_on_action_suggested
,
call
->
log
->
reporting
.
reports
[
stream_index
]))
{
STR_REASSIGN
(
call
->
log
->
reporting
.
reports
[
i
]
->
qos_analyzer
.
name
,
ms_strdup
(
ms_qos_analyzer_get_name
(
ms_bitrate_controller_get_qos_analyzer
(
streams
[
i
]
->
rc
))));
call
->
log
->
reporting
.
reports
[
stream_index
]
->
call
=
call
;
STR_REASSIGN
(
call
->
log
->
reporting
.
reports
[
stream_index
]
->
qos_analyzer
.
name
,
ms_strdup
(
ms_qos_analyzer_get_name
(
ms_bitrate_controller_get_qos_analyzer
(
streams
[
stream_index
]
->
rc
))));
}
}
}
}
linphone_reporting_update_ip
(
call
);
linphone_reporting_update_ip
(
call
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment