-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from wlanjie/master
2020
- Loading branch information
Showing
71 changed files
with
3,492 additions
and
772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
@@ -595,6 +611,11 @@ mVideoEditor.deleteAction(actionId) | |
``` | ||
|
||
#### Start preview | ||
- Prepare | ||
``` kotlin | ||
mVideoEditor.prepare() | ||
``` | ||
|
||
- Play | ||
``` kotlin | ||
/** | ||
|
@@ -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. | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
139
app/src/main/assets/effect/spaceBear/spaceBear/spaceBear.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.