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
e31b995b
Commit
e31b995b
authored
Oct 13, 2017
by
Sylvain Berfini
🐮
Browse files
Changes for Java's OpenH264's helper
parent
601a1a65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
25 deletions
+36
-25
wrappers/java/classes/tools/OpenH264DownloadHelper.java
wrappers/java/classes/tools/OpenH264DownloadHelper.java
+20
-2
wrappers/java/java_class.mustache
wrappers/java/java_class.mustache
+6
-22
wrappers/java/migration.sh
wrappers/java/migration.sh
+10
-1
No files found.
wrappers/java/classes/tools/OpenH264DownloadHelper.java
View file @
e31b995b
...
...
@@ -31,7 +31,7 @@ import java.net.URL;
import
java.util.ArrayList
;
import
org.apache.commons.compress.compressors.bzip2.*
;
import
org.linphone.core.OpenH264DownloadHelperListener
;
import
org.linphone.core.
tools.
OpenH264DownloadHelperListener
;
import
org.linphone.mediastream.Log
;
/**
...
...
@@ -58,11 +58,29 @@ public class OpenH264DownloadHelper {
nameLib
=
"libopenh264.so"
;
urlDownload
=
"http://ciscobinary.openh264.org/libopenh264-1.5.0-android19.so.bz2"
;
nameFileDownload
=
"libopenh264-1.5.0-android19.so.bz2"
;
if
(
context
.
getFilesDir
()
!=
null
)
{
if
(
context
.
getFilesDir
()
!=
null
)
{
fileDirection
=
context
.
getFilesDir
().
toString
();
}
}
public
static
boolean
isOpenH264DownloadEnabled
(
Context
context
)
{
File
file
=
new
File
(
context
.
getApplicationInfo
().
nativeLibraryDir
+
"/libmsopenh264.so"
);
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
(
"OpenH264DownloadHelper"
,
" Loading OpenH264 downloaded plugin:"
+
downloadHelper
.
getFullPathLib
());
System
.
load
(
downloadHelper
.
getFullPathLib
());
}
else
{
Log
.
i
(
"OpenH264DownloadHelper"
,
" Cannot load OpenH264 downloaded plugin"
);
}
return
true
;
}
/**
* Set OpenH264DownloadHelperListener
* @param h264Listener
...
...
wrappers/java/java_class.mustache
View file @
e31b995b
...
...
@@ -92,6 +92,8 @@ public {{#isLinphoneFactory}}abstract class{{/isLinphoneFactory}}{{#isNotLinphon
}
return _Factory;
}
abstract public OpenH264DownloadHelper createOpenH264DownloadHelper(Context context);
{{/
isLinphoneFactory
}}
{{#
methods
}}
{{#
doc
}}
...
...
@@ -161,30 +163,12 @@ class {{classImplName}} {{#isLinphoneFactory}}extends{{/isLinphoneFactory}}{{#is
Version.dumpCapabilities();
}
private boolean loadingDownloadedOpenH264(Context context) {
File file = new File(context.getApplicationInfo().nativeLibraryDir + "/libmsopenh264.so");
if (!file.exists()) {
Log.i("FactoryImpl"," libmsopenh264 not found, we disable the download of Openh264");
return false;
}
OpenH264DownloadHelper downloadHelper = new OpenH264DownloadHelper(context);
if (downloadHelper.isCodecFound()) {
Log.i("FactoryImpl"," Loading OpenH264 downloaded plugin:" + downloadHelper.getFullPathLib());
System.load(downloadHelper.getFullPathLib());
} else {
Log.i("FactoryImpl"," Cannot load OpenH264 downloaded plugin");
}
return true;
}
public OpenH264DownloadHelper createOpenH264DownloadHelper() {
if (fcontext == null) {
public OpenH264DownloadHelper createOpenH264DownloadHelper(Context context) {
if (context == null) {
new CoreException("Cannot create OpenH264DownloadHelper");
return null;
//exception
return null;
}
return new OpenH264DownloadHelper(
f
context);
return new OpenH264DownloadHelper(context);
}
{{/
isLinphoneFactory
}}
...
...
wrappers/java/migration.sh
View file @
e31b995b
...
...
@@ -5,6 +5,7 @@ SED_END='{} \;'
# Imports
eval
"
$SED_START
's/import org.linphone.tools/import org.linphone.core.tools/g'
$SED_END
"
eval
"
$SED_START
's/import org.linphone.core.OpenH264DownloadHelperListener/import org.linphone.core.tools.OpenH264DownloadHelperListener/g'
$SED_END
"
# Listeners
eval
"
$SED_START
's/AccountCreator.AccountCreatorListener/AccountCreatorListener/g'
$SED_END
"
...
...
@@ -22,6 +23,7 @@ eval "$SED_START 's/RegistrationState.RegistrationOk/RegistrationState.Ok/g' $SE
eval
"
$SED_START
's/RegistrationState.RegistrationFailed/RegistrationState.Failed/g'
$SED_END
"
eval
"
$SED_START
's/RegistrationState.RegistrationCleared/RegistrationState.Cleared/g'
$SED_END
"
eval
"
$SED_START
's/RegistrationState.RegistrationProgress/RegistrationState.Progress/g'
$SED_END
"
eval
"
$SED_START
's/RegistrationState.RegistrationNone/RegistrationState.None/g'
$SED_END
"
eval
"
$SED_START
's/RemoteProvisioningState.ConfiguringSuccessful/ConfiguringState.Successful/g'
$SED_END
"
eval
"
$SED_START
's/LinphoneCore.RemoteProvisioningState/Core.ConfiguringState/g'
$SED_END
"
...
...
@@ -107,8 +109,9 @@ eval "$SED_START 's/onChatMessageFileTransferProgressChanged/onFileTransferProgr
eval
"
$SED_START
's/registrationState/onRegistrationStateChanged/g'
$SED_END
"
# Methods
eval
"
$SED_START
's/getFriendList
(
/getFriends
Lists
(/g'
$SED_END
"
eval
"
$SED_START
's/getFriend
s
List
s()
/getFriends(
)
/g'
$SED_END
"
eval
"
$SED_START
's/getFriendLists()/getFriendsLists()/g'
$SED_END
"
eval
"
$SED_START
's/getFriendList(/getFriendsLists(/g'
$SED_END
"
eval
"
$SED_START
's/getIdentity(/getIdentityAddress(/g'
$SED_END
"
eval
"
$SED_START
's/isTunnelAvailable()/tunnelAvailable()/g'
$SED_END
"
eval
"
$SED_START
's/setZrtpSecretsCache(/setZrtpSecretsFile(/g'
$SED_END
"
...
...
@@ -182,6 +185,7 @@ eval "$SED_START 's/loadXmlFile(/loadFromXmlFile(/g' $SED_END"
eval
"
$SED_START
's/activatePhoneNumberLink()/activateAlias()/g'
$SED_END
"
eval
"
$SED_START
's/isPhoneNumberUsed()/isAliasUsed()/g'
$SED_END
"
eval
"
$SED_START
's/recoverPhoneAccount()/recoverAccount()/g'
$SED_END
"
eval
"
$SED_START
's/isLimeEncryptionAvailable()/limeAvailable()/g'
$SED_END
"
# Removed methods
eval
"
$SED_START
's/.isRegistered()/.getState() == RegistrationState.Ok/g'
$SED_END
"
...
...
@@ -214,6 +218,11 @@ eval "$SED_START 's/.sendDtmf(/.getCurrentCall().sendDtmf(/g' $SED_END"
#DialPlan
#LinphoneBuffer
#Call.zoomVideo()
#Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath());
#Factory.instance().enableLogCollection(isDebugEnabled);
#Factory.instance().setDebugMode(isDebugEnabled, getString(R.string.app_name));
#Factory.instance().createConfig(String s);
#Core.enableDownloadOpenH264
#Android specifics not wrapped automatically
#Core.needsEchoCalibration()
...
...
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