Skip to content

Commit 56d6ecf

Browse files
committed
add NDK test
1 parent 14555d9 commit 56d6ecf

File tree

6 files changed

+70
-8
lines changed

6 files changed

+70
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/config.h
44
/config.mak
55
/j4a
6+
/jni/j4a
67
/output
78
/test/o_c
89

AndroidManifest.xml

Whitespace-only changes.

Makefile

+9-7
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,25 @@ TEST_JAVA_SRCS = \
7979
test/i_java/tv/danmaku/ijk/media/player/misc/IMediaDataSource.java \
8080
test/i_java/tv/danmaku/ijk/media/player/IjkMediaPlayer.java \
8181

82-
TEST_C_SRCS := $(TEST_JAVA_SRCS:test/i_java/%.java=test/o_c/%.c)
82+
TEST_C_SRCS := $(TEST_JAVA_SRCS:test/i_java/%.java=jni/j4a/class/%.c)
8383
TEST_H_SRCS := $(TEST_C_SRCS:%.c=%.h)
8484

85-
$(TEST_C_SRCS): test/o_c/%.c: j4a
85+
$(TEST_C_SRCS): jni/j4a/class/%.c: j4a
8686

87-
$(TEST_C_SRCS): test/o_c/%.c: test/i_java/%.java
88-
ifneq ("$<", "test/o_c/.c")
87+
$(TEST_C_SRCS): jni/j4a/class/%.c: test/i_java/%.java
88+
ifneq ("$<", "jni/j4a/class/.c")
8989
@mkdir -p $(shell dirname $@)
9090
$(J4A) $< -o $@
9191
@diff test/ref_c/$*.c $@
92-
@diff test/ref_c/$*.h test/o_c/$*.h
92+
@diff test/ref_c/$*.h jni/j4a/class/$*.h
9393
endif
9494

95-
test: cleantest j4a $(TEST_C_SRCS)
95+
test: resettest j4a $(TEST_C_SRCS)
9696

97-
cleantest:
97+
resettest:
9898
@rm -f $(TEST_C_SRCS)
99+
@mkdir -p jni
100+
@cp -r include/* jni/
99101

100102

101103

include/j4a/j4a_internal.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
#include "j4a_internal.h"
22-
#include "j4a/android/os/Build.h"
22+
#include "j4a/class/android/os/Build.h"
2323

2424
/********************
2525
* Exception Handle

jni/Android.mk

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# copyright (c) 2016 Zhang Rui <[email protected]>
3+
#
4+
# This file is part of ijkPlayer.
5+
#
6+
# ijkPlayer is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# ijkPlayer is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
# Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with ijkPlayer; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
20+
LOCAL_PATH := $(call my-dir)
21+
22+
include $(CLEAR_VARS)
23+
24+
LOCAL_CFLAGS += -std=c99
25+
LOCAL_C_INCLUDES += $(LOCAL_PATH)
26+
27+
# LOCAL_STATIC_LIBRARIES += cpufeatures
28+
# $(call import-module,android/cpufeatures)
29+
30+
# LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/*.c))
31+
LOCAL_SRC_FILES += j4a/j4a_allclasses.c
32+
LOCAL_SRC_FILES += j4a/j4a_internal.c
33+
34+
LOCAL_MODULE := j4a
35+
include $(BUILD_STATIC_LIBRARY)

jni/Application.mk

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# copyright (c) 2016 Zhang Rui <[email protected]>
3+
#
4+
# This file is part of ijkPlayer.
5+
#
6+
# ijkPlayer is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# ijkPlayer is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
# Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with ijkPlayer; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
20+
APP_OPTIM := release
21+
APP_PLATFORM := android-9
22+
APP_ABI := armeabi-v7a
23+
NDK_TOOLCHAIN_VERSION=4.8
24+
APP_PIE := false

0 commit comments

Comments
 (0)