disable video on non capable hardware

This commit is contained in:
Jehan Monnier 2011-07-01 18:08:04 +02:00
parent f1449c9897
commit 034e979b5f
4 changed files with 8 additions and 3 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone"
android:versionCode="1105" android:versionName="1.1.5" android:installLocation="auto">
android:versionCode="1106" android:versionName="1.1.6" android:installLocation="auto">
<uses-sdk android:minSdkVersion="3" />

View file

@ -96,7 +96,7 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E
detectAudioCodec(pref_codec_amr_key,"AMR",8000);
// No video
if (Version.sdkStrictlyBelow(5) || !Version.hasNeon() || !Hacks.hasCamera()) {
if (!Version.isVideoCapable()) {
uncheckAndDisableCheckbox(pref_video_enable_key);
}
if (prefs().getBoolean(LinphoneActivity.PREF_FIRST_LAUNCH,true)) {

View file

@ -25,6 +25,7 @@ import org.linphone.LinphoneManager.NewOutgoingCallUiListener;
import org.linphone.core.Hacks;
import org.linphone.core.LinphoneCall;
import org.linphone.core.Log;
import org.linphone.core.Version;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCore.GlobalState;
import org.linphone.core.LinphoneCore.RegistrationState;
@ -234,8 +235,9 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
.setClass(this, LinphoneActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else if (state == LinphoneCall.State.StreamsRunning) {
if (!VideoCallActivity.launched && LinphoneActivity.isInstanciated()
if (Version.isVideoCapable()
&& getResources().getBoolean(R.bool.use_video_activity)
&& !VideoCallActivity.launched && LinphoneActivity.isInstanciated()
&& call.getCurrentParamsCopy().getVideoEnabled()) {
// Do not call if video activity already launched as it would cause a pause() of the launched one
// and a race condition with capture surfaceview leading to a crash

View file

@ -65,5 +65,8 @@ public class Version {
if (hasNeon == null) hasNeon = nativeHasNeon();
return hasNeon;
}
public static boolean isVideoCapable() {
return !Version.sdkStrictlyBelow(5) && Version.hasNeon() && Hacks.hasCamera();
}
}