forked from mirrors/linphone-iphone
Changes for Java's OpenH264's helper
This commit is contained in:
parent
601a1a6564
commit
e31b995bd3
3 changed files with 36 additions and 25 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(fcontext);
|
||||
return new OpenH264DownloadHelper(context);
|
||||
}
|
||||
{{/isLinphoneFactory}}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(/getFriendsLists(/g' $SED_END"
|
||||
eval "$SED_START 's/getFriendsLists()/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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue