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
8dd53e5e
Commit
8dd53e5e
authored
Jan 03, 2017
by
Erwan Croze
👋🏻
Browse files
Refactoring loading of downloaded OpenH264
parent
e34327f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
22 deletions
+20
-22
java/common/org/linphone/core/LinphoneCore.java
java/common/org/linphone/core/LinphoneCore.java
+4
-4
java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java
java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java
+11
-13
java/impl/org/linphone/core/LinphoneCoreImpl.java
java/impl/org/linphone/core/LinphoneCoreImpl.java
+5
-5
No files found.
java/common/org/linphone/core/LinphoneCore.java
View file @
8dd53e5e
...
...
@@ -2504,16 +2504,16 @@ public interface LinphoneCore {
public
void
setVerifyServerCN
(
boolean
enable
);
/**
* Enable or not openh264
* Enable or not openh264
download
* @param enable
*/
public
void
enableOpenH264
(
boolean
enable
);
public
void
enable
Download
OpenH264
(
boolean
enable
);
/**
* Return if we enable openh264
* Return if we enable openh264
download
* @return
*/
public
boolean
o
penH264Enabled
();
public
boolean
downloadO
penH264Enabled
();
/**
* @return a new LinphoneFriend link with this LinphoneCore
...
...
java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java
View file @
8dd53e5e
...
...
@@ -100,23 +100,21 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
return
LpConfigImpl
.
fromBuffer
(
buffer
);
}
private
boolean
loadOpenH264
(
Context
context
)
{
private
boolean
load
ingDownloaded
OpenH264
(
Context
context
)
{
File
file
=
new
File
(
context
.
getFilesDir
()+
"/../lib/libmsopenh264.so"
);
// Only enable for android <= 5.0
if
(!
file
.
exists
()
||
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP_MR1
)
{
Log
.
i
(
"LinphoneCoreFactoryImpl"
,
" Openh264 disabled on the project"
);
if
(!
file
.
exists
())
{
Log
.
i
(
"LinphoneCoreFactoryImpl"
,
" libmsopenh264 not found, we disable the download of Openh264"
);
return
false
;
}
OpenH264DownloadHelper
downloadHelper
=
new
OpenH264DownloadHelper
(
context
);
if
(
downloadHelper
.
isCodecFound
())
{
Log
.
i
(
"LinphoneCoreFactoryImpl"
,
" Loading OpenH264 plugin:"
+
downloadHelper
.
getFullPathLib
());
Log
.
i
(
"LinphoneCoreFactoryImpl"
,
" Loading OpenH264
downloaded
plugin:"
+
downloadHelper
.
getFullPathLib
());
System
.
load
(
downloadHelper
.
getFullPathLib
());
}
else
{
Log
.
i
(
"LinphoneCoreFactoryImpl"
,
" Cannot load OpenH264 plugin"
);
Log
.
i
(
"LinphoneCoreFactoryImpl"
,
" Cannot load OpenH264
downloaded
plugin"
);
}
return
true
;
}
...
...
@@ -126,13 +124,13 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
throws
LinphoneCoreException
{
try
{
fcontext
=
(
Context
)
context
;
boolean
openh264Enabled
=
false
;
if
(
context
!=
null
)
openh264Enabled
=
loadOpenH264
(
fcontext
);
boolean
openh264
Download
Enabled
=
false
;
if
(
context
!=
null
)
openh264
Download
Enabled
=
load
ingDownloaded
OpenH264
(
fcontext
);
MediastreamerAndroidContext
.
setContext
(
context
);
File
user
=
userConfig
==
null
?
null
:
new
File
(
userConfig
);
File
factory
=
factoryConfig
==
null
?
null
:
new
File
(
factoryConfig
);
LinphoneCore
lc
=
new
LinphoneCoreImpl
(
listener
,
user
,
factory
,
userdata
);
lc
.
enableOpenH264
(
openh264Enabled
);
lc
.
enable
Download
OpenH264
(
openh264
Download
Enabled
);
if
(
context
!=
null
)
lc
.
setContext
(
context
);
return
lc
;
}
catch
(
IOException
e
)
{
...
...
@@ -144,11 +142,11 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
public
LinphoneCore
createLinphoneCore
(
LinphoneCoreListener
listener
,
Object
context
)
throws
LinphoneCoreException
{
try
{
fcontext
=
(
Context
)
context
;
boolean
openh264Enabled
=
false
;
if
(
context
!=
null
)
openh264Enabled
=
loadOpenH264
(
fcontext
);
boolean
openh264
Download
Enabled
=
false
;
if
(
context
!=
null
)
openh264
Download
Enabled
=
load
ingDownloaded
OpenH264
(
fcontext
);
MediastreamerAndroidContext
.
setContext
(
context
);
LinphoneCore
lc
=
new
LinphoneCoreImpl
(
listener
);
lc
.
enableOpenH264
(
openh264Enabled
);
lc
.
enable
Download
OpenH264
(
openh264
Download
Enabled
);
if
(
context
!=
null
)
lc
.
setContext
(
context
);
return
lc
;
}
catch
(
IOException
e
)
{
...
...
java/impl/org/linphone/core/LinphoneCoreImpl.java
View file @
8dd53e5e
...
...
@@ -45,7 +45,7 @@ class LinphoneCoreImpl implements LinphoneCore {
protected
long
nativePtr
=
0
;
private
Context
mContext
=
null
;
private
AudioManager
mAudioManager
=
null
;
private
boolean
openh264Enabled
=
false
;
private
boolean
openh264
Download
Enabled
=
false
;
private
boolean
mSpeakerEnabled
=
false
;
private
native
long
newLinphoneCore
(
LinphoneCoreListener
listener
,
String
userConfig
,
String
factoryConfig
,
Object
userdata
);
private
native
void
iterate
(
long
nativePtr
);
...
...
@@ -1797,12 +1797,12 @@ class LinphoneCoreImpl implements LinphoneCore {
setVerifyServerCN
(
nativePtr
,
enable
);
}
public
void
enableOpenH264
(
boolean
enable
)
{
openh264Enabled
=
enable
;
public
void
enable
Download
OpenH264
(
boolean
enable
)
{
openh264
Download
Enabled
=
enable
;
}
public
boolean
o
penH264Enabled
()
{
return
openh264Enabled
;
public
boolean
downloadO
penH264Enabled
()
{
return
openh264
Download
Enabled
;
}
public
LinphoneFriend
createFriend
()
{
...
...
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