Merge branch 'master' of git.linphone.org:linphone-android
This commit is contained in:
commit
878013c867
7 changed files with 49 additions and 32 deletions
|
@ -23,6 +23,7 @@ import java.util.List;
|
|||
import org.linphone.core.LinphoneCallParams;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.Log;
|
||||
import org.linphone.core.Version;
|
||||
import org.linphone.core.VideoSize;
|
||||
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||
|
||||
|
@ -83,7 +84,7 @@ public class BandwidthManager {
|
|||
public void updateWithProfileSettings(LinphoneCore lc, LinphoneCallParams callParams) {
|
||||
// Setting Linphone Core Preferred Video Size
|
||||
boolean bandwidthOKForVideo = isVideoPossible();
|
||||
if (bandwidthOKForVideo) {
|
||||
if (bandwidthOKForVideo && Version.isVideoCapable()) {
|
||||
AndroidCameraRecordManager acrm = AndroidCameraRecordManager.getInstance();
|
||||
boolean isPortrait=acrm.isFrameToBeShownPortrait();
|
||||
VideoSize targetVideoSize=maxSupportedVideoSize(isPortrait, getMaximumVideoSize(isPortrait),
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.linphone.core.CallDirection;
|
|||
import org.linphone.core.LinphoneCall;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.Log;
|
||||
import org.linphone.core.Version;
|
||||
import org.linphone.core.LinphoneCall.State;
|
||||
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||
import org.linphone.ui.AddVideoButton;
|
||||
|
@ -314,15 +315,18 @@ public class DialerActivity extends SoftVolumeActivity implements LinphoneGuiLis
|
|||
((CallButton) incomingCallView.findViewById(R.id.Call)).setExternalClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
LinphoneManager.getInstance().resetCameraFromPreferences();
|
||||
if (Version.isVideoCapable()) {
|
||||
LinphoneManager.getInstance().resetCameraFromPreferences();
|
||||
|
||||
// Privacy setting to not share the user camera by default
|
||||
boolean prefVideoEnable = LinphoneManager.getInstance().isVideoEnabled();
|
||||
boolean prefAutoShareMyCamera = mPref.getBoolean(getString(R.string.pref_video_automatically_share_my_video_key), false);
|
||||
boolean videoMuted = !(prefVideoEnable && prefAutoShareMyCamera);
|
||||
AndroidCameraRecordManager.getInstance().setMuted(videoMuted);
|
||||
// Privacy setting to not share the user camera by default
|
||||
boolean prefVideoEnable = LinphoneManager.getInstance().isVideoEnabled();
|
||||
int key = R.string.pref_video_automatically_share_my_video_key;
|
||||
boolean prefAutoShareMyCamera = mPref.getBoolean(getString(key), false);
|
||||
boolean videoMuted = !(prefVideoEnable && prefAutoShareMyCamera);
|
||||
AndroidCameraRecordManager.getInstance().setMuted(videoMuted);
|
||||
|
||||
LinphoneManager.getLc().getCurrentCall().enableCamera(prefAutoShareMyCamera);
|
||||
LinphoneManager.getLc().getCurrentCall().enableCamera(prefAutoShareMyCamera);
|
||||
}
|
||||
}
|
||||
});
|
||||
((HangCallButton) incomingCallView.findViewById(R.id.Decline)).setExternalClickListener(new OnClickListener() {
|
||||
|
|
|
@ -129,8 +129,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
mPref = PreferenceManager.getDefaultSharedPreferences(c);
|
||||
mPowerManager = (PowerManager) c.getSystemService(Context.POWER_SERVICE);
|
||||
mR = c.getResources();
|
||||
|
||||
AndroidCameraRecordManager.getInstance().startOrientationSensor(c.getApplicationContext());
|
||||
}
|
||||
|
||||
private static final int LINPHONE_VOLUME_STREAM = STREAM_VOICE_CALL;
|
||||
|
@ -146,15 +144,12 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
|
||||
private BroadcastReceiver mKeepAliveReceiver = new KeepAliveReceiver();
|
||||
|
||||
private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
|
||||
LinphoneCall call = mLc.getCurrentCall();
|
||||
boolean paused = false;
|
||||
if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) {
|
||||
Log.d("Hack pausing call to have speaker=",speakerOn);
|
||||
mLc.pauseCall(call);
|
||||
paused = true;
|
||||
}
|
||||
|
||||
private native void hackSpeakerState(boolean speakerOn);
|
||||
@SuppressWarnings("unused")
|
||||
private static void sRouteAudioToSpeakerHelperHelper(boolean speakerOn) {
|
||||
getInstance().routeAudioToSpeakerHelperHelper(speakerOn);
|
||||
}
|
||||
private void routeAudioToSpeakerHelperHelper(boolean speakerOn) {
|
||||
if (Hacks.needGalaxySAudioHack() || lpm.useGalaxySHack())
|
||||
setAudioModeIncallForGalaxyS();
|
||||
|
||||
|
@ -169,12 +164,17 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
} else {
|
||||
mAudioManager.setSpeakerphoneOn(speakerOn);
|
||||
}
|
||||
|
||||
if (paused) {
|
||||
Log.d("Hack resuming call to have speaker=",speakerOn);
|
||||
mLc.resumeCall(call);
|
||||
}
|
||||
private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
|
||||
final LinphoneCall call = mLc.getCurrentCall();
|
||||
if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) {
|
||||
Log.d("Hack to have speaker=",speakerOn," while on call");
|
||||
hackSpeakerState(speakerOn);
|
||||
} else {
|
||||
routeAudioToSpeakerHelperHelper(speakerOn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void routeAudioToSpeaker() {
|
||||
routeAudioToSpeakerHelper(true);
|
||||
|
@ -203,6 +203,9 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
instance = new LinphoneManager(c);
|
||||
instance.serviceListener = listener;
|
||||
instance.startLibLinphone(c);
|
||||
if (Version.isVideoCapable()) {
|
||||
AndroidCameraRecordManager.getInstance().startOrientationSensor(c.getApplicationContext());
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -241,10 +244,16 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
lAddress.setDisplayName(address.getDisplayedName());
|
||||
|
||||
try {
|
||||
boolean prefVideoEnable = isVideoEnabled();
|
||||
boolean prefInitiateWithVideo = mPref.getBoolean(mR.getString(R.string.pref_video_initiate_call_with_video_key), false);
|
||||
resetCameraFromPreferences();
|
||||
CallManager.getInstance().inviteAddress(lAddress, prefVideoEnable && prefInitiateWithVideo);
|
||||
if (Version.isVideoCapable()) {
|
||||
boolean prefVideoEnable = isVideoEnabled();
|
||||
int key = R.string.pref_video_initiate_call_with_video_key;
|
||||
boolean prefInitiateWithVideo = mPref.getBoolean(mR.getString(key), false);
|
||||
resetCameraFromPreferences();
|
||||
CallManager.getInstance().inviteAddress(lAddress, prefVideoEnable && prefInitiateWithVideo);
|
||||
} else {
|
||||
CallManager.getInstance().inviteAddress(lAddress, false);
|
||||
}
|
||||
|
||||
|
||||
} catch (LinphoneCoreException e) {
|
||||
serviceListener.tryingNewOutgoingCallButCannotGetCallParameters();
|
||||
|
|
|
@ -98,6 +98,8 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E
|
|||
// No video
|
||||
if (!Version.isVideoCapable()) {
|
||||
uncheckAndDisableCheckbox(pref_video_enable_key);
|
||||
} else if (!AndroidCameraRecordManager.getInstance().hasFrontCamera()) {
|
||||
uncheckDisableAndHideCheckbox(R.string.pref_video_use_front_camera_key);
|
||||
}
|
||||
if (prefs().getBoolean(LinphoneActivity.PREF_FIRST_LAUNCH,true)) {
|
||||
if (fastCpu) {
|
||||
|
@ -110,9 +112,7 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E
|
|||
|
||||
detectVideoCodec(R.string.pref_video_codec_h264_key, "H264");
|
||||
|
||||
if (!AndroidCameraRecordManager.getInstance().hasFrontCamera()) {
|
||||
uncheckDisableAndHideCheckbox(R.string.pref_video_use_front_camera_key);
|
||||
}
|
||||
|
||||
|
||||
if (Hacks.needSoftvolume()) checkAndDisableCheckbox(R.string.pref_audio_soft_volume_key);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public final class Hacks {
|
|||
sleep(200);
|
||||
}
|
||||
|
||||
private static final void sleep(int time) {
|
||||
public static final void sleep(int time) {
|
||||
try {
|
||||
Thread.sleep(time);
|
||||
} catch(InterruptedException ie){}
|
||||
|
|
|
@ -67,6 +67,9 @@ public class AndroidCameraRecordManager {
|
|||
|
||||
// singleton
|
||||
private AndroidCameraRecordManager() {
|
||||
if (!Version.isVideoCapable()) { // imply sdk>=5
|
||||
throw new RuntimeException("AndroidCameraRecordManager: hardware is not video capable");
|
||||
}
|
||||
cc = Version.sdkAboveOrEqual(9) ? new AndroidCameraConf9() : new AndroidCameraConf5();
|
||||
Log.i("=== Detected " + cc.getFoundCameras()+ " ===");
|
||||
cameraId = cc.getFoundCameras().defaultC;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a0b9b02506a8a4eb97f7eb44e376ea1999e4bd9b
|
||||
Subproject commit 68df42b2924930043bbf466b0c6eab1409fb6c3e
|
Loading…
Reference in a new issue