Refactoring loading of downloaded OpenH264 + update Linphone
This commit is contained in:
parent
e7b1bb1841
commit
5cf1093f13
5 changed files with 14 additions and 9 deletions
|
@ -224,7 +224,13 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
mLc.enableSpeaker(speakerOn);
|
||||
}
|
||||
|
||||
public void initOpenH264Helper() {
|
||||
public void initOpenH264DownloadHelper() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
Log.i("Android >= 5.1 we disable the download of OpenH264");
|
||||
getLc().enableDownloadOpenH264(false);
|
||||
return;
|
||||
}
|
||||
|
||||
mCodecDownloader = LinphoneCoreFactory.instance().createOpenH264DownloadHelper();
|
||||
mCodecListener = new OpenH264DownloadHelperListener() {
|
||||
ProgressDialog progress;
|
||||
|
@ -315,11 +321,11 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
|
||||
instance = new LinphoneManager(c);
|
||||
instance.startLibLinphone(c);
|
||||
instance.initOpenH264DownloadHelper();
|
||||
|
||||
//if (getLc().openH264Enabled()) { ==> Not really relevant because not openH264Enabled condition check is not totally correct
|
||||
// H264 codec Management - set to auto mode -> MediaCodec >= android 5.0 >= OpenH264
|
||||
H264Helper.setH264Mode(H264Helper.MODE_AUTO, getLc());
|
||||
//}
|
||||
|
||||
TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
boolean gsmIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE;
|
||||
setGsmIdle(gsmIdle);
|
||||
|
@ -1028,7 +1034,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
try {
|
||||
Log.e("LinphoneManager"," globalState ON");
|
||||
initLiblinphone(lc);
|
||||
initOpenH264Helper();
|
||||
|
||||
} catch (LinphoneCoreException e) {
|
||||
Log.e(e);
|
||||
|
|
|
@ -691,7 +691,7 @@ public class SettingsFragment extends PreferencesListFragment {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (lc.openH264Enabled()) {
|
||||
if (lc.downloadOpenH264Enabled()) {
|
||||
if (pt.getMime().equals("H264") && mCodecDownloader.isCodecFound()) {
|
||||
codec.setSummary(mCodecDownloader.getLicenseMessage());
|
||||
codec.setTitle("OpenH264");
|
||||
|
@ -704,7 +704,7 @@ public class SettingsFragment extends PreferencesListFragment {
|
|||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
boolean enable = (Boolean) newValue;
|
||||
try {
|
||||
if (lc.openH264Enabled()) {
|
||||
if (lc.downloadOpenH264Enabled()) {
|
||||
if (enable && Version.getCpuAbis().contains("armeabi-v7a") && !Version.getCpuAbis().contains("x86")
|
||||
&& pt.getMime().equals("H264") && !mCodecDownloader.isCodecFound()) {
|
||||
mCodecDownloader.setOpenH264HelperListener(LinphoneManager.getInstance().getOpenH264HelperListener());
|
||||
|
|
|
@ -457,7 +457,7 @@ public class StatusFragment extends Fragment {
|
|||
title.setVisibility(TextView.VISIBLE);
|
||||
if (media != null) {
|
||||
String mime = media.getMime();
|
||||
if (LinphoneManager.getLc().openH264Enabled() &&
|
||||
if (LinphoneManager.getLc().downloadOpenH264Enabled() &&
|
||||
media.getMime().equals("H264") &&
|
||||
LinphoneManager.getInstance().getOpenH264DownloadHelper().isCodecFound()) {
|
||||
mime = "OpenH264";
|
||||
|
|
|
@ -438,7 +438,7 @@ private static AssistantActivity instance;
|
|||
}
|
||||
|
||||
private void launchDownloadCodec() {
|
||||
if (LinphoneManager.getLc().openH264Enabled()) {
|
||||
if (LinphoneManager.getLc().downloadOpenH264Enabled()) {
|
||||
OpenH264DownloadHelper downloadHelper = LinphoneCoreFactory.instance().createOpenH264DownloadHelper();
|
||||
if (Version.getCpuAbis().contains("armeabi-v7a") && !Version.getCpuAbis().contains("x86") && !downloadHelper.isCodecFound()) {
|
||||
CodecDownloaderFragment codecFragment = new CodecDownloaderFragment();
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 78d88d8b75f9dc92c772b4fba1ad5b3542a96dfd
|
||||
Subproject commit 8dd53e5eb673b6984ce9ed3fec4ffede6775dd03
|
Loading…
Reference in a new issue