Merge branch 'master' of git.linphone.org:linphone-android
This commit is contained in:
commit
89093384a4
27 changed files with 884 additions and 592 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -3,3 +3,6 @@ obj
|
|||
gen
|
||||
bin
|
||||
doc
|
||||
ant.properties
|
||||
local.properties
|
||||
project.properties
|
||||
|
|
|
@ -1,9 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.linphone"
|
||||
android:versionCode="1310" android:versionName="1.3.1" android:installLocation="auto">
|
||||
android:versionCode="1320" android:versionName="1.3.2" android:installLocation="auto">
|
||||
<uses-sdk android:minSdkVersion="4"/>
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
|
||||
<uses-permission android:name="android.permission.CALL_PHONE"/>
|
||||
<!-- Needed to allow Linphone to install on tablets, since android.permission.CALL_PHONE implies android.hardware.telephony is required -->
|
||||
<uses-feature android:name="android.hardware.telephony" android:required="false" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_LOGS" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
|
||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
|
||||
|
||||
<!-- Don't remove the space after android:debuggable: it prevents ndk-build to try including gdbserver and crash gcc -->
|
||||
<application android:label="@string/app_name" android:debuggable ="true" android:icon="@drawable/logo_linphone_57x57">
|
||||
|
||||
|
@ -197,23 +215,4 @@
|
|||
</activity>
|
||||
</application>
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
|
||||
<uses-permission android:name="android.permission.CALL_PHONE"/>
|
||||
<!-- Needed to allow Linphone to install on tablets, since android.permission.CALL_PHONE implies android.hardware.telephony is required -->
|
||||
<uses-feature android:name="android.hardware.telephony" android:required="false" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_LOGS" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
|
||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
|
||||
</manifest>
|
||||
|
|
1
Makefile
1
Makefile
|
@ -49,7 +49,6 @@ prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-sr
|
|||
|
||||
generate-libs:
|
||||
$(NDK_PATH)/ndk-build BUILD_SILK=1 -j$(NUMCPUS)
|
||||
rm $(TOPDIR)/libs/armeabi/liblinphone.so
|
||||
|
||||
update-project:
|
||||
$(SDK_PATH)/android update project --path .
|
||||
|
|
|
@ -116,8 +116,9 @@ ifeq ($(BUILD_SRTP), 1)
|
|||
include $(linphone-root-dir)/submodules/externals/build/srtp/Android.mk
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
|
||||
include $(linphone-root-dir)/submodules/linphone/build/android/Android.mk
|
||||
endif
|
||||
include $(linphone-root-dir)/submodules/linphone/build/android/Android-no-neon.mk
|
||||
|
||||
_BUILD_AMR=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:linphone="http://schemas.android.com/apk/res/org.linphone"
|
||||
xmlns:linphone="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
|
|
|
@ -259,6 +259,8 @@
|
|||
<string name="wizard_confirmation">Confirmation</string>
|
||||
<string name="wizard_verify_account">Check</string>
|
||||
|
||||
<string name="pref_help_proxy">Redirect registrar packets to this server</string>
|
||||
<string name="pref_help_outbound_proxy">Redirect all traffic to proxy server</string>
|
||||
<string name="pref_help_proxy">SIP proxy hostname or ip address (optional)</string>
|
||||
<string name="pref_help_outbound_proxy">Route all calls through SIP proxy</string>
|
||||
<string name="pref_help_username">Example: john if your account is john@sip.linphone.org</string>
|
||||
<string name="pref_help_domain">sip.linphone.org if your account is john@sip.linphone.org</string>
|
||||
</resources>
|
||||
|
|
|
@ -268,19 +268,16 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
|
|||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.toggleMuteMic:
|
||||
int id = v.getId();
|
||||
if (id == R.id.toggleMuteMic) {
|
||||
lc().muteMic(((Checkable) v).isChecked());
|
||||
break;
|
||||
case R.id.toggleSpeaker:
|
||||
}
|
||||
else if (id == R.id.toggleSpeaker) {
|
||||
if (((Checkable) v).isChecked()) {
|
||||
LinphoneManager.getInstance().routeAudioToSpeaker();
|
||||
} else {
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,17 +119,17 @@ public class ConferenceDetailsActivity extends AbstractCalleesActivity {
|
|||
this.dialog = dialog;
|
||||
}
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.terminate_call:
|
||||
int id = v.getId();
|
||||
if (id == R.id.terminate_call) {
|
||||
lc().terminateCall(call);
|
||||
break;
|
||||
case R.id.remove_from_conference:
|
||||
}
|
||||
else if (id == R.id.remove_from_conference) {
|
||||
lc().removeFromConference(call);
|
||||
if (LinphoneUtils.countConferenceCalls(lc()) == 0) {
|
||||
finish();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("unknown id " + v.getId());
|
||||
}
|
||||
if (dialog != null) dialog.dismiss();
|
||||
|
|
|
@ -95,15 +95,13 @@ public class HistoryActivity extends ListActivity {
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_clear_history:
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.menu_clear_history) {
|
||||
LinphoneManager.getLc().clearCallLogs();
|
||||
setListAdapter(new CallHistoryAdapter(this));
|
||||
|
||||
break;
|
||||
default:
|
||||
}
|
||||
else {
|
||||
Log.e("Unknown menu item [",item,"]");
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -332,29 +332,29 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
}
|
||||
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.addCall:
|
||||
int id = v.getId();
|
||||
if (id == R.id.addCall) {
|
||||
finish();
|
||||
break;
|
||||
case R.id.incallHang:
|
||||
}
|
||||
else if (id == R.id.incallHang) {
|
||||
terminateCurrentCallOrConferenceOrAll();
|
||||
break;
|
||||
case R.id.conf_header:
|
||||
}
|
||||
else if (id == R.id.conf_header) {
|
||||
boolean enterConf = !lc().isInConference();
|
||||
enterConferenceAndVirtualConfView(enterConf);
|
||||
break;
|
||||
case R.id.conf_header_details:
|
||||
}
|
||||
else if (id == R.id.conf_header_details) {
|
||||
onLongClick(v);
|
||||
break;
|
||||
case R.id.incallNumpadShow:
|
||||
}
|
||||
else if (id == R.id.incallNumpadShow) {
|
||||
showDialog(numpadDialogId);
|
||||
break;
|
||||
case R.id.conf_simple_merge:
|
||||
}
|
||||
else if (id == R.id.conf_simple_merge) {
|
||||
if (!lc().soundResourcesLocked()) {
|
||||
lc().addAllToConference();
|
||||
}
|
||||
break;
|
||||
case R.id.conf_simple_pause:
|
||||
}
|
||||
else if (id == R.id.conf_simple_pause) {
|
||||
LinphoneCall call = lc().getCurrentCall();
|
||||
if (call != null) {
|
||||
lc().pauseCall(call);
|
||||
|
@ -366,8 +366,8 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
lc().resumeCall(callToResume);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case R.id.conf_simple_video:
|
||||
}
|
||||
else if (id == R.id.conf_simple_video) {
|
||||
LinphoneCall vCall = lc().getCurrentCall();
|
||||
if (vCall != null) {
|
||||
if (!vCall.cameraEnabled() && vCall.getCurrentParamsCopy().getVideoEnabled()) {
|
||||
|
@ -378,8 +378,8 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
LinphoneActivity.instance().startVideoActivity(vCall, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
else {
|
||||
// mic, speaker
|
||||
super.onClick(v);
|
||||
}
|
||||
|
@ -431,21 +431,21 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
this.dialog = dialog;
|
||||
}
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.merge_to_conference:
|
||||
int id =v.getId();
|
||||
if (id == R.id.merge_to_conference) {
|
||||
lc().addToConference(call);
|
||||
break;
|
||||
case R.id.terminate_call:
|
||||
}
|
||||
else if (id == R.id.terminate_call) {
|
||||
lc().terminateCall(call);
|
||||
break;
|
||||
case R.id.transfer_existing:
|
||||
}
|
||||
else if (id == R.id.transfer_existing) {
|
||||
prepareForTransferingExistingOrNewCall(call);
|
||||
break;
|
||||
case R.id.transfer_new:
|
||||
}
|
||||
else if (id == R.id.transfer_new) {
|
||||
openUriPicker(UriPickerActivity.EXTRA_PICKER_TYPE_TRANSFER, transferCallId);
|
||||
mCallToTransfer = call;
|
||||
break;
|
||||
case R.id.addVideo:
|
||||
}
|
||||
else if (id == R.id.addVideo) {
|
||||
if (!call.cameraEnabled() && call.getCurrentParamsCopy().getVideoEnabled()) {
|
||||
// NoWebcam mode, we let it this way
|
||||
LinphoneActivity.instance().startVideoActivity(call, 0);
|
||||
|
@ -453,17 +453,17 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
|||
else if (!LinphoneManager.getInstance().addVideo()) {
|
||||
LinphoneActivity.instance().startVideoActivity(call, 0);
|
||||
}
|
||||
break;
|
||||
case R.id.set_auth_token_verified:
|
||||
}
|
||||
else if (id == R.id.set_auth_token_verified) {
|
||||
call.setAuthenticationTokenVerified(true);
|
||||
break;
|
||||
case R.id.set_auth_token_not_verified:
|
||||
}
|
||||
else if (id == R.id.set_auth_token_not_verified) {
|
||||
call.setAuthenticationTokenVerified(false);
|
||||
break;
|
||||
case R.id.encrypted:
|
||||
}
|
||||
else if (id == R.id.encrypted) {
|
||||
call.setAuthenticationTokenVerified(!call.isAuthenticationTokenVerified());
|
||||
break;
|
||||
default:
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("unknown id " + v.getId());
|
||||
}
|
||||
if (dialog != null) dialog.dismiss();
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.linphone;
|
|||
import static android.content.Intent.ACTION_MAIN;
|
||||
|
||||
import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener;
|
||||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.LinphoneCall;
|
||||
import org.linphone.core.LinphoneCall.State;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
|
@ -101,7 +102,8 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
|
|||
instance = this;
|
||||
setContentView(R.layout.main);
|
||||
|
||||
int rotation = getWindowManager().getDefaultDisplay().getRotation() * 90;
|
||||
@SuppressWarnings("deprecation")
|
||||
int rotation = Compatibility.getRotation(getWindowManager().getDefaultDisplay());
|
||||
// Inverse landscape rotation to initiate linphoneCore correctly
|
||||
if (rotation == 270)
|
||||
rotation = 90;
|
||||
|
@ -263,21 +265,22 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_settings:
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.menu_settings) {
|
||||
startprefActivity();
|
||||
return true;
|
||||
case R.id.menu_exit:
|
||||
}
|
||||
else if (id == R.id.menu_exit) {
|
||||
finish();
|
||||
stopService(new Intent(ACTION_MAIN)
|
||||
.setClass(this, LinphoneService.class));
|
||||
break;
|
||||
case R.id.menu_about:
|
||||
}
|
||||
else if (id == R.id.menu_about) {
|
||||
startActivity(new Intent(ACTION_MAIN)
|
||||
.setClass(this, AboutActivity.class));
|
||||
default:
|
||||
}
|
||||
else {
|
||||
Log.e("Unknown menu item [",item,"]");
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -52,7 +52,9 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
private void onServiceReady() {
|
||||
protected void onServiceReady() {
|
||||
LinphoneService.instance().setActivityToLaunchOnIncomingReceived(LinphoneActivity.class);
|
||||
|
||||
startActivity(new Intent()
|
||||
.setClass(this, LinphoneActivity.class)
|
||||
.setData(getIntent().getData()));
|
||||
|
|
|
@ -1050,11 +1050,21 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
|
||||
|
||||
private boolean isRinging;
|
||||
private boolean disableRinging = false;
|
||||
|
||||
public void disableRinging() {
|
||||
disableRinging = true;
|
||||
}
|
||||
|
||||
private synchronized void startRinging() {
|
||||
if (disableRinging ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Hacks.needGalaxySAudioHack()) {
|
||||
mAudioManager.setMode(MODE_RINGTONE);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (mAudioManager.shouldVibrate(VIBRATE_TYPE_RINGER) && mVibrator !=null) {
|
||||
long[] patern = {0,1000,1000};
|
||||
|
@ -1428,4 +1438,10 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
super(throwable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneCall call,
|
||||
LinphoneAddress from, byte[] event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
|
|||
username.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
|
||||
username.setTitle(getString(R.string.pref_username));
|
||||
username.setPersistent(true);
|
||||
username.setDialogMessage("Example: toto if your account is toto@sip.linphone.org");
|
||||
username.setDialogMessage(getString(R.string.pref_help_username));
|
||||
username.setKey(getString(R.string.pref_username_key) + getAccountNumber(n));
|
||||
username.setOnPreferenceChangeListener(preferenceChangedListener);
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity {
|
|||
domain.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
|
||||
domain.setTitle(getString(R.string.pref_domain));
|
||||
domain.setPersistent(true);
|
||||
domain.setDialogMessage("Example: sip.linphone.org if your account is toto@sip.linphone.org");
|
||||
domain.setDialogMessage(getString(R.string.pref_help_domain));
|
||||
domain.setKey(getString(R.string.pref_domain_key) + getAccountNumber(n));
|
||||
domain.setOnPreferenceChangeListener(preferenceChangedListener);
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.linphone.core.Log;
|
|||
import org.linphone.core.OnlineStatus;
|
||||
import org.linphone.mediastream.Version;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
|
@ -86,7 +87,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
/**
|
||||
* @throws RuntimeException service not instantiated
|
||||
*/
|
||||
static LinphoneService instance() {
|
||||
public static LinphoneService instance() {
|
||||
if (isReady()) return instance;
|
||||
|
||||
throw new RuntimeException("LinphoneService not instantiated yet");
|
||||
|
@ -242,6 +243,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
private Object[] mSetForegroundArgs = new Object[1];
|
||||
private Object[] mStartForegroundArgs = new Object[2];
|
||||
private Object[] mStopForegroundArgs = new Object[1];
|
||||
private Class<? extends Activity> incomingReceivedActivity = LinphoneActivity.class;
|
||||
|
||||
void invokeMethod(Method method, Object[] args) {
|
||||
try {
|
||||
|
@ -438,7 +440,21 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setActivityToLaunchOnIncomingReceived(Class<? extends Activity> activity) {
|
||||
incomingReceivedActivity = activity;
|
||||
|
||||
Intent notifIntent = new Intent(this, incomingReceivedActivity);
|
||||
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, 0);
|
||||
mNotif.setLatestEventInfo(this, mNotificationTitle,"", mNotifContentIntent);
|
||||
}
|
||||
|
||||
protected void onIncomingReceived() {
|
||||
//wakeup linphone
|
||||
startActivity(new Intent()
|
||||
.setClass(this, incomingReceivedActivity)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
||||
public void onCallStateChanged(final LinphoneCall call, final State state, final String message) {
|
||||
if (instance == null) {
|
||||
|
@ -446,10 +462,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
|||
return;
|
||||
}
|
||||
if (state == LinphoneCall.State.IncomingReceived) {
|
||||
//wakeup linphone
|
||||
startActivity(new Intent()
|
||||
.setClass(this, LinphoneActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
onIncomingReceived();
|
||||
}
|
||||
|
||||
if (state == State.CallUpdatedByRemote) {
|
||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
package org.linphone;
|
||||
|
||||
import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener;
|
||||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.LinphoneCall;
|
||||
import org.linphone.core.LinphoneCall.State;
|
||||
import org.linphone.core.LinphoneCallParams;
|
||||
|
@ -260,12 +261,12 @@ public class VideoCallActivity extends Activity implements
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.videocall_menu_back_to_dialer:
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.videocall_menu_back_to_dialer) {
|
||||
finish();
|
||||
LinphoneActivity.instance().startIncallActivity();
|
||||
break;
|
||||
case R.id.videocall_menu_change_resolution:
|
||||
}
|
||||
else if (id == R.id.videocall_menu_change_resolution) {
|
||||
LinphoneManager.getInstance().changeResolution();
|
||||
// previous call will cause graph reconstruction -> regive preview
|
||||
// window
|
||||
|
@ -273,11 +274,11 @@ public class VideoCallActivity extends Activity implements
|
|||
LinphoneManager.getLc()
|
||||
.setPreviewWindow(mVideoCaptureViewReady);
|
||||
rewriteChangeResolutionItem(item);
|
||||
break;
|
||||
case R.id.videocall_menu_terminate_call:
|
||||
}
|
||||
else if (id == R.id.videocall_menu_terminate_call) {
|
||||
LinphoneManager.getInstance().terminateCall();
|
||||
break;
|
||||
case R.id.videocall_menu_toggle_camera:
|
||||
}
|
||||
else if (id == R.id.videocall_menu_toggle_camera) {
|
||||
boolean camEnabled = LinphoneManager.getInstance()
|
||||
.toggleEnableCamera();
|
||||
updatePreview(camEnabled);
|
||||
|
@ -291,21 +292,20 @@ public class VideoCallActivity extends Activity implements
|
|||
mVideoCaptureViewReady);
|
||||
} else
|
||||
LinphoneManager.getLc().setPreviewWindow(null);
|
||||
break;
|
||||
case R.id.videocall_menu_switch_camera:
|
||||
int id = LinphoneManager.getLc().getVideoDevice();
|
||||
id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length;
|
||||
LinphoneManager.getLc().setVideoDevice(id);
|
||||
}
|
||||
else if (id == R.id.videocall_menu_switch_camera) {
|
||||
int videoDeviceId = LinphoneManager.getLc().getVideoDevice();
|
||||
videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length;
|
||||
LinphoneManager.getLc().setVideoDevice(videoDeviceId);
|
||||
CallManager.getInstance().updateCall();
|
||||
// previous call will cause graph reconstruction -> regive preview
|
||||
// window
|
||||
if (mVideoCaptureViewReady != null)
|
||||
LinphoneManager.getLc()
|
||||
.setPreviewWindow(mVideoCaptureViewReady);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
else {
|
||||
Log.e("Unknown menu item [", item, "]");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -457,7 +457,8 @@ public class VideoCallActivity extends Activity implements
|
|||
private void resizePreview() {
|
||||
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
|
||||
.getDefaultDisplay();
|
||||
int rotation = display.getRotation();
|
||||
|
||||
int rotation = Compatibility.getRotation(display);
|
||||
LayoutParams params;
|
||||
|
||||
int w, h;
|
||||
|
@ -500,48 +501,47 @@ public class VideoCallActivity extends Activity implements
|
|||
|
||||
public void onClick(View v) {
|
||||
resetControlsLayoutExpiration();
|
||||
switch (v.getId()) {
|
||||
case R.id.incallHang:
|
||||
int id = v.getId();
|
||||
if (id == R.id.incallHang) {
|
||||
terminateCurrentCallOrConferenceOrAll();
|
||||
break;
|
||||
case R.id.toggleSpeaker:
|
||||
}
|
||||
else if (id == R.id.toggleSpeaker) {
|
||||
if (((Checkable) v).isChecked()) {
|
||||
LinphoneManager.getInstance().routeAudioToSpeaker();
|
||||
} else {
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
}
|
||||
break;
|
||||
case R.id.incallNumpadShow:
|
||||
}
|
||||
else if (id == R.id.incallNumpadShow) {
|
||||
showDialog(numpadDialogId);
|
||||
break;
|
||||
case R.id.toggleMuteMic:
|
||||
}
|
||||
else if (id == R.id.toggleMuteMic) {
|
||||
LinphoneManager.getLc().muteMic(((Checkable) v).isChecked());
|
||||
break;
|
||||
case R.id.switch_camera:
|
||||
int id = LinphoneManager.getLc().getVideoDevice();
|
||||
id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length;
|
||||
LinphoneManager.getLc().setVideoDevice(id);
|
||||
}
|
||||
else if (id == R.id.switch_camera) {
|
||||
int videoDeviceId = LinphoneManager.getLc().getVideoDevice();
|
||||
videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length;
|
||||
LinphoneManager.getLc().setVideoDevice(videoDeviceId);
|
||||
CallManager.getInstance().updateCall();
|
||||
// previous call will cause graph reconstruction -> regive preview
|
||||
// window
|
||||
if (mVideoCaptureViewReady != null)
|
||||
LinphoneManager.getLc()
|
||||
.setPreviewWindow(mVideoCaptureViewReady);
|
||||
break;
|
||||
case R.id.conf_simple_pause:
|
||||
}
|
||||
else if (id == R.id.conf_simple_pause) {
|
||||
finish();
|
||||
LinphoneActivity.instance().startIncallActivity();
|
||||
LinphoneManager.getLc().pauseCall(videoCall);
|
||||
break;
|
||||
case R.id.conf_simple_video:
|
||||
}
|
||||
else if (id == R.id.conf_simple_video) {
|
||||
LinphoneCallParams params = videoCall.getCurrentParamsCopy();
|
||||
params.setVideoEnabled(false);
|
||||
LinphoneManager.getLc().updateCall(videoCall, params);
|
||||
break;
|
||||
case R.id.back:
|
||||
}
|
||||
else if (id == R.id.back) {
|
||||
finish();
|
||||
LinphoneActivity.instance().startIncallActivity();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
src/org/linphone/compatibility/API4Compatibility.java
Normal file
10
src/org/linphone/compatibility/API4Compatibility.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package org.linphone.compatibility;
|
||||
|
||||
import android.view.Display;
|
||||
|
||||
public class API4Compatibility {
|
||||
|
||||
public static int getRotation(Display display) {
|
||||
return display.getOrientation();
|
||||
}
|
||||
}
|
10
src/org/linphone/compatibility/API8Compatibility.java
Normal file
10
src/org/linphone/compatibility/API8Compatibility.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package org.linphone.compatibility;
|
||||
|
||||
import android.view.Display;
|
||||
|
||||
public class API8Compatibility {
|
||||
|
||||
public static int getRotation(Display display) {
|
||||
return display.getRotation();
|
||||
}
|
||||
}
|
17
src/org/linphone/compatibility/Compatibility.java
Normal file
17
src/org/linphone/compatibility/Compatibility.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package org.linphone.compatibility;
|
||||
|
||||
import org.linphone.mediastream.Version;
|
||||
|
||||
import android.view.Display;
|
||||
|
||||
public class Compatibility {
|
||||
|
||||
public static int getRotation(Display display) {
|
||||
if (Version.sdkStrictlyBelow(8)) {
|
||||
return API4Compatibility.getRotation(display);
|
||||
} else {
|
||||
return API8Compatibility.getRotation(display);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -155,4 +155,14 @@ class LinphoneCallImpl implements LinphoneCall {
|
|||
public float getPlayVolume() {
|
||||
return getPlayVolume(nativePtr);
|
||||
}
|
||||
|
||||
private native void takeSnapshot(long nativePtr, String path);
|
||||
public void takeSnapshot(String path) {
|
||||
takeSnapshot(nativePtr, path);
|
||||
}
|
||||
|
||||
private native void zoomVideo(long nativePtr, float factor, float cx, float cy);
|
||||
public void zoomVideo(float factor, float cx, float cy) {
|
||||
zoomVideo(nativePtr, factor, cx, cy);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,5 +45,15 @@ class LinphoneCallLogImpl implements LinphoneCallLog {
|
|||
public CallStatus getStatus() {
|
||||
throw new RuntimeException("not implemented yet");
|
||||
}
|
||||
@Override
|
||||
public String getStartDate() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public int getCallDuration() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.linphone.core;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
class LinphoneCoreImpl implements LinphoneCore {
|
||||
|
@ -704,4 +703,30 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
{
|
||||
setCpuCountNative(count);
|
||||
}
|
||||
private native void tunnelSetHttpProxyNative(long nativePtr, String proxy_host, int port, String username, String password);
|
||||
@Override
|
||||
public void tunnelSetHttpProxy(String proxy_host, int port,
|
||||
String username, String password) {
|
||||
tunnelSetHttpProxyNative(nativePtr,proxy_host, port, username, password);
|
||||
}
|
||||
|
||||
private native void removeCallLog(long nativePtr, LinphoneCallLog log);
|
||||
public void removeCallLog(LinphoneCallLog log) {
|
||||
removeCallLog(nativePtr, log);
|
||||
}
|
||||
|
||||
private native int getMissedCallsCount(long nativePtr);
|
||||
public int getMissedCallsCount() {
|
||||
return getMissedCallsCount(nativePtr);
|
||||
}
|
||||
|
||||
private native void resetMissedCallsCount(long nativePtr);
|
||||
public void resetMissedCallsCount() {
|
||||
resetMissedCallsCount(nativePtr);
|
||||
}
|
||||
|
||||
private native void refreshRegisters(long nativePtr);
|
||||
public void refreshRegisters() {
|
||||
refreshRegisters(nativePtr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ LOCAL_SRC_FILES = \
|
|||
libavcodec/jrevdct.c \
|
||||
libavcodec/mjpeg.c.arm \
|
||||
libavcodec/mjpegdec.c.arm \
|
||||
libavcodec/mjpegenc.c.arm \
|
||||
libavcodec/motion_est.c.arm \
|
||||
libavcodec/mpeg12data.c \
|
||||
libavcodec/mpeg4video.c.arm \
|
||||
|
|
2
submodules/externals/build/ffmpeg/config.h
vendored
2
submodules/externals/build/ffmpeg/config.h
vendored
|
@ -515,7 +515,7 @@
|
|||
#define CONFIG_HUFFYUV_ENCODER 0
|
||||
#define CONFIG_JPEGLS_ENCODER 0
|
||||
#define CONFIG_LJPEG_ENCODER 0
|
||||
#define CONFIG_MJPEG_ENCODER 0
|
||||
#define CONFIG_MJPEG_ENCODER 1
|
||||
#define CONFIG_MPEG1VIDEO_ENCODER 0
|
||||
#define CONFIG_MPEG2VIDEO_ENCODER 0
|
||||
#define CONFIG_MPEG4_ENCODER 1
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit af32518af41f97caee07070234a3475409b9a27d
|
||||
Subproject commit a70714c2e8a1f6f9958450cb612e3dc9895981e7
|
|
@ -1 +1 @@
|
|||
Subproject commit e2379a67051d30fb061ce738cf83e4d81f45bb14
|
||||
Subproject commit 9f02a12f4641989a225ee77bf6f403cd1c57d9e6
|
Loading…
Reference in a new issue