Fixed camera device switching during a video call
This commit is contained in:
parent
046f76a11c
commit
92a38cc33f
1 changed files with 7 additions and 8 deletions
|
@ -155,21 +155,20 @@ public class CallVideoFragment extends Fragment implements OnGestureListener, On
|
|||
String[] devices = LinphoneManager.getLc().getVideoDevicesList();
|
||||
int index = 0;
|
||||
for (String d : devices) {
|
||||
if (d == currentDevice) {
|
||||
if (d.equals(currentDevice)) {
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
String newDevice = devices[(index + 1) % devices.length];
|
||||
|
||||
String newDevice;
|
||||
if (index == 1)
|
||||
newDevice = devices[0];
|
||||
else
|
||||
newDevice = devices[1];
|
||||
LinphoneManager.getLc().setVideoDevice(newDevice);
|
||||
|
||||
CallManager.getInstance().updateCall();
|
||||
|
||||
// previous call will cause graph reconstruction -> regive preview
|
||||
// window
|
||||
if (mCaptureView != null) {
|
||||
LinphoneManager.getLc().setNativePreviewWindowId(mCaptureView);
|
||||
}
|
||||
} catch (ArithmeticException ae) {
|
||||
Log.e("Cannot swtich camera : no camera");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue