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
dc2d250d
Commit
dc2d250d
authored
Dec 10, 2014
by
Guillaume BIENKOWSKI
Browse files
Perform sound card usage check when a call is dismissed or when a call transitions to pausing state
parent
dc78b3fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
coreapi/linphonecall.c
View file @
dc2d250d
...
...
@@ -1018,6 +1018,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
if
(
cstate
==
LinphoneCallReleased
){
linphone_call_set_released
(
call
);
}
linphone_core_soundcard_hint_check
(
lc
);
}
}
...
...
coreapi/linphonecore.c
View file @
dc2d250d
...
...
@@ -6415,11 +6415,32 @@ bool_t linphone_core_can_we_add_call(LinphoneCore *lc)
static
void
notify_soundcard_usage
(
LinphoneCore
*
lc
,
bool_t
used
){
MSSndCard
*
card
=
lc
->
sound_conf
.
capt_sndcard
;
if
(
card
&&
ms_snd_card_get_capabilities
(
card
)
&
MS_SND_CARD_CAP_IS_SLOW
){
ms_message
(
"Notifying soundcard that we don't need it anymore for calls."
);
ms_snd_card_set_usage_hint
(
card
,
used
);
}
}
void
linphone_core_soundcard_hint_check
(
LinphoneCore
*
lc
){
MSList
*
the_calls
=
lc
->
calls
;
LinphoneCall
*
call
=
NULL
;
bool_t
remaining_paused
=
FALSE
;
/* check if the remaining calls are paused */
while
(
the_calls
){
call
=
the_calls
->
data
;
if
(
call
->
state
==
LinphoneCallPausing
||
call
->
state
==
LinphoneCallPaused
){
remaining_paused
=
TRUE
;
break
;
}
the_calls
=
the_calls
->
next
;
}
/* if no more calls or all calls are paused, we can free the soundcard */
if
(
(
lc
->
calls
==
NULL
||
remaining_paused
)
&&
!
lc
->
use_files
){
ms_message
(
"Notifying soundcard that we don't need it anymore for calls."
);
notify_soundcard_usage
(
lc
,
FALSE
);
}
}
int
linphone_core_add_call
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
)
{
if
(
linphone_core_can_we_add_call
(
lc
)){
...
...
@@ -6446,7 +6467,9 @@ int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call)
return
-
1
;
}
lc
->
calls
=
the_calls
;
if
(
lc
->
calls
==
NULL
)
notify_soundcard_usage
(
lc
,
FALSE
);
linphone_core_soundcard_hint_check
(
lc
);
return
0
;
}
...
...
coreapi/private.h
View file @
dc2d250d
...
...
@@ -374,6 +374,8 @@ void linphone_notify_parse_presence(SalOp *op, const char *content_type, const c
void
linphone_notify_convert_presence_to_xml
(
SalOp
*
op
,
SalPresenceModel
*
presence
,
const
char
*
contact
,
char
**
content
);
void
linphone_notify_recv
(
LinphoneCore
*
lc
,
SalOp
*
op
,
SalSubscribeStatus
ss
,
SalPresenceModel
*
model
);
void
linphone_proxy_config_process_authentication_failure
(
LinphoneCore
*
lc
,
SalOp
*
op
);
void
linphone_core_soundcard_hint_check
(
LinphoneCore
*
lc
);
void
linphone_subscription_answered
(
LinphoneCore
*
lc
,
SalOp
*
op
);
void
linphone_subscription_closed
(
LinphoneCore
*
lc
,
SalOp
*
op
);
...
...
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