Skip to content

Commit 3d016a1

Browse files
author
Chang HaoHao[常浩浩]
committed
first commit
1 parent 049adaa commit 3d016a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2509
-0
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild

.idea/encodings.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
defaultConfig {
6+
applicationId "com.byteflow.app"
7+
minSdkVersion 21
8+
targetSdkVersion 28
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
externalNativeBuild {
13+
cmake {
14+
cppFlags "-std=c++11 -frtti -fexceptions"
15+
}
16+
}
17+
18+
ndk {
19+
abiFilters "arm64-v8a", "armeabi-v7a"
20+
}
21+
}
22+
buildTypes {
23+
release {
24+
minifyEnabled false
25+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26+
}
27+
}
28+
externalNativeBuild {
29+
cmake {
30+
path "src/main/cpp/CMakeLists.txt"
31+
}
32+
}
33+
}
34+
35+
dependencies {
36+
implementation fileTree(dir: 'libs', include: ['*.jar'])
37+
implementation 'com.android.support:appcompat-v7:28.0.0'
38+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
39+
implementation 'com.android.support:design:28.0.0'
40+
testImplementation 'junit:junit:4.12'
41+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
42+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
43+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.byteflow.app;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.byteflow.app", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.byteflow.app">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity"
13+
android:screenOrientation="portrait">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
17+
<category android:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
</application>
21+
22+
</manifest>

app/src/main/assets/YUV_Image_840x1074.NV21

+116
Large diffs are not rendered by default.

app/src/main/cpp/CMakeLists.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# For more information about using CMake with Android Studio, read the
2+
# documentation: https://d.android.com/studio/projects/add-native-code.html
3+
4+
# Sets the minimum version of CMake required to build the native library.
5+
6+
cmake_minimum_required(VERSION 3.4.1)
7+
8+
include_directories(
9+
util
10+
render
11+
sample
12+
)
13+
14+
# Creates and names a library, sets it as either STATIC
15+
# or SHARED, and provides the relative paths to its source code.
16+
# You can define multiple libraries, and CMake builds them for you.
17+
# Gradle automatically packages shared libraries with your APK.
18+
19+
add_library( # Sets the name of the library.
20+
native-render
21+
22+
# Sets the library as a shared library.
23+
SHARED
24+
25+
# Provides a relative path to your source file(s).
26+
JniImpl.cpp
27+
render/MyGLRenderContext.cpp
28+
util/GLUtils.cpp
29+
sample/TriangleSample.cpp
30+
sample/TextureMapSample.cpp
31+
sample/NV21TextureMapSample.cpp
32+
)
33+
34+
# Searches for a specified prebuilt library and stores the path as a
35+
# variable. Because CMake includes system libraries in the search path by
36+
# default, you only need to specify the name of the public NDK library
37+
# you want to add. CMake verifies that the library exists before
38+
# completing its build.
39+
40+
find_library( # Sets the name of the path variable.
41+
log-lib
42+
43+
# Specifies the name of the NDK library that
44+
# you want CMake to locate.
45+
log )
46+
47+
# Specifies libraries CMake should link to your target library. You
48+
# can link multiple libraries, such as libraries you define in this
49+
# build script, prebuilt third-party libraries, or system libraries.
50+
51+
target_link_libraries( # Specifies the target library.
52+
native-render
53+
54+
# Links the target library to the log library
55+
# included in the NDK.
56+
${log-lib}
57+
GLESv3
58+
)

0 commit comments

Comments
 (0)