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
6996864b
Commit
6996864b
authored
Aug 28, 2012
by
Ghislain MARY
Browse files
Change API of linphone_core_find_payload_type() to take the number of channels into account.
parent
b064c7a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
coreapi/linphonecore.c
coreapi/linphonecore.c
+7
-5
coreapi/linphonecore.h
coreapi/linphonecore.h
+1
-1
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+3
-2
No files found.
coreapi/linphonecore.c
View file @
6996864b
...
...
@@ -4806,11 +4806,13 @@ const char *linphone_core_get_remote_ringback_tone(const LinphoneCore *lc){
return
lc
->
sound_conf
.
ringback_tone
;
}
static
PayloadType
*
find_payload_type_from_list
(
const
char
*
type
,
int
rate
,
const
MSList
*
from
)
{
static
PayloadType
*
find_payload_type_from_list
(
const
char
*
type
,
int
rate
,
int
channels
,
const
MSList
*
from
)
{
const
MSList
*
elem
;
for
(
elem
=
from
;
elem
!=
NULL
;
elem
=
elem
->
next
){
PayloadType
*
pt
=
(
PayloadType
*
)
elem
->
data
;
if
((
strcasecmp
((
char
*
)
type
,
payload_type_get_mime
(
pt
))
==
0
)
&&
(
rate
==
-
1
||
rate
==
pt
->
clock_rate
))
{
if
((
strcasecmp
((
char
*
)
type
,
payload_type_get_mime
(
pt
))
==
0
)
&&
(
rate
==
-
1
||
rate
==
pt
->
clock_rate
)
&&
(
channels
==
0
||
channels
==
pt
->
channels
))
{
return
pt
;
}
}
...
...
@@ -4823,12 +4825,12 @@ static PayloadType* find_payload_type_from_list(const char* type, int rate,const
* This function searches in audio and video codecs for the given payload type name and clockrate.
* Returns NULL if not found.
*/
PayloadType
*
linphone_core_find_payload_type
(
LinphoneCore
*
lc
,
const
char
*
type
,
int
rate
)
{
PayloadType
*
result
=
find_payload_type_from_list
(
type
,
rate
,
linphone_core_get_audio_codecs
(
lc
));
PayloadType
*
linphone_core_find_payload_type
(
LinphoneCore
*
lc
,
const
char
*
type
,
int
rate
,
int
channels
)
{
PayloadType
*
result
=
find_payload_type_from_list
(
type
,
rate
,
channels
,
linphone_core_get_audio_codecs
(
lc
));
if
(
result
)
{
return
result
;
}
else
{
result
=
find_payload_type_from_list
(
type
,
rate
,
linphone_core_get_video_codecs
(
lc
));
result
=
find_payload_type_from_list
(
type
,
rate
,
0
,
linphone_core_get_video_codecs
(
lc
));
if
(
result
)
{
return
result
;
}
...
...
coreapi/linphonecore.h
View file @
6996864b
...
...
@@ -869,7 +869,7 @@ bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, const PayloadType *p
int
linphone_core_enable_payload_type
(
LinphoneCore
*
lc
,
PayloadType
*
pt
,
bool_t
enable
);
PayloadType
*
linphone_core_find_payload_type
(
LinphoneCore
*
lc
,
const
char
*
type
,
int
rate
)
;
PayloadType
*
linphone_core_find_payload_type
(
LinphoneCore
*
lc
,
const
char
*
type
,
int
rate
,
int
channels
)
;
int
linphone_core_get_payload_type_number
(
LinphoneCore
*
lc
,
const
PayloadType
*
pt
);
...
...
coreapi/linphonecore_jni.cc
View file @
6996864b
...
...
@@ -684,9 +684,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv*
,
jobject
thiz
,
jlong
lc
,
jstring
jmime
,
jint
rate
)
{
,
jint
rate
,
jint
channels
)
{
const
char
*
mime
=
env
->
GetStringUTFChars
(
jmime
,
NULL
);
jlong
result
=
(
jlong
)
linphone_core_find_payload_type
((
LinphoneCore
*
)
lc
,
mime
,
rate
);
jlong
result
=
(
jlong
)
linphone_core_find_payload_type
((
LinphoneCore
*
)
lc
,
mime
,
rate
,
channels
);
env
->
ReleaseStringUTFChars
(
jmime
,
mime
);
return
result
;
}
...
...
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