Skip to content

Commit

Permalink
Merge pull request #1 from wlanjie/master
Browse files Browse the repository at this point in the history
2020
  • Loading branch information
daviddvL authored Jun 6, 2022
2 parents 2aaeb30 + 309618a commit 4f65ce9
Show file tree
Hide file tree
Showing 71 changed files with 3,492 additions and 772 deletions.
12 changes: 9 additions & 3 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-trinity-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8010)
[![Build Status](https://api.travis-ci.org/wlanjie/trinity.svg?branch=master)](https://travis-ci.org/wlanjie/trinity/)
[![Download](https://api.bintray.com/packages/wlanjie/maven/trinity/images/download.svg?version=0.2.7)](https://bintray.com/wlanjie/maven/trinity/0.2.7/link)
[![Download](https://api.bintray.com/packages/wlanjie/maven/trinity/images/download.svg?version=0.2.9.1)](https://bintray.com/wlanjie/maven/trinity/0.2.9.1/link)
![platform](https://img.shields.io/badge/platform-Android-orange.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

**trinity是一个开源的拍摄和短视频处理工具,用kotlin和c++编写,实现了大部分短视频编辑软件热门功能。**

[apk下载](https://github.com/wlanjie/trinity/blob/master/trinity.apk)
## Apk 下载
- 请在Actions中每次commit ci编译的结果中下载

![演示](screen_shot.gif)

Expand Down Expand Up @@ -266,7 +267,7 @@ adb devices
### 添加jcenter依赖
``` gradle
dependencies {
implementation 'com.github.wlanjie:trinity:0.2.7'
implementation 'com.github.wlanjie:trinity:0.2.9.1'
}
```

Expand Down Expand Up @@ -612,6 +613,11 @@ mVideoEditor.deleteAction(actionId)
```

#### 开始预览
- 准备
``` kotlin
mVideoEditor.prepare()
```

- 播放
``` kotlin
/**
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# trinity

# If the trinity project is helpful to you, you can use paypal to support the author
```
https://www.paypal.me/wlanjie
```

[中文文档](https://github.com/wlanjie/trinity/blob/master/README-zh.md)

![icon~](https://github.com/wlanjie/trinity/blob/master/[email protected])

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-trinity-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8010)
[![Download](https://api.bintray.com/packages/wlanjie/maven/trinity/images/download.svg?version=0.2.7)](https://bintray.com/wlanjie/maven/trinity/0.2.7/link)
[![Download](https://api.bintray.com/packages/wlanjie/maven/trinity/images/download.svg?version=0.3.2)](https://bintray.com/wlanjie/maven/trinity/0.3.2/link)
![platform](https://img.shields.io/badge/platform-Android-orange.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

**trinity is an open source shooting and short video processing tool, written in kotlin and c++, which implements most of the popular features of short video editing software.**

[apk download](https://github.com/wlanjie/trinity/blob/master/trinity.apk)
## Apk download
- Please check actions options ci build result

![](screen_shot.gif)

Expand All @@ -27,7 +33,7 @@

## Code Specification
- Kotlin indent using 2 spaces indent
- C++ code follows [google c ++ style guide](https://en-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/)
- C++ code follows [google c++ style guide](https://en-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/)

## System version

Expand Down Expand Up @@ -250,9 +256,19 @@ Just enter the device name in the terminal
### Add jcenter dependency
``` gradle
dependencies {
implementation 'com.github.wlanjie:trinity:0.2.7'
implementation 'com.github.wlanjie:trinity:0.2.9.1'
}
```
### Load Libraries in Application class
```
companion object {
init {
System.loadLibrary("trinity")
System.loadLibrary("c++_shared")
System.loadLibrary("marsxlog")
}
}
```

### Permission requirements
``` xml
Expand Down Expand Up @@ -595,6 +611,11 @@ mVideoEditor.deleteAction(actionId)
```

#### Start preview
- Prepare
``` kotlin
mVideoEditor.prepare()
```

- Play
``` kotlin
/**
Expand Down Expand Up @@ -675,4 +696,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
```
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0.1"
versionName "1.0.2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

ndk {
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/assets/effect/spaceBear/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"effect": [
{
"type": "infoSticker",
"name": "spaceBear",
"config": "spaceBear/spaceBear.json",
"data": [
{
"name": "scale",
"type": 3,
"data": [
1.0
]
},
{
"name": "rotate",
"type": 3,
"data": [
0
]
}
]
}
],
"version": "3.1.1"
}
139 changes: 139 additions & 0 deletions app/src/main/assets/effect/spaceBear/spaceBear/spaceBear.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"frames": [
{
"filename": "img_000.png",
"frame": {
"h": 280.0,
"w": 271.0,
"x": 2,
"y": 2.0
},
"rotated": false,
"sourceSize": {
"h": 280.0,
"w": 271.0
},
"spriteSourceSize": {
"h": 280.0,
"w": 271.0,
"x": 0,
"y": 0
},
"trimmed": false
},
{
"filename": "img_001.png",
"frame": {
"h": 280.0,
"w": 271.0,
"x": 2,
"y": 284.0
},
"rotated": false,
"sourceSize": {
"h": 280.0,
"w": 271.0
},
"spriteSourceSize": {
"h": 280.0,
"w": 271.0,
"x": 0,
"y": 0
},
"trimmed": false
},
{
"filename": "img_002.png",
"frame": {
"h": 280.0,
"w": 271.0,
"x": 2,
"y": 566.0
},
"rotated": false,
"sourceSize": {
"h": 280.0,
"w": 271.0
},
"spriteSourceSize": {
"h": 280.0,
"w": 271.0,
"x": 0,
"y": 0
},
"trimmed": false
},
{
"filename": "img_003.png",
"frame": {
"h": 280.0,
"w": 271.0,
"x": 275,
"y": 2.0
},
"rotated": false,
"sourceSize": {
"h": 280.0,
"w": 271.0
},
"spriteSourceSize": {
"h": 280.0,
"w": 271.0,
"x": 0,
"y": 0
},
"trimmed": false
},
{
"filename": "img_004.png",
"frame": {
"h": 280.0,
"w": 271.0,
"x": 275,
"y": 284.0
},
"rotated": false,
"sourceSize": {
"h": 280.0,
"w": 271.0
},
"spriteSourceSize": {
"h": 280.0,
"w": 271.0,
"x": 0,
"y": 0
},
"trimmed": false
},
{
"filename": "img_005.png",
"frame": {
"h": 280.0,
"w": 271.0,
"x": 275,
"y": 566.0
},
"rotated": false,
"sourceSize": {
"h": 280.0,
"w": 271.0
},
"spriteSourceSize": {
"h": 280.0,
"w": 271.0,
"x": 0,
"y": 0
},
"trimmed": false
}
],
"meta": {
"format": "RGBA8888",
"image": "spaceBear/spaceBear.png",
"scale": "1",
"size": {
"h": 848.0,
"w": 548.0
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 5 additions & 11 deletions app/src/main/assets/effect/twoScreen/resource/fshader.fs
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
#ifdef GL_ES
precision highp float;
uniform sampler2D inputImageTexture;
varying highp vec2 textureCoordinate;
void main() {
int col = int(textureCoordinate.y * 2.0);
vec2 textureCoordinateToUse = textureCoordinate;
textureCoordinateToUse.y = (textureCoordinate.y - float(col) / 2.0) * 2.0;
textureCoordinateToUse.y = textureCoordinateToUse.y/960.0*480.0+1.0/4.0;
gl_FragColor=texture2D(inputImageTexture, textureCoordinateToUse);
}
#else
#define highp
#define mediump
#define lowp
#endif
uniform sampler2D inputImageTexture;
varying vec2 textureCoordinate;
varying highp vec2 textureCoordinate;
void main() {
int col = int(textureCoordinate.y * 2.0);
vec2 textureCoordinateToUse = textureCoordinate;
textureCoordinateToUse.y = (textureCoordinate.y - float(col) / 2.0) * 2.0;
textureCoordinateToUse.y = textureCoordinateToUse.y/960.0*480.0+1.0/4.0;
gl_FragColor=texture2D(inputImageTexture, textureCoordinateToUse);
}
#endif
Loading

0 comments on commit 4f65ce9

Please sign in to comment.