Use ShareMyCamera settings when video call

This commit is contained in:
Sylvain Berfini 2012-03-14 10:35:52 +01:00
parent 9991f9b249
commit b726a7b0c8
3 changed files with 17 additions and 3 deletions

View file

@ -115,6 +115,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
} }
setContentView(R.layout.incall_layout); setContentView(R.layout.incall_layout);
instance = this; instance = this;
LinphoneManager.getInstance().setVideoInitiator(false);
mAllowTransfers = getResources().getBoolean(R.bool.allow_transfers); mAllowTransfers = getResources().getBoolean(R.bool.allow_transfers);
@ -217,7 +218,6 @@ public class IncallActivity extends AbstractCalleesActivity implements
} }
@Override @Override
//FIXME : Store texts into resources
protected Dialog onCreateDialog(final int id) { protected Dialog onCreateDialog(final int id) {
switch (id) { switch (id) {
case promptVideoId: case promptVideoId:

View file

@ -136,6 +136,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
private String lastLcStatusMessage; private String lastLcStatusMessage;
private String basePath; private String basePath;
private static boolean sExited; private static boolean sExited;
private boolean videoInitiator = false;
private WakeLock mIncallWakeLock; private WakeLock mIncallWakeLock;
@ -149,6 +150,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
simpleListeners.remove(listener); simpleListeners.remove(listener);
} }
public boolean isVideoInitiator() {
return videoInitiator;
}
public void setVideoInitiator(boolean b) {
videoInitiator = b;
}
private LinphoneManager(final Context c, LinphoneServiceListener listener) { private LinphoneManager(final Context c, LinphoneServiceListener listener) {
sExited=false; sExited=false;
@ -1155,6 +1164,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
public boolean addVideo() { public boolean addVideo() {
LinphoneCall call = mLc.getCurrentCall(); LinphoneCall call = mLc.getCurrentCall();
enableCamera(call, true); enableCamera(call, true);
setVideoInitiator(true);
return reinviteWithVideo(); return reinviteWithVideo();
} }

View file

@ -109,9 +109,13 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
videoCall = LinphoneManager.getLc().getCurrentCall(); videoCall = LinphoneManager.getLc().getCurrentCall();
if (videoCall != null) { if (videoCall != null) {
updatePreview(videoCall.cameraEnabled()); LinphoneManager lm = LinphoneManager.getInstance();
if (!lm.shareMyCamera() && !lm.isVideoInitiator() && videoCall.cameraEnabled()) {
lm.sendStaticImage(true);
} }
updatePreview(videoCall.cameraEnabled());
}
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE); PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ON_AFTER_RELEASE,Log.TAG); mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ON_AFTER_RELEASE,Log.TAG);