Use ShareMyCamera settings when video call
This commit is contained in:
parent
9991f9b249
commit
b726a7b0c8
3 changed files with 17 additions and 3 deletions
|
@ -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:
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
@ -148,6 +149,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
public static void removeListener(LinphoneSimpleListener listener) {
|
public static void removeListener(LinphoneSimpleListener listener) {
|
||||||
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) {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,12 +106,16 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
|
||||||
});
|
});
|
||||||
|
|
||||||
androidVideoWindowImpl.init();
|
androidVideoWindowImpl.init();
|
||||||
|
|
||||||
videoCall = LinphoneManager.getLc().getCurrentCall();
|
videoCall = LinphoneManager.getLc().getCurrentCall();
|
||||||
if (videoCall != null) {
|
if (videoCall != null) {
|
||||||
|
LinphoneManager lm = LinphoneManager.getInstance();
|
||||||
|
if (!lm.shareMyCamera() && !lm.isVideoInitiator() && videoCall.cameraEnabled()) {
|
||||||
|
lm.sendStaticImage(true);
|
||||||
|
}
|
||||||
|
|
||||||
updatePreview(videoCall.cameraEnabled());
|
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);
|
||||||
|
|
Loading…
Reference in a new issue