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
8b3112cc
Commit
8b3112cc
authored
Dec 03, 2010
by
Guillaume Beraudo
Browse files
Export video codecs list through JNI.
parent
340f7238
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
6 deletions
+43
-6
coreapi/linphonecore.c
coreapi/linphonecore.c
+9
-1
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+30
-5
java/common/org/linphone/core/LinphoneCore.java
java/common/org/linphone/core/LinphoneCore.java
+3
-0
java/common/org/linphone/core/PayloadType.java
java/common/org/linphone/core/PayloadType.java
+1
-0
No files found.
coreapi/linphonecore.c
View file @
8b3112cc
...
...
@@ -3961,13 +3961,21 @@ static PayloadType* find_payload_type_from_list(const char* type, int rate,const
const
MSList
*
elem
;
for
(
elem
=
from
;
elem
!=
NULL
;
elem
=
elem
->
next
){
PayloadType
*
pt
=
(
PayloadType
*
)
elem
->
data
;
if
((
strcmp
((
char
*
)
type
,
payload_type_get_mime
(
pt
))
==
0
)
&&
rate
==
pt
->
clock_rate
)
{
if
((
strcmp
((
char
*
)
type
,
payload_type_get_mime
(
pt
))
==
0
)
&&
(
rate
==
-
1
||
rate
==
pt
->
clock_rate
)
)
{
return
pt
;
}
}
return
NULL
;
}
static
void
printCodecs
(
const
MSList
*
from
)
{
const
MSList
*
elem
;
for
(
elem
=
from
;
elem
!=
NULL
;
elem
=
elem
->
next
){
PayloadType
*
pt
=
(
PayloadType
*
)
elem
->
data
;
ms_message
(
payload_type_get_mime
(
pt
));
}
}
/**
* Get payload type from mime type and clock rate
* @ingroup media_parameters
...
...
coreapi/linphonecore_jni.cc
View file @
8b3112cc
...
...
@@ -509,6 +509,24 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv*
env
->
ReleaseStringUTFChars
(
jmime
,
mime
);
return
result
;
}
extern
"C"
jlongArray
Java_org_linphone_core_LinphoneCoreImpl_listVideoPayloadTypes
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
lc
)
{
const
MSList
*
codecs
=
linphone_core_get_video_codecs
((
LinphoneCore
*
)
lc
);
int
codecsCount
=
ms_list_size
(
codecs
);
jlongArray
jCodecs
=
env
->
NewLongArray
(
codecsCount
);
jlong
*
jInternalArray
=
env
->
GetLongArrayElements
(
jCodecs
,
NULL
);
for
(
int
i
=
0
;
i
<
codecsCount
;
i
++
)
{
jInternalArray
[
i
]
=
(
unsigned
long
)
(
codecs
->
data
);
codecs
=
codecs
->
next
;
}
env
->
ReleaseLongArrayElements
(
jCodecs
,
jInternalArray
,
0
);
return
jCodecs
;
}
extern
"C"
jlong
Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
lc
...
...
@@ -831,12 +849,9 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCallLogImpl_isIncoming(JNIEnv
return
((
LinphoneCallLog
*
)
ptr
)
->
dir
==
LinphoneCallIncoming
?
JNI_TRUE
:
JNI_FALSE
;
}
extern
"C"
jstring
Java_org_linphone_core_PayloadTypeImpl_toString
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
extern
"C"
jstring
Java_org_linphone_core_PayloadTypeImpl_toString
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
PayloadType
*
pt
=
(
PayloadType
*
)
ptr
;
char
*
value
=
ms_strdup_printf
(
"[%s] clock [%
s
], bitrate [%
s
]"
char
*
value
=
ms_strdup_printf
(
"[%s] clock [%
i
], bitrate [%
i
]"
,
payload_type_get_mime
(
pt
)
,
payload_type_get_rate
(
pt
)
,
payload_type_get_bitrate
(
pt
));
...
...
@@ -844,6 +859,16 @@ extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env
ms_free
(
value
);
return
jvalue
;
}
extern
"C"
jstring
Java_org_linphone_core_PayloadTypeImpl_getMime
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
PayloadType
*
pt
=
(
PayloadType
*
)
ptr
;
jstring
jvalue
=
env
->
NewStringUTF
(
payload_type_get_mime
(
pt
));
return
jvalue
;
}
extern
"C"
jint
Java_org_linphone_core_PayloadTypeImpl_getRate
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
PayloadType
*
pt
=
(
PayloadType
*
)
ptr
;
return
payload_type_get_rate
(
pt
);
}
//LinphoneCall
extern
"C"
void
Java_org_linphone_core_LinphoneCallImpl_ref
(
JNIEnv
*
env
,
jobject
thiz
...
...
java/common/org/linphone/core/LinphoneCore.java
View file @
8b3112cc
...
...
@@ -485,4 +485,7 @@ public interface LinphoneCore {
public
void
setPreferredVideoSize
(
VideoSize
vSize
);
public
VideoSize
getPreferredVideoSize
();
public
PayloadType
[]
listVideoCodecs
();
}
java/common/org/linphone/core/PayloadType.java
View file @
8b3112cc
...
...
@@ -20,4 +20,5 @@ package org.linphone.core;
public
interface
PayloadType
{
String
getMime
();
}
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