Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
81dd82dc
Commit
81dd82dc
authored
Mar 04, 2013
by
jehan
Browse files
add libneon to check if cpu is neon capable
parent
b2ddf6ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
1 deletion
+109
-1
java/src/org/linphone/mediastream/CpuUtils.java
java/src/org/linphone/mediastream/CpuUtils.java
+34
-0
jni/Application.mk
jni/Application.mk
+1
-1
jni/libneon/Android.mk
jni/libneon/Android.mk
+37
-0
jni/libneon/libneon_jni.cc
jni/libneon/libneon_jni.cc
+37
-0
No files found.
java/src/org/linphone/mediastream/CpuUtils.java
0 → 100644
View file @
81dd82dc
package
org.linphone.mediastream
;
/*
CpuUtils.java
Copyright (C) 2013 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.
*/
/**
* @author Sylvain Berfini
*/
public
class
CpuUtils
{
private
native
boolean
hasNeon
();
public
CpuUtils
()
{
}
public
boolean
isCpuNeon
()
{
return
hasNeon
();
}
}
jni/Application.mk
View file @
81dd82dc
APP_PROJECT_PATH
:=
$(
call
my-dir
)
/../
APP_MODULES
:=
libspeex libgsm libortp libavutil libavcore libavcodec libswscale libvpx libmediastreamer2
APP_MODULES
:=
libneon
libspeex libgsm libortp libavutil libavcore libavcodec libswscale libvpx libmediastreamer2
APP_STL
:=
stlport_static
...
...
jni/libneon/Android.mk
0 → 100755
View file @
81dd82dc
##
## Android.mk -Android build script-
##
##
## 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.
##
LOCAL_PATH
:=
$(
call
my-dir
)
include
$(CLEAR_VARS)
LOCAL_CPP_EXTENSION
:=
.cc
LOCAL_SRC_FILES
:=
\
libneon_jni.cc
LOCAL_STATIC_LIBRARIES
:=
cpufeatures
LOCAL_MODULE
:=
libneon
include
$(BUILD_SHARED_LIBRARY)
$(call
import-module,android/cpufeatures)
jni/libneon/libneon_jni.cc
0 → 100644
View file @
81dd82dc
/*
libneon_jni.cc
Copyright (C) 2013 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.
*/
#include <jni.h>
extern
"C"
{
#include <cpu-features.h>
#include <android/log.h>
static
JavaVM
*
jvm
=
0
;
JNIEXPORT
jint
JNICALL
JNI_OnLoad
(
JavaVM
*
ajvm
,
void
*
reserved
)
{
jvm
=
ajvm
;
return
JNI_VERSION_1_2
;
}
extern
"C"
jboolean
Java_org_linphone_mediastream_CpuUtils_hasNeon
(
JNIEnv
*
env
,
jobject
thiz
)
{
return
android_getCpuFeatures
()
&
ANDROID_CPU_ARM_FEATURE_NEON
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment