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
199108c9
Commit
199108c9
authored
Aug 27, 2012
by
Ghislain MARY
Browse files
Add configuration of adaptive jitter compensation enabling.
parent
cc241d02
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
5 deletions
+67
-5
coreapi/linphonecall.c
coreapi/linphonecall.c
+4
-3
coreapi/linphonecore.c
coreapi/linphonecore.c
+49
-2
coreapi/linphonecore.h
coreapi/linphonecore.h
+12
-0
coreapi/private.h
coreapi/private.h
+2
-0
No files found.
coreapi/linphonecall.c
View file @
199108c9
...
...
@@ -1203,7 +1203,6 @@ static int find_crypto_index_from_tag(const SalSrtpCryptoAlgo crypto[],unsigned
}
static
void
linphone_call_start_audio_stream
(
LinphoneCall
*
call
,
const
char
*
cname
,
bool_t
muted
,
bool_t
send_ringbacktone
,
bool_t
use_arc
){
LinphoneCore
*
lc
=
call
->
core
;
int
jitt_comp
=
lc
->
rtp_conf
.
audio_jitt_comp
;
int
used_pt
=-
1
;
/* look for savp stream first */
const
SalStreamDescription
*
stream
=
sal_media_description_find_stream
(
call
->
resultdesc
,
...
...
@@ -1263,6 +1262,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
if
(
playcard
&&
stream
->
max_rate
>
0
)
ms_snd_card_set_preferred_sample_rate
(
playcard
,
stream
->
max_rate
);
if
(
captcard
&&
stream
->
max_rate
>
0
)
ms_snd_card_set_preferred_sample_rate
(
captcard
,
stream
->
max_rate
);
audio_stream_enable_adaptive_bitrate_control
(
call
->
audiostream
,
use_arc
);
audio_stream_enable_adaptive_jittcomp
(
call
->
audiostream
,
linphone_core_audio_adaptive_jittcomp_enabled
(
lc
));
audio_stream_start_full
(
call
->
audiostream
,
call
->
audio_profile
,
...
...
@@ -1271,7 +1271,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
stream
->
rtcp_addr
[
0
]
!=
'\0'
?
stream
->
rtcp_addr
:
call
->
resultdesc
->
addr
,
linphone_core_rtcp_enabled
(
lc
)
?
(
stream
->
rtcp_port
)
:
0
,
used_pt
,
jitt
_
comp
,
linphone_core_get_audio_
jittcomp
(
lc
)
,
playfile
,
recfile
,
playcard
,
...
...
@@ -1351,6 +1351,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
video_stream_enable_adaptive_bitrate_control
(
call
->
videostream
,
linphone_core_adaptive_rate_control_enabled
(
lc
));
video_stream_enable_adaptive_jittcomp
(
call
->
videostream
,
linphone_core_video_adaptive_jittcomp_enabled
(
lc
));
video_stream_set_sent_video_size
(
call
->
videostream
,
linphone_core_get_preferred_video_size
(
lc
));
video_stream_enable_self_view
(
call
->
videostream
,
lc
->
video_conf
.
selfview
);
if
(
lc
->
video_window_id
!=
0
)
...
...
@@ -1387,7 +1388,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
video_stream_start
(
call
->
videostream
,
call
->
video_profile
,
rtp_addr
,
vstream
->
rtp_port
,
rtcp_addr
,
linphone_core_rtcp_enabled
(
lc
)
?
(
vstream
->
rtcp_port
)
:
0
,
used_pt
,
l
c
->
rtp_conf
.
audi
o_jitt
_
comp
,
cam
);
used_pt
,
l
inphone_core_get_vide
o_jittcomp
(
lc
)
,
cam
);
video_stream_set_rtcp_information
(
call
->
videostream
,
cname
,
LINPHONE_RTCP_SDES_TOOL
);
}
...
...
coreapi/linphonecore.c
View file @
199108c9
...
...
@@ -623,6 +623,7 @@ static void rtp_config_read(LinphoneCore *lc)
int
jitt_comp
;
int
nortp_timeout
;
bool_t
rtp_no_xmit_on_audio_mute
;
bool_t
adaptive_jitt_comp_enabled
;
port
=
lp_config_get_int
(
lc
->
config
,
"rtp"
,
"audio_rtp_port"
,
7078
);
linphone_core_set_audio_port
(
lc
,
port
);
...
...
@@ -635,11 +636,15 @@ static void rtp_config_read(LinphoneCore *lc)
linphone_core_set_audio_jittcomp
(
lc
,
jitt_comp
);
jitt_comp
=
lp_config_get_int
(
lc
->
config
,
"rtp"
,
"video_jitt_comp"
,
60
);
if
(
jitt_comp
==
0
)
jitt_comp
=
60
;
l
c
->
rtp_conf
.
video_jitt
_
comp
=
jitt_comp
;
l
inphone_core_set_
video_jittcomp
(
lc
,
jitt_comp
)
;
nortp_timeout
=
lp_config_get_int
(
lc
->
config
,
"rtp"
,
"nortp_timeout"
,
30
);
linphone_core_set_nortp_timeout
(
lc
,
nortp_timeout
);
rtp_no_xmit_on_audio_mute
=
lp_config_get_int
(
lc
->
config
,
"rtp"
,
"rtp_no_xmit_on_audio_mute"
,
FALSE
);
linphone_core_set_rtp_no_xmit_on_audio_mute
(
lc
,
rtp_no_xmit_on_audio_mute
);
adaptive_jitt_comp_enabled
=
lp_config_get_int
(
lc
->
config
,
"rtp"
,
"audio_adaptive_jitt_comp_enabled"
,
TRUE
);
linphone_core_enable_audio_adaptive_jittcomp
(
lc
,
adaptive_jitt_comp_enabled
);
adaptive_jitt_comp_enabled
=
lp_config_get_int
(
lc
->
config
,
"rtp"
,
"video_adaptive_jitt_comp_enabled"
,
TRUE
);
linphone_core_enable_video_adaptive_jittcomp
(
lc
,
adaptive_jitt_comp_enabled
);
}
static
PayloadType
*
find_payload
(
RtpProfile
*
prof
,
const
char
*
mime_type
,
int
clock_rate
,
const
char
*
recv_fmtp
){
...
...
@@ -1376,8 +1381,18 @@ const MSList * linphone_core_get_friend_list(const LinphoneCore *lc)
return
lc
->
friends
;
}
void
linphone_core_enable_audio_adaptive_jittcomp
(
LinphoneCore
*
lc
,
bool_t
val
)
{
lc
->
rtp_conf
.
audio_adaptive_jitt_comp_enabled
=
val
;
}
bool_t
linphone_core_audio_adaptive_jittcomp_enabled
(
LinphoneCore
*
lc
)
{
return
lc
->
rtp_conf
.
audio_adaptive_jitt_comp_enabled
;
}
/**
* Returns the nominal jitter buffer size in milliseconds.
* Returns the nominal
audio
jitter buffer size in milliseconds.
*
* @ingroup media_parameters
**/
...
...
@@ -1386,6 +1401,26 @@ int linphone_core_get_audio_jittcomp(LinphoneCore *lc)
return
lc
->
rtp_conf
.
audio_jitt_comp
;
}
void
linphone_core_enable_video_adaptive_jittcomp
(
LinphoneCore
*
lc
,
bool_t
val
)
{
lc
->
rtp_conf
.
video_adaptive_jitt_comp_enabled
=
val
;
}
bool_t
linphone_core_video_adaptive_jittcomp_enabled
(
LinphoneCore
*
lc
)
{
return
lc
->
rtp_conf
.
video_adaptive_jitt_comp_enabled
;
}
/**
* Returns the nominal video jitter buffer size in milliseconds.
*
* @ingroup media_parameters
**/
int
linphone_core_get_video_jittcomp
(
LinphoneCore
*
lc
)
{
return
lc
->
rtp_conf
.
video_jitt_comp
;
}
/**
* Returns the UDP port used for audio streaming.
*
...
...
@@ -1433,6 +1468,16 @@ void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value)
lc
->
rtp_conf
.
audio_jitt_comp
=
value
;
}
/**
* Sets the nominal video jitter buffer size in milliseconds.
*
* @ingroup media_parameters
**/
void
linphone_core_set_video_jittcomp
(
LinphoneCore
*
lc
,
int
value
)
{
lc
->
rtp_conf
.
video_jitt_comp
=
value
;
}
void
linphone_core_set_rtp_no_xmit_on_audio_mute
(
LinphoneCore
*
lc
,
bool_t
rtp_no_xmit_on_audio_mute
){
lc
->
rtp_conf
.
rtp_no_xmit_on_audio_mute
=
rtp_no_xmit_on_audio_mute
;
}
...
...
@@ -4474,6 +4519,8 @@ void rtp_config_uninit(LinphoneCore *lc)
lp_config_set_int
(
lc
->
config
,
"rtp"
,
"audio_jitt_comp"
,
config
->
audio_jitt_comp
);
lp_config_set_int
(
lc
->
config
,
"rtp"
,
"video_jitt_comp"
,
config
->
video_jitt_comp
);
lp_config_set_int
(
lc
->
config
,
"rtp"
,
"nortp_timeout"
,
config
->
nortp_timeout
);
lp_config_set_int
(
lc
->
config
,
"rtp"
,
"audio_jitt_comp_enabled"
,
config
->
audio_adaptive_jitt_comp_enabled
);
lp_config_set_int
(
lc
->
config
,
"rtp"
,
"video_jitt_comp_enabled"
,
config
->
video_adaptive_jitt_comp_enabled
);
}
void
sound_config_uninit
(
LinphoneCore
*
lc
)
...
...
coreapi/linphonecore.h
View file @
199108c9
...
...
@@ -903,10 +903,22 @@ void linphone_core_abort_authentication(LinphoneCore *lc, LinphoneAuthInfo *inf
void
linphone_core_clear_all_auth_info
(
LinphoneCore
*
lc
);
void
linphone_core_enable_audio_adaptive_jittcomp
(
LinphoneCore
*
lc
,
bool_t
enable
);
bool_t
linphone_core_audio_adaptive_jittcomp_enabled
(
LinphoneCore
*
lc
);
int
linphone_core_get_audio_jittcomp
(
LinphoneCore
*
lc
);
void
linphone_core_set_audio_jittcomp
(
LinphoneCore
*
lc
,
int
value
);
void
linphone_core_enable_video_adaptive_jittcomp
(
LinphoneCore
*
lc
,
bool_t
enable
);
bool_t
linphone_core_video_adaptive_jittcomp_enabled
(
LinphoneCore
*
lc
);
int
linphone_core_get_video_jittcomp
(
LinphoneCore
*
lc
);
void
linphone_core_set_video_jittcomp
(
LinphoneCore
*
lc
,
int
value
);
int
linphone_core_get_audio_port
(
const
LinphoneCore
*
lc
);
int
linphone_core_get_video_port
(
const
LinphoneCore
*
lc
);
...
...
coreapi/private.h
View file @
199108c9
...
...
@@ -369,6 +369,8 @@ typedef struct rtp_config
int
nortp_timeout
;
bool_t
rtp_no_xmit_on_audio_mute
;
/* stop rtp xmit when audio muted */
bool_t
audio_adaptive_jitt_comp_enabled
;
bool_t
video_adaptive_jitt_comp_enabled
;
}
rtp_config_t
;
...
...
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