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
ac6a71fd
Commit
ac6a71fd
authored
May 07, 2014
by
Gautier Pelloux-Prayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leak and RTCP intervals
parent
e1975cf6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
src/voip/videostream.c
src/voip/videostream.c
+2
-2
tester/mediastreamer2_audio_stream_tester.c
tester/mediastreamer2_audio_stream_tester.c
+4
-3
tester/mediastreamer2_video_stream_tester.c
tester/mediastreamer2_video_stream_tester.c
+9
-11
No files found.
src/voip/videostream.c
View file @
ac6a71fd
...
...
@@ -110,8 +110,8 @@ static void video_stream_process_rtcp(MediaStream *media_stream, mblk_t *m){
i
=
report_block_get_interarrival_jitter
(
rb
);
flost
=
(
float
)(
100
.
0
*
report_block_get_fraction_lost
(
rb
)
/
256
.
0
);
ms_message
(
"video_stream_process_rtcp[%p]: interarrival jitter=%u , lost packets percentage since last report=%f, round trip time=%f seconds"
,
stream
,
i
,
flost
,
rt
);
if
(
stream
->
ms
.
rc
)
ms_bitrate_controller_process_rtcp
(
stream
->
ms
.
rc
,
m
);
if
(
stream
->
ms
.
rc
)
ms_bitrate_controller_process_rtcp
(
stream
->
ms
.
rc
,
m
);
if
(
stream
->
ms
.
qi
)
ms_quality_indicator_update_from_feedback
(
stream
->
ms
.
qi
,
m
);
}
else
if
(
rtcp_is_PSFB
(
m
))
{
if
(
rtcp_PSFB_get_type
(
m
)
==
RTCP_PSFB_FIR
)
{
/* Special case for FIR where the packet sender ssrc must be equal to 0. */
...
...
tester/mediastreamer2_audio_stream_tester.c
View file @
ac6a71fd
...
...
@@ -56,6 +56,7 @@ static int tester_init(void) {
}
static
int
tester_cleanup
(
void
)
{
ortp_exit
();
ms_exit
();
rtp_profile_clear_all
(
&
rtp_profile
);
return
0
;
...
...
@@ -212,7 +213,7 @@ static float adaptive_audio_stream(int codec_payload, int initial_bitrate,int ta
float
bw_usage_ratio
;
// this variable should not be changed, since algorithm results rely on this value
// (the bigger it is, the more accurate is bandwidth estimation)
int
rtcp_interval
=
10
00
;
int
rtcp_interval
=
25
00
;
float
marielle_send_bw
;
media_stream_enable_adaptive_bitrate_control
(
&
marielle
->
stream
->
ms
,
TRUE
);
...
...
@@ -261,7 +262,7 @@ static void adaptive_opus_audio_stream() {
}
}
static
void
adaptive_spee
k
16_audio_stream
()
{
static
void
adaptive_spee
x
16_audio_stream
()
{
bool_t
supported
=
ms_filter_codec_supported
(
"speex"
);
if
(
supported
)
{
// at 16KHz -> 20 kb/s
...
...
@@ -347,7 +348,7 @@ static void audio_stream_dtmf(int codec_payload, int initial_bitrate,int target_
static
test_t
tests
[]
=
{
{
"Basic audio stream"
,
basic_audio_stream
},
{
"Adaptive audio stream [opus]"
,
adaptive_opus_audio_stream
},
{
"Adaptive audio stream [speex]"
,
adaptive_spee
k
16_audio_stream
},
{
"Adaptive audio stream [speex]"
,
adaptive_spee
x
16_audio_stream
},
{
"Adaptive audio stream [pcma]"
,
adaptive_pcma_audio_stream
},
{
"Lossy network"
,
lossy_network_speex_audio_stream
},
};
...
...
tester/mediastreamer2_video_stream_tester.c
View file @
ac6a71fd
...
...
@@ -54,6 +54,7 @@ static int tester_init(void) {
}
static
int
tester_cleanup
(
void
)
{
ortp_exit
();
ms_exit
();
rtp_profile_clear_all
(
&
rtp_profile
);
return
0
;
...
...
@@ -100,7 +101,7 @@ static void video_manager_start( video_stream_manager_t * mgr
,
"127.0.0.1"
,
remote_port
+
1
,
payload_type
,
55
0
,
6
0
,
cam
);
CU_ASSERT_EQUAL
(
result
,
0
);
}
...
...
@@ -110,10 +111,8 @@ static void video_manager_start( video_stream_manager_t * mgr
#define CU_ASSERT_IN_RANGE(value, inf, sup) CU_ASSERT_TRUE(value >= inf); CU_ASSERT_TRUE(value <= sup)
static
float
adaptive_video_stream
(
int
payload
,
int
initial_bitrate
,
int
target_bw
,
float
loss_rate
,
int
max_recv_rtcp_packet
)
{
const
MSList
*
webcams
=
ms_web_cam_manager_get_list
(
ms_web_cam_manager_get
());
MSWebCam
*
marielle_webcam
=
(
ms_list_size
(
webcams
)
>
0
)
?
(
MSWebCam
*
)
webcams
->
data
:
NULL
;
// MSWebCam * margaux_webcam = (ms_list_size(webcams) > 1) ? (MSWebCam *) webcams->next->data : NULL;
MSWebCam
*
marielle_webcam
=
ms_web_cam_manager_get_default_cam
(
ms_web_cam_manager_get
());
MSWebCam
*
margaux_webcam
=
ms_web_cam_manager_get_cam
(
ms_web_cam_manager_get
(),
"StaticImage: Static picture"
);
video_stream_manager_t
*
marielle
=
video_stream_manager_new
();
video_stream_manager_t
*
margaux
=
video_stream_manager_new
();
...
...
@@ -121,11 +120,11 @@ static float adaptive_video_stream(int payload, int initial_bitrate,int target_b
params
.
enabled
=
TRUE
;
params
.
loss_rate
=
loss_rate
;
params
.
max_bandwidth
=
target_bw
;
params
.
max_buffer_size
=
initial_bitrate
;
//
params.max_buffer_size=initial_bitrate;
float
bw_usage_ratio
=
0
.;
// this variable should not be changed, since algorithm results rely on this value
// (the bigger it is, the more accurate is bandwidth estimation)
int
rtcp_interval
=
10
00
;
int
rtcp_interval
=
25
00
;
float
marielle_send_bw
;
media_stream_enable_adaptive_bitrate_control
(
&
marielle
->
stream
->
ms
,
TRUE
);
...
...
@@ -133,8 +132,7 @@ static float adaptive_video_stream(int payload, int initial_bitrate,int target_b
video_manager_start
(
marielle
,
payload
,
margaux
->
local_rtp
,
initial_bitrate
,
marielle_webcam
);
video_manager_start
(
margaux
,
payload
,
marielle
->
local_rtp
,
-
1
,
NULL
);
// video_manager_start(margaux, payload, marielle->local_rtp, -1, margaux_webcam);
video_manager_start
(
margaux
,
payload
,
marielle
->
local_rtp
,
-
1
,
margaux_webcam
);
rtp_session_enable_network_simulation
(
margaux
->
stream
->
ms
.
sessions
.
rtp_session
,
&
params
);
rtp_session_set_rtcp_report_interval
(
margaux
->
stream
->
ms
.
sessions
.
rtp_session
,
rtcp_interval
);
...
...
@@ -156,8 +154,8 @@ static void lossy_network() {
float
bw_usage
;
int
loss_rate
=
getenv
(
"GPP_LOSS"
)
?
atoi
(
getenv
(
"GPP_LOSS"
))
:
0
;
int
max_bw
=
getenv
(
"GPP_MAXBW"
)
?
atoi
(
getenv
(
"GPP_MAXBW"
))
*
1000
:
0
;
printf
(
"
\n
loss_rate=%d(GPP_LOSS) max_bw=%d(GPP_MAXBW)
\n
"
,
loss_rate
,
max_bw
);
bw_usage
=
adaptive_video_stream
(
H264
_PAYLOAD_TYPE
,
10
00000
,
max_bw
,
loss_rate
,
20
);
//
printf("\nloss_rate=%d(GPP_LOSS) max_bw=%d(GPP_MAXBW)\n", loss_rate, max_bw);
bw_usage
=
adaptive_video_stream
(
VP8
_PAYLOAD_TYPE
,
3
00000
,
max_bw
,
loss_rate
,
20
);
CU_ASSERT_IN_RANGE
(
bw_usage
,
.
9
f
,
1
.
f
);
}
}
...
...
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