[Switch submodule branch] Update linphone
This commit is contained in:
parent
d8aac717af
commit
f59cf99caa
5 changed files with 44 additions and 42 deletions
|
@ -39,8 +39,8 @@ import java.util.TimerTask;
|
||||||
|
|
||||||
import org.linphone.compatibility.Compatibility;
|
import org.linphone.compatibility.Compatibility;
|
||||||
import org.linphone.core.CallDirection;
|
import org.linphone.core.CallDirection;
|
||||||
import org.linphone.core.OpenH264HelperAction;
|
import org.linphone.core.OpenH264DownloadHelperAction;
|
||||||
import org.linphone.core.OpenH264HelperListener;
|
import org.linphone.core.OpenH264DownloadHelperListener;
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.LinphoneBuffer;
|
import org.linphone.core.LinphoneBuffer;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
|
@ -76,7 +76,7 @@ import org.linphone.mediastream.Version;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
||||||
import org.linphone.tools.OpenH264Helper;
|
import org.linphone.tools.OpenH264DownloadHelper;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
|
@ -143,9 +143,9 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
private Resources mR;
|
private Resources mR;
|
||||||
private LinphonePreferences mPrefs;
|
private LinphonePreferences mPrefs;
|
||||||
private LinphoneCore mLc;
|
private LinphoneCore mLc;
|
||||||
private OpenH264Helper mCodecDownloader;
|
private OpenH264DownloadHelper mCodecDownloader;
|
||||||
private OpenH264HelperListener mCodecListener;
|
private OpenH264DownloadHelperListener mCodecListener;
|
||||||
private OpenH264HelperAction mCodecAction;
|
private OpenH264DownloadHelperAction mCodecAction;
|
||||||
private String lastLcStatusMessage;
|
private String lastLcStatusMessage;
|
||||||
private String basePath;
|
private String basePath;
|
||||||
private static boolean sExited;
|
private static boolean sExited;
|
||||||
|
@ -225,7 +225,8 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initOpenH264Helper() {
|
public void initOpenH264Helper() {
|
||||||
mCodecListener = new OpenH264HelperListener() {
|
mCodecDownloader = new OpenH264DownloadHelper();
|
||||||
|
mCodecListener = new OpenH264DownloadHelperListener() {
|
||||||
ProgressDialog progress;
|
ProgressDialog progress;
|
||||||
int box = 1;
|
int box = 1;
|
||||||
int ctxt = 0;
|
int ctxt = 0;
|
||||||
|
@ -235,8 +236,9 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
mHandler.post(new Runnable() {
|
mHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
OpenH264DownloadHelper ohcodec = LinphoneManager.getInstance().getOpenH264DownloadHelper();
|
||||||
if (progress == null) {
|
if (progress == null) {
|
||||||
progress = new ProgressDialog((Context)LinphoneManager.getInstance().getOpenH264Helper().getUserData(ctxt));
|
progress = new ProgressDialog((Context)ohcodec.getUserData(ctxt));
|
||||||
progress.setCanceledOnTouchOutside(false);
|
progress.setCanceledOnTouchOutside(false);
|
||||||
progress.setCancelable(false);
|
progress.setCancelable(false);
|
||||||
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||||
|
@ -248,24 +250,24 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
} else {
|
} else {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
progress = null;
|
progress = null;
|
||||||
LinphoneCoreFactoryImpl.loadOptionalLibraryWithPath(((Context)LinphoneManager.getInstance().getOpenH264Helper().getUserData(ctxt)).getFilesDir() + "/" + OpenH264Helper.getNameLib());
|
LinphoneCoreFactoryImpl.loadOptionalLibraryWithPath(((Context)ohcodec.getUserData(ctxt)).getFilesDir() + "/" + mCodecDownloader.getNameLib());
|
||||||
LinphoneManager.getLc().reloadMsPlugins(null);
|
LinphoneManager.getLc().reloadMsPlugins(null);
|
||||||
if (LinphoneManager.getInstance().getOpenH264Helper().getUserDataSize() > box
|
if (ohcodec.getUserDataSize() > box
|
||||||
&& LinphoneManager.getInstance().getOpenH264Helper().getUserData(box) != null)
|
&& ohcodec.getUserData(box) != null)
|
||||||
((CheckBoxPreference)LinphoneManager.getInstance().getOpenH264Helper().getUserData(box)).setSummary(OpenH264Helper.getLicenseMessage());
|
((CheckBoxPreference)ohcodec.getUserData(box)).setSummary(mCodecDownloader.getLicenseMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void OnDownloadFailure (final String error){
|
public void OnError (final String error){
|
||||||
if (progress == null) return;
|
if (progress == null) return;
|
||||||
mHandler.post(new Runnable() {
|
mHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (progress != null) progress.dismiss();
|
if (progress != null) progress.dismiss();
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder((Context)LinphoneManager.getInstance().getOpenH264Helper().getUserData(ctxt));
|
AlertDialog.Builder builder = new AlertDialog.Builder((Context)LinphoneManager.getInstance().getOpenH264DownloadHelper().getUserData(ctxt));
|
||||||
builder.setMessage("Sorry an error has occurred.");
|
builder.setMessage("Sorry an error has occurred.");
|
||||||
builder.setCancelable(false);
|
builder.setCancelable(false);
|
||||||
builder.setNeutralButton("Ok", null);
|
builder.setNeutralButton("Ok", null);
|
||||||
|
@ -274,7 +276,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mCodecAction = new OpenH264HelperAction() {
|
mCodecAction = new OpenH264DownloadHelperAction() {
|
||||||
@Override
|
@Override
|
||||||
public void startDownload() {
|
public void startDownload() {
|
||||||
askPopUp();
|
askPopUp();
|
||||||
|
@ -284,7 +286,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(LinphoneManager.getInstance().getContext());
|
AlertDialog.Builder builder = new AlertDialog.Builder(LinphoneManager.getInstance().getContext());
|
||||||
builder.setCancelable(false);
|
builder.setCancelable(false);
|
||||||
AlertDialog.Builder show = builder.setMessage("Do you agree to download "
|
AlertDialog.Builder show = builder.setMessage("Do you agree to download "
|
||||||
+ OpenH264Helper.getLicenseMessage()).setPositiveButton("Yes", new DialogInterface.OnClickListener(){
|
+ mCodecDownloader.getLicenseMessage()).setPositiveButton("Yes", new DialogInterface.OnClickListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
if (which == DialogInterface.BUTTON_POSITIVE)
|
if (which == DialogInterface.BUTTON_POSITIVE)
|
||||||
|
@ -301,20 +303,19 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mCodecDownloader = new OpenH264Helper();
|
|
||||||
mCodecDownloader.setOpenH264HelperListener(mCodecListener);
|
mCodecDownloader.setOpenH264HelperListener(mCodecListener);
|
||||||
mCodecDownloader.setOpenH264HelperAction(mCodecAction);
|
mCodecDownloader.setOpenH264HelperAction(mCodecAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenH264HelperListener getOpenH264HelperListener() {
|
public OpenH264DownloadHelperListener getOpenH264HelperListener() {
|
||||||
return mCodecListener;
|
return mCodecListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenH264HelperAction getOpenH264HelperAction() {
|
public OpenH264DownloadHelperAction getOpenH264HelperAction() {
|
||||||
return mCodecAction;
|
return mCodecAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenH264Helper getOpenH264Helper(){
|
public OpenH264DownloadHelper getOpenH264DownloadHelper(){
|
||||||
return mCodecDownloader;
|
return mCodecDownloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.linphone.core.PayloadType;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
import org.linphone.mediastream.Version;
|
import org.linphone.mediastream.Version;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.tools.OpenH264Helper;
|
import org.linphone.tools.OpenH264DownloadHelper;
|
||||||
import org.linphone.ui.LedPreference;
|
import org.linphone.ui.LedPreference;
|
||||||
import org.linphone.ui.PreferencesListFragment;
|
import org.linphone.ui.PreferencesListFragment;
|
||||||
|
|
||||||
|
@ -554,6 +554,7 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
codecs.removeAll();
|
codecs.removeAll();
|
||||||
|
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
|
final OpenH264DownloadHelper mCodecDownloader = LinphoneManager.getInstance().getOpenH264DownloadHelper();
|
||||||
for (final PayloadType pt : lc.getVideoCodecs()) {
|
for (final PayloadType pt : lc.getVideoCodecs()) {
|
||||||
final CheckBoxPreference codec = new CheckBoxPreference(getActivity());
|
final CheckBoxPreference codec = new CheckBoxPreference(getActivity());
|
||||||
codec.setTitle(pt.getMime());
|
codec.setTitle(pt.getMime());
|
||||||
|
@ -570,8 +571,9 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pt.getMime().equals("H264") && OpenH264Helper.codecExist())
|
mCodecDownloader.setFileDirection(LinphoneManager.getInstance().getContext().getFilesDir().toString());
|
||||||
codec.setSummary(OpenH264Helper.getLicenseMessage());
|
if (pt.getMime().equals("H264") && mCodecDownloader.isCodecFound())
|
||||||
|
codec.setSummary(mCodecDownloader.getLicenseMessage());
|
||||||
codec.setChecked(lc.isPayloadTypeEnabled(pt));
|
codec.setChecked(lc.isPayloadTypeEnabled(pt));
|
||||||
|
|
||||||
codec.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
codec.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
|
@ -579,14 +581,13 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
boolean enable = (Boolean) newValue;
|
boolean enable = (Boolean) newValue;
|
||||||
try {
|
try {
|
||||||
OpenH264Helper.setFileDirection(LinphoneManager.getInstance().getContext().getFilesDir().toString());
|
|
||||||
if (enable && Version.getCpuAbis().contains("armeabi-v7a") && !Version.getCpuAbis().contains("x86")
|
if (enable && Version.getCpuAbis().contains("armeabi-v7a") && !Version.getCpuAbis().contains("x86")
|
||||||
&& pt.getMime().equals("H264") && !OpenH264Helper.codecExist()) {
|
&& pt.getMime().equals("H264") && !mCodecDownloader.isCodecFound()) {
|
||||||
LinphoneManager.getInstance().getOpenH264Helper().setOpenH264HelperListener(LinphoneManager.getInstance().getOpenH264HelperListener());
|
LinphoneManager.getInstance().getOpenH264DownloadHelper().setOpenH264HelperListener(LinphoneManager.getInstance().getOpenH264HelperListener());
|
||||||
LinphoneManager.getInstance().getOpenH264Helper().setOpenH264HelperAction(LinphoneManager.getInstance().getOpenH264Helper().getOpenH264HelperAction());
|
LinphoneManager.getInstance().getOpenH264DownloadHelper().setOpenH264HelperAction(LinphoneManager.getInstance().getOpenH264DownloadHelper().getOpenH264DownloadHelperAction());
|
||||||
LinphoneManager.getInstance().getOpenH264Helper().setUserData(0,LinphoneManager.getInstance().getContext());
|
LinphoneManager.getInstance().getOpenH264DownloadHelper().setUserData(0,LinphoneManager.getInstance().getContext());
|
||||||
LinphoneManager.getInstance().getOpenH264Helper().setUserData(1,codec);
|
LinphoneManager.getInstance().getOpenH264DownloadHelper().setUserData(1,codec);
|
||||||
LinphoneManager.getInstance().getOpenH264Helper().getOpenH264HelperAction().startDownload();
|
LinphoneManager.getInstance().getOpenH264DownloadHelper().getOpenH264DownloadHelperAction().startDownload();
|
||||||
}
|
}
|
||||||
LinphoneManager.getLcIfManagerNotDestroyedOrNull().enablePayloadType(pt, enable);
|
LinphoneManager.getLcIfManagerNotDestroyedOrNull().enablePayloadType(pt, enable);
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
import org.linphone.mediastream.Version;
|
import org.linphone.mediastream.Version;
|
||||||
import org.linphone.tools.OpenH264Helper;
|
import org.linphone.tools.OpenH264DownloadHelper;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
@ -355,8 +355,9 @@ private static AssistantActivity instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void launchDownloadCodec() {
|
private void launchDownloadCodec() {
|
||||||
OpenH264Helper.setFileDirection(LinphoneManager.getInstance().getContext().getFilesDir().toString());
|
OpenH264DownloadHelper downloadHelper = new OpenH264DownloadHelper();
|
||||||
if (Version.getCpuAbis().contains("armeabi-v7a") && !Version.getCpuAbis().contains("x86") && !OpenH264Helper.codecExist()) {
|
downloadHelper.setFileDirection(LinphoneManager.getInstance().getContext().getFilesDir().toString());
|
||||||
|
if (Version.getCpuAbis().contains("armeabi-v7a") && !Version.getCpuAbis().contains("x86") && !downloadHelper.isCodecFound()) {
|
||||||
CodecDownloaderFragment codecFragment = new CodecDownloaderFragment();
|
CodecDownloaderFragment codecFragment = new CodecDownloaderFragment();
|
||||||
changeFragment(codecFragment);
|
changeFragment(codecFragment);
|
||||||
currentFragment = AssistantFragmentsEnum.DOWNLOAD_CODEC;
|
currentFragment = AssistantFragmentsEnum.DOWNLOAD_CODEC;
|
||||||
|
|
|
@ -31,11 +31,11 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.OpenH264HelperListener;
|
import org.linphone.core.OpenH264DownloadHelperListener;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.LinphoneCoreFactoryImpl;
|
import org.linphone.core.LinphoneCoreFactoryImpl;
|
||||||
import org.linphone.core.PayloadType;
|
import org.linphone.core.PayloadType;
|
||||||
import org.linphone.tools.OpenH264Helper;
|
import org.linphone.tools.OpenH264DownloadHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Erwan CROZE
|
* @author Erwan CROZE
|
||||||
|
@ -57,10 +57,9 @@ public class CodecDownloaderFragment extends Fragment {
|
||||||
final ProgressBar bar = (ProgressBar) view.findViewById(R.id.progressBar);
|
final ProgressBar bar = (ProgressBar) view.findViewById(R.id.progressBar);
|
||||||
final TextView downloadingInfo = (TextView) view.findViewById(R.id.downloadingInfo);
|
final TextView downloadingInfo = (TextView) view.findViewById(R.id.downloadingInfo);
|
||||||
|
|
||||||
OpenH264Helper.setFileDirection(LinphoneManager.getInstance().getContext().getFilesDir().toString());
|
final OpenH264DownloadHelper codecDownloader = new OpenH264DownloadHelper();
|
||||||
|
codecDownloader.setFileDirection(LinphoneManager.getInstance().getContext().getFilesDir().toString());
|
||||||
final OpenH264Helper codecDownloader = new OpenH264Helper();
|
final OpenH264DownloadHelperListener codecListener = new OpenH264DownloadHelperListener() {
|
||||||
final OpenH264HelperListener codecListener = new OpenH264HelperListener() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void OnProgress(final int current, final int max) {
|
public void OnProgress(final int current, final int max) {
|
||||||
|
@ -76,7 +75,7 @@ public class CodecDownloaderFragment extends Fragment {
|
||||||
} else {
|
} else {
|
||||||
downloadingInfo.setVisibility(View.INVISIBLE);
|
downloadingInfo.setVisibility(View.INVISIBLE);
|
||||||
bar.setVisibility(View.INVISIBLE);
|
bar.setVisibility(View.INVISIBLE);
|
||||||
LinphoneCoreFactoryImpl.loadOptionalLibraryWithPath(LinphoneManager.getInstance().getContext().getFilesDir() + "/" + OpenH264Helper.getNameLib());
|
LinphoneCoreFactoryImpl.loadOptionalLibraryWithPath(LinphoneManager.getInstance().getContext().getFilesDir() + "/" + codecDownloader.getNameLib());
|
||||||
LinphoneManager.getLc().reloadMsPlugins(null);
|
LinphoneManager.getLc().reloadMsPlugins(null);
|
||||||
downloading.setVisibility(View.INVISIBLE);
|
downloading.setVisibility(View.INVISIBLE);
|
||||||
downloaded.setVisibility(View.VISIBLE);
|
downloaded.setVisibility(View.VISIBLE);
|
||||||
|
@ -88,7 +87,7 @@ public class CodecDownloaderFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void OnDownloadFailure (final String error){
|
public void OnError (final String error){
|
||||||
mHandler.post(new Runnable() {
|
mHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit e0c204fb2b82b2b7c12d8030a94029395d5dd30d
|
Subproject commit 7ab235c55a337f68e404097d6e76baf6edc11b4f
|
Loading…
Reference in a new issue