Commit a7adfbda authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Improvements on OpenH264 Java helper

parent 367243d2
......@@ -63,6 +63,19 @@ public class OpenH264DownloadHelper {
if (context.getFilesDir() != null) {
fileDirection = context.getFilesDir().toString();
}
File file = new File(context.getApplicationInfo().nativeLibraryDir+"/libmsopenh264.so");
if (!file.exists()) {
Log.i("LinphoneCoreFactoryImpl"," libmsopenh264 not found, we disable the download of Openh264");
isDownloadEnabled = false;
}
if (isCodecFound()) {
Log.i("OpenH264DownloadHelper"," Loading OpenH264 downloaded plugin:" + downloadHelper.getFullPathLib());
System.load(downloadHelper.getFullPathLib());
} else {
Log.i("OpenH264DownloadHelper"," Cannot load OpenH264 downloaded plugin");
}
isDownloadEnabled = true;
}
public static boolean isOpenH264DownloadEnabled() {
......@@ -73,24 +86,6 @@ public class OpenH264DownloadHelper {
isDownloadEnabled = enabled;
}
public static boolean checkIfOpenH264DownloadCanBeEnabled(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
......
......@@ -234,7 +234,6 @@ eval "$SED_START 's/enableDownloadOpenH264(/OpenH264DownloadHelper.enableDownloa
#Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath());
#Factory.instance().enableLogCollection(isDebugEnabled);
#Factory.instance().setDebugMode(isDebugEnabled, getString(R.string.app_name));
#Factory.instance().createConfig(String s);
#AccountCreator.updatePassword
#Android specifics not wrapped automatically
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment