diff --git a/jni/Android.mk b/jni/Android.mk index 10dfa2522..26eaa3408 100755 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -78,9 +78,9 @@ include $(linphone-root-dir)/submodules/externals/build/ffmpeg/Android.mk else include $(linphone-root-dir)/submodules/externals/prebuilts/ffmpeg.mk endif -endif #armeabi-v7a include $(linphone-root-dir)/submodules/externals/build/libvpx/Android.mk +endif #armeabi-v7a ifeq ($(BUILD_GPLV3_ZRTP), 1) diff --git a/src/org/linphone/ContactPickerActivityNew.java b/src/org/linphone/ContactPickerActivityNew.java index 273fdfea4..c15789da8 100644 --- a/src/org/linphone/ContactPickerActivityNew.java +++ b/src/org/linphone/ContactPickerActivityNew.java @@ -21,7 +21,7 @@ package org.linphone; import java.util.ArrayList; import java.util.List; -import org.linphone.core.Version; +import org.linphone.mediastream.Version; import android.content.ContentUris; import android.content.Intent; diff --git a/src/org/linphone/DialerActivity.java b/src/org/linphone/DialerActivity.java index d5f67098b..64c8fa6f6 100644 --- a/src/org/linphone/DialerActivity.java +++ b/src/org/linphone/DialerActivity.java @@ -24,8 +24,8 @@ 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.mediastream.Version; import org.linphone.ui.AddVideoButton; import org.linphone.ui.AddressAware; import org.linphone.ui.AddressText; diff --git a/src/org/linphone/GL2JNIView.java b/src/org/linphone/GL2JNIView.java deleted file mode 100644 index ff7ee0c69..000000000 --- a/src/org/linphone/GL2JNIView.java +++ /dev/null @@ -1,274 +0,0 @@ -package org.linphone; - -import javax.microedition.khronos.egl.EGL10; -import javax.microedition.khronos.egl.EGLConfig; -import javax.microedition.khronos.egl.EGLContext; -import javax.microedition.khronos.egl.EGLDisplay; - -import android.content.Context; -import android.graphics.PixelFormat; -import android.opengl.GLSurfaceView; -import android.util.AttributeSet; -import android.util.Log; - -class GL2JNIView extends GLSurfaceView { - private static String TAG = "GL2JNIView"; - private static final boolean DEBUG = false; - - public GL2JNIView(Context context) { - super(context); - init(false, 0, 0); - } - - public GL2JNIView(Context context, AttributeSet att) { - super(context, att); - init(false, 0, 0); - } - - public GL2JNIView(Context context, boolean translucent, int depth, int stencil) { - super(context); - init(translucent, depth, stencil); - } - - private void init(boolean translucent, int depth, int stencil) { - - /* By default, GLSurfaceView() creates a RGB_565 opaque surface. - * If we want a translucent one, we should change the surface's - * format here, using PixelFormat.TRANSLUCENT for GL Surfaces - * is interpreted as any 32-bit surface with alpha by SurfaceFlinger. - */ - if (translucent) { - this.getHolder().setFormat(PixelFormat.TRANSLUCENT); - } - - /* Setup the context factory for 2.0 rendering. - * See ContextFactory class definition below - */ - setEGLContextFactory(new ContextFactory()); - - /* We need to choose an EGLConfig that matches the format of - * our surface exactly. This is going to be done in our - * custom config chooser. See ConfigChooser class definition - * below. - */ - setEGLConfigChooser( translucent ? - new ConfigChooser(8, 8, 8, 8, depth, stencil) : - new ConfigChooser(5, 6, 5, 0, depth, stencil) ); - } - - private static class ContextFactory implements GLSurfaceView.EGLContextFactory { - private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; - public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { - Log.w(TAG, "creating OpenGL ES 2.0 context"); - checkEglError("Before eglCreateContext", egl); - int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; - EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); - checkEglError("After eglCreateContext", egl); - return context; - } - - public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) { - egl.eglDestroyContext(display, context); - } - } - - private static void checkEglError(String prompt, EGL10 egl) { - int error; - while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) { - Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error)); - } - } - - private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser { - - public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) { - mRedSize = r; - mGreenSize = g; - mBlueSize = b; - mAlphaSize = a; - mDepthSize = depth; - mStencilSize = stencil; - } - - /* This EGL config specification is used to specify 2.0 rendering. - * We use a minimum size of 4 bits for red/green/blue, but will - * perform actual matching in chooseConfig() below. - */ - private static int EGL_OPENGL_ES2_BIT = 4; - private static int[] s_configAttribs2 = - { - EGL10.EGL_RED_SIZE, 4, - EGL10.EGL_GREEN_SIZE, 4, - EGL10.EGL_BLUE_SIZE, 4, - EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL10.EGL_NONE - }; - - public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { - - /* Get the number of minimally matching EGL configurations - */ - int[] num_config = new int[1]; - egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config); - - int numConfigs = num_config[0]; - - if (numConfigs <= 0) { - throw new IllegalArgumentException("No configs match configSpec"); - } - - /* Allocate then read the array of minimally matching EGL configs - */ - EGLConfig[] configs = new EGLConfig[numConfigs]; - egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config); - - if (DEBUG) { - printConfigs(egl, display, configs); - } - /* Now return the "best" one - */ - return chooseConfig(egl, display, configs); - } - - public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, - EGLConfig[] configs) { - for(EGLConfig config : configs) { - int d = findConfigAttrib(egl, display, config, - EGL10.EGL_DEPTH_SIZE, 0); - int s = findConfigAttrib(egl, display, config, - EGL10.EGL_STENCIL_SIZE, 0); - - // We need at least mDepthSize and mStencilSize bits - if (d < mDepthSize || s < mStencilSize) - continue; - - // We want an *exact* match for red/green/blue/alpha - int r = findConfigAttrib(egl, display, config, - EGL10.EGL_RED_SIZE, 0); - int g = findConfigAttrib(egl, display, config, - EGL10.EGL_GREEN_SIZE, 0); - int b = findConfigAttrib(egl, display, config, - EGL10.EGL_BLUE_SIZE, 0); - int a = findConfigAttrib(egl, display, config, - EGL10.EGL_ALPHA_SIZE, 0); - - if (r == mRedSize && g == mGreenSize && b == mBlueSize && a == mAlphaSize) - return config; - } - return null; - } - - private int findConfigAttrib(EGL10 egl, EGLDisplay display, - EGLConfig config, int attribute, int defaultValue) { - - if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) { - return mValue[0]; - } - return defaultValue; - } - - private void printConfigs(EGL10 egl, EGLDisplay display, - EGLConfig[] configs) { - int numConfigs = configs.length; - Log.w(TAG, String.format("%d configurations", numConfigs)); - for (int i = 0; i < numConfigs; i++) { - Log.w(TAG, String.format("Configuration %d:\n", i)); - printConfig(egl, display, configs[i]); - } - } - - private void printConfig(EGL10 egl, EGLDisplay display, - EGLConfig config) { - int[] attributes = { - EGL10.EGL_BUFFER_SIZE, - EGL10.EGL_ALPHA_SIZE, - EGL10.EGL_BLUE_SIZE, - EGL10.EGL_GREEN_SIZE, - EGL10.EGL_RED_SIZE, - EGL10.EGL_DEPTH_SIZE, - EGL10.EGL_STENCIL_SIZE, - EGL10.EGL_CONFIG_CAVEAT, - EGL10.EGL_CONFIG_ID, - EGL10.EGL_LEVEL, - EGL10.EGL_MAX_PBUFFER_HEIGHT, - EGL10.EGL_MAX_PBUFFER_PIXELS, - EGL10.EGL_MAX_PBUFFER_WIDTH, - EGL10.EGL_NATIVE_RENDERABLE, - EGL10.EGL_NATIVE_VISUAL_ID, - EGL10.EGL_NATIVE_VISUAL_TYPE, - 0x3030, // EGL10.EGL_PRESERVED_RESOURCES, - EGL10.EGL_SAMPLES, - EGL10.EGL_SAMPLE_BUFFERS, - EGL10.EGL_SURFACE_TYPE, - EGL10.EGL_TRANSPARENT_TYPE, - EGL10.EGL_TRANSPARENT_RED_VALUE, - EGL10.EGL_TRANSPARENT_GREEN_VALUE, - EGL10.EGL_TRANSPARENT_BLUE_VALUE, - 0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB, - 0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA, - 0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL, - 0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL, - EGL10.EGL_LUMINANCE_SIZE, - EGL10.EGL_ALPHA_MASK_SIZE, - EGL10.EGL_COLOR_BUFFER_TYPE, - EGL10.EGL_RENDERABLE_TYPE, - 0x3042 // EGL10.EGL_CONFORMANT - }; - String[] names = { - "EGL_BUFFER_SIZE", - "EGL_ALPHA_SIZE", - "EGL_BLUE_SIZE", - "EGL_GREEN_SIZE", - "EGL_RED_SIZE", - "EGL_DEPTH_SIZE", - "EGL_STENCIL_SIZE", - "EGL_CONFIG_CAVEAT", - "EGL_CONFIG_ID", - "EGL_LEVEL", - "EGL_MAX_PBUFFER_HEIGHT", - "EGL_MAX_PBUFFER_PIXELS", - "EGL_MAX_PBUFFER_WIDTH", - "EGL_NATIVE_RENDERABLE", - "EGL_NATIVE_VISUAL_ID", - "EGL_NATIVE_VISUAL_TYPE", - "EGL_PRESERVED_RESOURCES", - "EGL_SAMPLES", - "EGL_SAMPLE_BUFFERS", - "EGL_SURFACE_TYPE", - "EGL_TRANSPARENT_TYPE", - "EGL_TRANSPARENT_RED_VALUE", - "EGL_TRANSPARENT_GREEN_VALUE", - "EGL_TRANSPARENT_BLUE_VALUE", - "EGL_BIND_TO_TEXTURE_RGB", - "EGL_BIND_TO_TEXTURE_RGBA", - "EGL_MIN_SWAP_INTERVAL", - "EGL_MAX_SWAP_INTERVAL", - "EGL_LUMINANCE_SIZE", - "EGL_ALPHA_MASK_SIZE", - "EGL_COLOR_BUFFER_TYPE", - "EGL_RENDERABLE_TYPE", - "EGL_CONFORMANT" - }; - int[] value = new int[1]; - for (int i = 0; i < attributes.length; i++) { - int attribute = attributes[i]; - String name = names[i]; - if ( egl.eglGetConfigAttrib(display, config, attribute, value)) { - Log.w(TAG, String.format(" %s: %d\n", name, value[0])); - } else { - // Log.w(TAG, String.format(" %s: failed\n", name)); - while (egl.eglGetError() != EGL10.EGL_SUCCESS); - } - } - } - - // Subclasses can adjust these values: - protected int mRedSize; - protected int mGreenSize; - protected int mBlueSize; - protected int mAlphaSize; - protected int mDepthSize; - protected int mStencilSize; - private int[] mValue = new int[1]; - } -} \ No newline at end of file diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 07eb0e6bc..515e0bb50 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -21,24 +21,15 @@ package org.linphone; import static android.content.Intent.ACTION_MAIN; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.X509Certificate; -import java.util.Enumeration; import java.util.List; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; - import org.linphone.LinphoneManager.EcCalibrationListener; import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCoreException; import org.linphone.core.Log; -import org.linphone.core.Version; import org.linphone.core.LinphoneCore.EcCalibratorStatus; import org.linphone.core.LinphoneCore.RegistrationState; +import org.linphone.mediastream.Version; import org.linphone.mediastream.video.AndroidVideoWindowImpl; import android.app.AlertDialog; @@ -57,7 +48,6 @@ import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; import android.text.Html; -import android.util.Base64; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; @@ -151,50 +141,7 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener if (savedInstanceState !=null && savedInstanceState.getBoolean(SCREEN_IS_HIDDEN,false)) { hideScreen(true); - } - - if (false) { - try { - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - Enumeration al = ks.aliases(); - while(al.hasMoreElements()) { - Log.i(al.nextElement()); - } - Log.i("Enumeration done"); - } catch (KeyStoreException e) { - e.printStackTrace(); - } - - } else if (false) { - try { - String defaultAlg = TrustManagerFactory.getDefaultAlgorithm(); - TrustManagerFactory tmf = TrustManagerFactory.getInstance(defaultAlg); - // init is needed for Android to fill the javax.net.ssl.trustStore property - // ref : http://groups.google.com/group/android-developers/browse_thread/thread/366a3c8a6b2a7ad/163ff07c8ac39929?lnk=gst&q=SSL+root - tmf.init((KeyStore)null); - String trustStore = System.getProperty("javax.net.ssl.trustStore"); - Log.i(trustStore + "\n"); - - for(TrustManager tm: tmf.getTrustManagers()) { - X509TrustManager xtm = (X509TrustManager)tm; - Log.i(xtm.getAcceptedIssuers().length); - for(X509Certificate ca : xtm.getAcceptedIssuers()) { - byte[] encoded = ca.getEncoded(); - String s = new String(encoded); - byte[] d2 = Base64.decode(encoded, 0); - String s2 = new String(d2); - Log.i(ca.toString()); - - - } - } - } catch (KeyStoreException e) { - } catch (NoSuchAlgorithmException e) { - } catch (Exception e) { - e.printStackTrace(); - } - } - + } } @@ -294,7 +241,7 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener if (event==null || event.sensor == mAccelerometer) { int rot; - rot=getWindowManager().getDefaultDisplay().getOrientation(); + rot = AndroidVideoWindowImpl.rotationToAngle(getWindowManager().getDefaultDisplay().getOrientation()); if (rot != previousRotation) { Log.d("New device rotation: ", rot); diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 83d2acba0..c0259cef3 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -54,13 +54,13 @@ import org.linphone.core.LinphoneFriend; import org.linphone.core.LinphoneProxyConfig; import org.linphone.core.Log; import org.linphone.core.PayloadType; -import org.linphone.core.Version; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCore.EcCalibratorStatus; import org.linphone.core.LinphoneCore.FirewallPolicy; import org.linphone.core.LinphoneCore.GlobalState; import org.linphone.core.LinphoneCore.RegistrationState; import org.linphone.core.LinphoneCore.Transports; +import org.linphone.mediastream.Version; import org.linphone.mediastream.video.capture.AndroidVideoApi5JniWrapper; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration; import org.linphone.mediastream.video.capture.hwconf.Hacks; @@ -214,7 +214,7 @@ public final class LinphoneManager implements LinphoneCoreListener { instance.startLibLinphone(c); if (Version.isVideoCapable()) - AndroidVideoApi5JniWrapper.setAndroidSdkVersion(Build.VERSION.SDK_INT); + AndroidVideoApi5JniWrapper.setAndroidSdkVersion(Version.sdk()); return instance; } diff --git a/src/org/linphone/LinphonePreferencesActivity.java b/src/org/linphone/LinphonePreferencesActivity.java index 8ff041c5e..f69baa1b9 100644 --- a/src/org/linphone/LinphonePreferencesActivity.java +++ b/src/org/linphone/LinphonePreferencesActivity.java @@ -34,8 +34,8 @@ import java.util.List; import org.linphone.LinphoneManager.EcCalibrationListener; import org.linphone.core.LinphoneCoreException; import org.linphone.core.Log; -import org.linphone.core.Version; import org.linphone.core.LinphoneCore.EcCalibratorStatus; +import org.linphone.mediastream.Version; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration; import org.linphone.mediastream.video.capture.hwconf.Hacks; diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index a0effd66e..2acc250b9 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -24,10 +24,10 @@ import org.linphone.LinphoneManager.LinphoneServiceListener; import org.linphone.LinphoneManager.NewOutgoingCallUiListener; 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; +import org.linphone.mediastream.Version; import org.linphone.mediastream.video.capture.hwconf.Hacks; import android.app.Notification; diff --git a/src/org/linphone/VideoCallActivity.java b/src/org/linphone/VideoCallActivity.java index 2b7e1a847..c2cc060ff 100644 --- a/src/org/linphone/VideoCallActivity.java +++ b/src/org/linphone/VideoCallActivity.java @@ -20,6 +20,8 @@ package org.linphone; +import junit.runner.Version; + import org.linphone.core.Log; import org.linphone.mediastream.video.AndroidVideoWindowImpl; import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration; @@ -60,8 +62,9 @@ public class VideoCallActivity extends SoftVolumeActivity { mVideoCaptureView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); /* force surfaces Z ordering */ - mVideoView.setZOrderOnTop(false); - mVideoCaptureView.setZOrderOnTop(true); + if (org.linphone.mediastream.Version.sdkAboveOrEqual(5)) { + fixZOrder(); + } androidVideoWindowImpl = new AndroidVideoWindowImpl(mVideoView, mVideoCaptureView); androidVideoWindowImpl.setListener(new AndroidVideoWindowImpl.VideoWindowListener() { @@ -91,7 +94,7 @@ public class VideoCallActivity extends SoftVolumeActivity { // * onDestroy -> sendStaticImage(true) => destroy video graph // * onCreate -> sendStaticImage(false) => recreate the video graph. // Before creating the graph, the orientation must be known to LC => this is done here - LinphoneManager.getLc().setDeviceRotation(AndroidVideoWindowImpl.rotationToAngle(getWindowManager().getDefaultDisplay().getRotation())); + LinphoneManager.getLc().setDeviceRotation(AndroidVideoWindowImpl.rotationToAngle(getWindowManager().getDefaultDisplay().getOrientation())); if (!LinphoneManager.getInstance().shareMyCamera()) LinphoneManager.getInstance().sendStaticImage(false); @@ -99,6 +102,11 @@ public class VideoCallActivity extends SoftVolumeActivity { mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ON_AFTER_RELEASE,Log.TAG); mWakeLock.acquire(); } + + void fixZOrder() { + mVideoView.setZOrderOnTop(false); + mVideoCaptureView.setZOrderOnTop(true); + } @Override @@ -188,6 +196,7 @@ public class VideoCallActivity extends SoftVolumeActivity { protected void onPause() { Log.d("onPause VideoCallActivity"); LinphoneManager.getLc().setVideoWindow(null); + LinphoneManager.getLc().setPreviewWindow(null); LinphoneManager.getInstance().sendStaticImage(true); if (mWakeLock.isHeld()) mWakeLock.release(); super.onPause(); diff --git a/src/org/linphone/core/LinphoneCoreFactoryImpl.java b/src/org/linphone/core/LinphoneCoreFactoryImpl.java index 674b62450..19b0282f3 100644 --- a/src/org/linphone/core/LinphoneCoreFactoryImpl.java +++ b/src/org/linphone/core/LinphoneCoreFactoryImpl.java @@ -35,6 +35,8 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; +import org.linphone.mediastream.Version; + public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { private static void loadOptionalLibrary(String s) { diff --git a/src/org/linphone/core/Version.java b/src/org/linphone/core/Version.java deleted file mode 100644 index edbb25e8e..000000000 --- a/src/org/linphone/core/Version.java +++ /dev/null @@ -1,85 +0,0 @@ -/* -Version.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -import org.linphone.mediastream.video.capture.hwconf.Hacks; - -import android.os.Build; - -/** - * Centralize version access and allow simulation of lower versions. - * @author Guillaume Beraudo - */ -public class Version { - - public static final int API03_CUPCAKE_15 = 3; - public static final int API04_DONUT_16 = 4; - public static final int API06_ECLAIR_20 = 6; - public static final int API07_ECLAIR_21 = 7; - public static final int API08_FROYO_22 = 8; - public static final int API09_GINGERBREAD_23 = 9; - public static final int API11_HONEYCOMB_30 = 11; - - private static native boolean nativeHasZrtp(); - private static native boolean nativeHasNeon(); - private static Boolean hasNeon; - - private static final int buildVersion = - Integer.parseInt(Build.VERSION.SDK); -// 8; // 2.2 -// 7; // 2.1 - - public static final boolean sdkAboveOrEqual(int value) { - return buildVersion >= value; - } - - public static final boolean sdkStrictlyBelow(int value) { - return buildVersion < value; - } - - public static int sdk() { - return buildVersion; - } - - public static boolean isArmv7() { - try { - return sdkAboveOrEqual(4) - && Build.class.getField("CPU_ABI").get(null).toString().startsWith("armeabi-v7"); - } catch (Throwable e) {} - return false; - } - public static boolean hasNeon(){ - if (hasNeon == null) hasNeon = nativeHasNeon(); - return hasNeon; - } - public static boolean isVideoCapable() { - return !Version.sdkStrictlyBelow(5) && Version.hasNeon() && Hacks.hasCamera(); - } - - public static boolean hasZrtp(){ - return nativeHasZrtp(); - } - - public static void dumpCapabilities(){ - StringBuilder sb = new StringBuilder(" ==== Capabilities dump ====\n"); - sb.append("Has neon: ").append(Boolean.toString(hasNeon())).append("\n"); - sb.append("Has ZRTP: ").append(Boolean.toString(hasZrtp())).append("\n"); - Log.i(sb.toString()); - } -} diff --git a/submodules/externals/build/libvpx/Android.mk b/submodules/externals/build/libvpx/Android.mk index 37b208d29..64836bfe3 100755 --- a/submodules/externals/build/libvpx/Android.mk +++ b/submodules/externals/build/libvpx/Android.mk @@ -4,10 +4,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := libvpx -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - LOCAL_ARM_NEON := true -endif - LOCAL_ARM_MODE := arm ASM := s @@ -53,7 +49,7 @@ LOCAL_SRC_FILES += \ vp8/common/arm/filter_arm.c \ vp8/common/arm/loopfilter_arm.c \ vp8/common/arm/reconintra_arm.c \ - vp8/common/arm/neon/recon_neon.c + vp8/common/arm/neon/recon_neon.c.neon ASM_FILES = \ vp8/common/arm/armv6/bilinearfilter_v6.$(ASM) \ @@ -68,31 +64,31 @@ ASM_FILES = \ vp8/common/arm/armv6/recon_v6.$(ASM) \ vp8/common/arm/armv6/simpleloopfilter_v6.$(ASM) \ vp8/common/arm/armv6/sixtappredict8x4_v6.$(ASM) \ - vp8/common/arm/neon/bilinearpredict4x4_neon.$(ASM) \ - vp8/common/arm/neon/bilinearpredict8x4_neon.$(ASM) \ - vp8/common/arm/neon/bilinearpredict8x8_neon.$(ASM) \ - vp8/common/arm/neon/bilinearpredict16x16_neon.$(ASM) \ - vp8/common/arm/neon/copymem8x4_neon.$(ASM) \ - vp8/common/arm/neon/copymem8x8_neon.$(ASM) \ - vp8/common/arm/neon/copymem16x16_neon.$(ASM) \ - vp8/common/arm/neon/dc_only_idct_add_neon.$(ASM) \ - vp8/common/arm/neon/iwalsh_neon.$(ASM) \ - vp8/common/arm/neon/loopfilter_neon.$(ASM) \ - vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.$(ASM) \ - vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.$(ASM) \ - vp8/common/arm/neon/mbloopfilter_neon.$(ASM) \ - vp8/common/arm/neon/recon2b_neon.$(ASM) \ - vp8/common/arm/neon/recon4b_neon.$(ASM) \ - vp8/common/arm/neon/reconb_neon.$(ASM) \ - vp8/common/arm/neon/shortidct4x4llm_1_neon.$(ASM) \ - vp8/common/arm/neon/shortidct4x4llm_neon.$(ASM) \ - vp8/common/arm/neon/sixtappredict4x4_neon.$(ASM) \ - vp8/common/arm/neon/sixtappredict8x4_neon.$(ASM) \ - vp8/common/arm/neon/sixtappredict8x8_neon.$(ASM) \ - vp8/common/arm/neon/sixtappredict16x16_neon.$(ASM) \ - vp8/common/arm/neon/recon16x16mb_neon.$(ASM) \ - vp8/common/arm/neon/buildintrapredictorsmby_neon.$(ASM) \ - vp8/common/arm/neon/save_neon_reg.$(ASM) \ + vp8/common/arm/neon/bilinearpredict4x4_neon.$(ASM).neon \ + vp8/common/arm/neon/bilinearpredict8x4_neon.$(ASM).neon \ + vp8/common/arm/neon/bilinearpredict8x8_neon.$(ASM).neon \ + vp8/common/arm/neon/bilinearpredict16x16_neon.$(ASM).neon \ + vp8/common/arm/neon/copymem8x4_neon.$(ASM).neon \ + vp8/common/arm/neon/copymem8x8_neon.$(ASM).neon \ + vp8/common/arm/neon/copymem16x16_neon.$(ASM).neon \ + vp8/common/arm/neon/dc_only_idct_add_neon.$(ASM).neon \ + vp8/common/arm/neon/iwalsh_neon.$(ASM).neon \ + vp8/common/arm/neon/loopfilter_neon.$(ASM).neon \ + vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.$(ASM).neon \ + vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.$(ASM).neon \ + vp8/common/arm/neon/mbloopfilter_neon.$(ASM).neon \ + vp8/common/arm/neon/recon2b_neon.$(ASM).neon \ + vp8/common/arm/neon/recon4b_neon.$(ASM).neon \ + vp8/common/arm/neon/reconb_neon.$(ASM).neon \ + vp8/common/arm/neon/shortidct4x4llm_1_neon.$(ASM).neon \ + vp8/common/arm/neon/shortidct4x4llm_neon.$(ASM).neon \ + vp8/common/arm/neon/sixtappredict4x4_neon.$(ASM).neon \ + vp8/common/arm/neon/sixtappredict8x4_neon.$(ASM).neon \ + vp8/common/arm/neon/sixtappredict8x8_neon.$(ASM).neon \ + vp8/common/arm/neon/sixtappredict16x16_neon.$(ASM).neon \ + vp8/common/arm/neon/recon16x16mb_neon.$(ASM).neon \ + vp8/common/arm/neon/buildintrapredictorsmby_neon.$(ASM).neon \ + vp8/common/arm/neon/save_neon_reg.$(ASM).neon \ # vp8 subfolder [vp8cx.mk] LOCAL_SRC_FILES += \ @@ -147,20 +143,20 @@ ASM_FILES += \ vp8/encoder/arm/armv6/vp8_mse16x16_armv6.$(ASM) \ vp8/encoder/arm/armv6/vp8_variance8x8_armv6.$(ASM) \ vp8/encoder/arm/armv6/walsh_v6.$(ASM) \ - vp8/encoder/arm/neon/fastfdct4x4_neon.$(ASM) \ - vp8/encoder/arm/neon/fastfdct8x4_neon.$(ASM) \ - vp8/encoder/arm/neon/fastquantizeb_neon.$(ASM) \ - vp8/encoder/arm/neon/sad8_neon.$(ASM) \ - vp8/encoder/arm/neon/sad16_neon.$(ASM) \ - vp8/encoder/arm/neon/shortfdct_neon.$(ASM) \ - vp8/encoder/arm/neon/subtract_neon.$(ASM) \ - vp8/encoder/arm/neon/variance_neon.$(ASM) \ - vp8/encoder/arm/neon/vp8_mse16x16_neon.$(ASM) \ - vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.$(ASM) \ - vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.$(ASM) \ - vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.$(ASM) \ - vp8/encoder/arm/neon/vp8_memcpy_neon.$(ASM) \ - vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.$(ASM) \ + vp8/encoder/arm/neon/fastfdct4x4_neon.$(ASM).neon \ + vp8/encoder/arm/neon/fastfdct8x4_neon.$(ASM).neon \ + vp8/encoder/arm/neon/fastquantizeb_neon.$(ASM).neon \ + vp8/encoder/arm/neon/sad8_neon.$(ASM).neon \ + vp8/encoder/arm/neon/sad16_neon.$(ASM).neon \ + vp8/encoder/arm/neon/shortfdct_neon.$(ASM).neon \ + vp8/encoder/arm/neon/subtract_neon.$(ASM).neon \ + vp8/encoder/arm/neon/variance_neon.$(ASM).neon \ + vp8/encoder/arm/neon/vp8_mse16x16_neon.$(ASM).neon \ + vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon.$(ASM).neon \ + vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon.$(ASM).neon \ + vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon.$(ASM).neon \ + vp8/encoder/arm/neon/vp8_memcpy_neon.$(ASM).neon \ + vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.$(ASM).neon \ # vp8 subfolder [vp8dx.mk] LOCAL_SRC_FILES += \ @@ -182,16 +178,16 @@ LOCAL_SRC_FILES += \ vp8/decoder/arm/arm_dsystemdependent.c \ vp8/decoder/asm_dec_offsets.c \ vp8/decoder/arm/dequantize_arm.c \ - vp8/decoder/arm/neon/idct_blk_neon.c \ + vp8/decoder/arm/neon/idct_blk_neon.c.neon \ vp8/decoder/arm/armv6/idct_blk_v6.c ASM_FILES += \ - vp8/decoder/arm/neon/idct_dequant_dc_full_2x_neon.$(ASM) \ - vp8/decoder/arm/neon/idct_dequant_dc_0_2x_neon.$(ASM) \ - vp8/decoder/arm/neon/dequant_idct_neon.$(ASM) \ - vp8/decoder/arm/neon/idct_dequant_full_2x_neon.$(ASM) \ - vp8/decoder/arm/neon/idct_dequant_0_2x_neon.$(ASM) \ - vp8/decoder/arm/neon/dequantizeb_neon.$(ASM) \ + vp8/decoder/arm/neon/idct_dequant_dc_full_2x_neon.$(ASM).neon \ + vp8/decoder/arm/neon/idct_dequant_dc_0_2x_neon.$(ASM).neon \ + vp8/decoder/arm/neon/dequant_idct_neon.$(ASM).neon \ + vp8/decoder/arm/neon/idct_dequant_full_2x_neon.$(ASM).neon \ + vp8/decoder/arm/neon/idct_dequant_0_2x_neon.$(ASM).neon \ + vp8/decoder/arm/neon/dequantizeb_neon.$(ASM).neon \ vp8/decoder/arm/armv6/dequant_dc_idct_v6.$(ASM) \ vp8/decoder/arm/armv6/dequant_idct_v6.$(ASM) \ vp8/decoder/arm/armv6/dequantize_v6.$(ASM) @@ -208,19 +204,15 @@ LOCAL_SRC_FILES += \ vpx_scale/arm/yv12extend_arm.c \ vpx_scale/generic/scalesystemdependent.c ASM_FILES += \ - vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.$(ASM) \ - vpx_scale/arm/neon/vp8_vpxyv12_copyframeyonly_neon.$(ASM) \ - vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.$(ASM) \ - vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.$(ASM) \ + vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.$(ASM).neon \ + vpx_scale/arm/neon/vp8_vpxyv12_copyframeyonly_neon.$(ASM).neon \ + vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.$(ASM).neon \ + vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.$(ASM).neon \ LOCAL_SRC_FILES += vpx_ports/arm_cpudetect.c LOCAL_SRC_FILES += $(ASM_FILES) -LOCAL_CFLAGS += \ - -D__ARM_HAVE_NEON \ - -mfpu=neon - LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_C_INCLUDES += \