Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
mediastreamer2
Commits
ca73e626
Commit
ca73e626
authored
May 28, 2014
by
Gautier Pelloux-Prayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
free qos stateful alloced objects on destroy
parent
8b609943
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
src/voip/qosanalyzer.c
src/voip/qosanalyzer.c
+13
-3
tester/mediastreamer2_adaptive_tester.c
tester/mediastreamer2_adaptive_tester.c
+4
-4
No files found.
src/voip/qosanalyzer.c
View file @
ca73e626
...
...
@@ -227,8 +227,12 @@ const char *ms_qos_analyser_network_state_name(MSQosAnalyserNetworkState state){
return
"bad state type"
;
}
static
int
earlier_than
(
const
rtcpstatspoint_t
*
p
,
const
time_t
*
now
){
return
p
->
timestamp
>
*
now
;
static
int
earlier_than
(
rtcpstatspoint_t
*
p
,
const
time_t
*
now
){
if
(
p
->
timestamp
<
*
now
){
ms_free
(
p
);
return
FALSE
;
}
return
TRUE
;
}
static
int
sort_points
(
const
rtcpstatspoint_t
*
p1
,
const
rtcpstatspoint_t
*
p2
){
return
p1
->
bandwidth
>
p2
->
bandwidth
;
...
...
@@ -541,11 +545,17 @@ static void stateful_analyser_update(MSQosAnalyser *objbase){
}
}
static
void
stateful_analyser_uninit
(
MSQosAnalyser
*
objbase
){
MSStatefulQosAnalyser
*
obj
=
(
MSStatefulQosAnalyser
*
)
objbase
;
ms_list_for_each
(
obj
->
rtcpstatspoint
,
ms_free
);
}
static
MSQosAnalyserDesc
stateful_analyser_desc
=
{
stateful_analyser_process_rtcp
,
stateful_analyser_suggest_action
,
stateful_analyser_has_improved
,
stateful_analyser_update
stateful_analyser_update
,
stateful_analyser_uninit
,
};
MSQosAnalyser
*
ms_stateful_qos_analyser_new
(
RtpSession
*
session
){
...
...
tester/mediastreamer2_adaptive_tester.c
View file @
ca73e626
...
...
@@ -462,7 +462,7 @@ static void adaptive_vp8() {
OrtpEvQueue
*
evq
;
evq
=
start_adaptive_stream
(
VideoStreamType
,
&
marielle
,
&
margaux
,
VP8_PAYLOAD_TYPE
,
300000
,
0
,
25
,
50
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
3
),
NULL
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
8
),
NULL
,
0
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
loss_estim
,
20
,
30
);
CU_ASSERT_TRUE
(
marielle
->
video_stats
.
congestion_bw_estim
>
200
);
DEINIT
();
...
...
@@ -470,19 +470,19 @@ static void adaptive_vp8() {
/*very low bandwidth cause a lot of packets to be dropped since congestion is
always present even if we are below the limit due to encoding variance*/
evq
=
start_adaptive_stream
(
VideoStreamType
,
&
marielle
,
&
margaux
,
VP8_PAYLOAD_TYPE
,
300000
,
40000
,
0
,
50
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
3
),
NULL
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
8
),
NULL
,
0
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
loss_estim
,
0
,
15
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
congestion_bw_estim
,
20
,
65
);
DEINIT
();
evq
=
start_adaptive_stream
(
VideoStreamType
,
&
marielle
,
&
margaux
,
VP8_PAYLOAD_TYPE
,
300000
,
70000
,
0
,
50
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
3
),
NULL
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
8
),
NULL
,
0
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
loss_estim
,
0
,
10
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
congestion_bw_estim
,
50
,
95
);
DEINIT
();
evq
=
start_adaptive_stream
(
VideoStreamType
,
&
marielle
,
&
margaux
,
VP8_PAYLOAD_TYPE
,
300000
,
100000
,
15
,
50
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
3
),
NULL
,
0
);
iterate_adaptive_stream
(
marielle
,
margaux
,
evq
,
timeout_receive_rtcp
(
1
8
),
NULL
,
0
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
loss_estim
,
10
,
20
);
CU_ASSERT_IN_RANGE
(
marielle
->
video_stats
.
congestion_bw_estim
,
80
,
125
);
DEINIT
();
...
...
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