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
2d30e846
Commit
2d30e846
authored
Feb 23, 2015
by
jehan
Browse files
fix multicast lock crash + enable dtls for android
parent
f98d1f4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
12 deletions
+37
-12
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+34
-11
coreapi/private.h
coreapi/private.h
+2
-0
mediastreamer2
mediastreamer2
+1
-1
No files found.
coreapi/linphonecore_jni.cc
View file @
2d30e846
...
...
@@ -1160,10 +1160,23 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv*
if
(
factoryConfig
)
env
->
ReleaseStringUTFChars
(
jfactoryConfig
,
factoryConfig
);
return
nativePtr
;
}
extern
"C"
void
Java_org_linphone_core_LinphoneCoreImpl_delete
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
lc
)
{
jobject
core
=
(
jobject
)
linphone_core_get_user_data
((
LinphoneCore
*
)
lc
);
linphone_core_destroy
((
LinphoneCore
*
)
lc
);
extern
"C"
void
Java_org_linphone_core_LinphoneCoreImpl_delete
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
native_ptr
)
{
LinphoneCore
*
lc
=
(
LinphoneCore
*
)
native_ptr
;
jobject
core
=
(
jobject
)
linphone_core_get_user_data
(
lc
);
jobject
multicast_lock
=
lc
->
multicast_lock
;
jobject
multicast_lock_class
=
lc
->
multicast_lock_class
;
jobject
wifi_lock
=
lc
->
wifi_lock
;
jobject
wifi_lock_class
=
lc
->
wifi_lock_class
;
linphone_core_destroy
(
lc
);
ms_exit
();
if
(
wifi_lock
)
env
->
DeleteGlobalRef
(
wifi_lock
);
if
(
wifi_lock_class
)
env
->
DeleteGlobalRef
(
wifi_lock_class
);
if
(
multicast_lock
)
env
->
DeleteGlobalRef
(
multicast_lock
);
if
(
multicast_lock_class
)
env
->
DeleteGlobalRef
(
multicast_lock_class
);
if
(
core
)
{
env
->
DeleteGlobalRef
(
core
);
}
...
...
@@ -4082,33 +4095,43 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAndroidPowerManager(J
#endif
}
/*released in Java_org_linphone_core_LinphoneCoreImpl_delete*/
extern
"C"
void
Java_org_linphone_core_LinphoneCoreImpl_setAndroidWifiLock
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
,
jobject
wifi_lock
)
{
#ifdef ANDROID
LinphoneCore
*
lc
=
(
LinphoneCore
*
)
ptr
;
if
(
lc
->
wifi_lock
)
if
(
lc
->
wifi_lock
)
{
env
->
DeleteGlobalRef
(
lc
->
wifi_lock
);
env
->
DeleteGlobalRef
(
lc
->
wifi_lock_class
);
}
if
(
wifi_lock
!=
NULL
)
{
lc
->
wifi_lock
=
env
->
NewGlobalRef
(
wifi_lock
);
jclass
wifiLockClass
=
env
->
FindClass
(
"android/net/wifi/WifiManager$WifiLock"
);
lc
->
wifi_lock_acquire_id
=
env
->
GetMethodID
(
wifiLockClass
,
"acquire"
,
"()V"
);
lc
->
wifi_lock_release_id
=
env
->
GetMethodID
(
wifiLockClass
,
"release"
,
"()V"
);
lc
->
wifi_lock_class
=
env
->
FindClass
(
"android/net/wifi/WifiManager$WifiLock"
);
lc
->
wifi_lock_class
=
(
jclass
)
env
->
NewGlobalRef
(
lc
->
wifi_lock_class
);
/*to make sure methodid are preserved*/
lc
->
wifi_lock_acquire_id
=
env
->
GetMethodID
(
lc
->
wifi_lock_class
,
"acquire"
,
"()V"
);
lc
->
wifi_lock_release_id
=
env
->
GetMethodID
(
lc
->
wifi_lock_class
,
"release"
,
"()V"
);
}
else
{
lc
->
wifi_lock
=
NULL
;
lc
->
wifi_lock_class
=
NULL
;
}
#endif
}
/*released in Java_org_linphone_core_LinphoneCoreImpl_delete*/
extern
"C"
void
Java_org_linphone_core_LinphoneCoreImpl_setAndroidMulticastLock
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
,
jobject
multicast_lock
)
{
#ifdef ANDROID
LinphoneCore
*
lc
=
(
LinphoneCore
*
)
ptr
;
if
(
lc
->
multicast_lock
)
if
(
lc
->
multicast_lock
)
{
env
->
DeleteGlobalRef
(
lc
->
multicast_lock
);
env
->
DeleteGlobalRef
(
lc
->
multicast_lock_class
);
}
if
(
multicast_lock
!=
NULL
)
{
lc
->
multicast_lock
=
env
->
NewGlobalRef
(
multicast_lock
);
jclass
multicastLockClass
=
env
->
FindClass
(
"android/net/wifi/WifiManager$MulticastLock"
);
lc
->
multicast_lock_acquire_id
=
env
->
GetMethodID
(
multicastLockClass
,
"acquire"
,
"()V"
);
lc
->
multicast_lock_release_id
=
env
->
GetMethodID
(
multicastLockClass
,
"release"
,
"()V"
);
lc
->
multicast_lock_class
=
env
->
FindClass
(
"android/net/wifi/WifiManager$MulticastLock"
);
lc
->
multicast_lock_class
=
(
jclass
)
env
->
NewGlobalRef
(
lc
->
multicast_lock_class
);
/*to make sure methodid are preserved*/
lc
->
multicast_lock_acquire_id
=
env
->
GetMethodID
(
lc
->
multicast_lock_class
,
"acquire"
,
"()V"
);
lc
->
multicast_lock_release_id
=
env
->
GetMethodID
(
lc
->
multicast_lock_class
,
"release"
,
"()V"
);
}
else
{
lc
->
multicast_lock
=
NULL
;
lc
->
multicast_lock_class
=
NULL
;
}
#endif
}
...
...
coreapi/private.h
View file @
2d30e846
...
...
@@ -805,9 +805,11 @@ struct _LinphoneCore
LinphoneCoreVTable
*
current_vtable
;
// the latest vtable to call a callback, see linphone_core_get_current_vtable
#ifdef ANDROID
jobject
wifi_lock
;
jclass
wifi_lock_class
;
jmethodID
wifi_lock_acquire_id
;
jmethodID
wifi_lock_release_id
;
jobject
multicast_lock
;
jclass
multicast_lock_class
;
jmethodID
multicast_lock_acquire_id
;
jmethodID
multicast_lock_release_id
;
#endif
...
...
mediastreamer2
@
ca8ad4af
Subproject commit
ed0c1f30701c6a3bb0607243834f5b58a2720381
Subproject commit
ca8ad4af235b8131d43687343577e98ba0142c72
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