Skip to content

Commit 7bea58b

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/histogram
2 parents 8ca34e6 + aa6b070 commit 7bea58b

File tree

3 files changed

+50
-29
lines changed

3 files changed

+50
-29
lines changed

README.md

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,59 @@ dependencies {
4343
* Waiting for the initialization. (NDK/cmake install)
4444
* Done.
4545

46-
* Using `Visual Studio Code`: (Simple)
46+
* Using `Visual Studio Code`: (Requires __[WSL(Recommended)](https://learn.microsoft.com/en-us/windows/wsl/install)__/__[MinGW](https://osdn.net/projects/mingw/)__/__[Cygwin](https://www.cygwin.com/)__ on Windows.)
4747
* Setup ENV variable `ANDROID_HOME` to your Android SDK installation directory.
4848
* Open the repo with `Visual Studio Code`
4949
* Press `⌘ + shift + B` (Mac) or `ctrl + shift + B` (Win/Linux), choose the option `Enable CMake And Build Project With CMake`.
5050
* Done.
5151

52-
* Build `JNI` part with ndk-build: (Not recommended)
53-
54-
```shell
55-
export NDK=path/of/your/ndk
56-
cd folder/of/jni (android-gpuimage-plus/library/src/main/jni)
52+
* Build with preset tasks: (Requires __[WSL(Recommended)](https://learn.microsoft.com/en-us/windows/wsl/install)__/__[MinGW](https://osdn.net/projects/mingw/)__/__[Cygwin](https://www.cygwin.com/)__ on Windows.)
5753

58-
#This will make all arch: armeabi, armeabi-v7a arm64-v8a, x86, mips
59-
./buildJNI
60-
#Or use "sh buildJNI"
54+
```shell
55+
# define the environment variable "ANDROID_HOME"
56+
# If using Windows, define ANDROID_HOME in Windows Environment Settings by yourself.
57+
export ANDROID_HOME=/path/to/android/sdk
58+
59+
# Setup Project
60+
bash vscode_tasks.sh --setup-project
6161

62-
#Try this if you failed to run the shell above
63-
export CGE_USE_VIDEO_MODULE=1
64-
$NDK/ndk-build
62+
# Compile with CMake Debug
63+
bash vscode_tasks.sh --debug --enable-cmake --build
64+
# Compile with CMake Release
65+
bash vscode_tasks.sh --release --enable-cmake --build
6566

66-
#If you don't want anything except the image filter,
67-
#Do as below to build with only cge module
68-
#No ffmpeg, opencv or faceTracker.
69-
#And remove the loading part of ffmpeg&facetracker
70-
$NDK/ndk-build
67+
# Start Demo By Command
68+
bash vscode_tasks.sh --run
69+
```
7170

72-
#For Windows user, you should include the `.cmd` extension to `ndk-build` like this:
73-
cd <your\path\to\this\repo>\library\src\main\jni
74-
<your\path\to\ndk>\ndk-build.cmd
71+
* Build `JNI` part with ndk-build: (Not recommended)
7572

76-
#Also remember to comment out these line in NativeLibraryLoader
77-
//System.loadLibrary("ffmpeg");
78-
//CGEFFmpegNativeLibrary.avRegisterAll();
79-
```
73+
```shell
74+
export NDK=path/of/your/ndk
75+
cd folder/of/jni (android-gpuimage-plus/library/src/main/jni)
76+
77+
#This will make all arch: armeabi, armeabi-v7a arm64-v8a, x86, mips
78+
./buildJNI
79+
#Or use "sh buildJNI"
80+
81+
#Try this if you failed to run the shell above
82+
export CGE_USE_VIDEO_MODULE=1
83+
$NDK/ndk-build
84+
85+
#If you don't want anything except the image filter,
86+
#Do as below to build with only cge module
87+
#No ffmpeg, opencv or faceTracker.
88+
#And remove the loading part of ffmpeg&facetracker
89+
$NDK/ndk-build
90+
91+
#For Windows user, you should include the `.cmd` extension to `ndk-build` like this:
92+
cd <your\path\to\this\repo>\library\src\main\jni
93+
<your\path\to\ndk>\ndk-build.cmd
94+
95+
#Also remember to comment out these line in NativeLibraryLoader
96+
//System.loadLibrary("ffmpeg");
97+
//CGEFFmpegNativeLibrary.avRegisterAll();
98+
```
8099

81100
> You can find precompiled libs here: [android-gpuimage-plus-libs](https://github.com/wysaid/android-gpuimage-plus-libs) (The precompiled '.so' files are generated with NDK-r23b)
82101

cgeDemo/src/main/java/org/wysaid/cgeDemo/CameraDemoActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public void onClick(View v) {
230230
});
231231

232232
//Recording video size
233-
mCameraView.presetRecordingSize(480, 640);
234-
// mCameraView.presetRecordingSize(720, 1280);
233+
// mCameraView.presetRecordingSize(480, 640);
234+
mCameraView.presetRecordingSize(1080, 1920);
235235

236236
//Taking picture size.
237237
mCameraView.setPictureSize(2048, 2048, true); // > 4MP

library/src/main/java/org/wysaid/view/CameraGLSurfaceView.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public synchronized boolean setFlashLightMode(String mode) {
9191
return true;
9292
}
9393

94-
protected int mMaxPreviewWidth = 1280;
95-
protected int mMaxPreviewHeight = 1280;
94+
protected int mMaxPreviewWidth = 1920;
95+
protected int mMaxPreviewHeight = 1920;
9696

9797
public static class Viewport {
9898
public int x, y, width, height;
@@ -104,7 +104,7 @@ public Viewport getDrawViewport() {
104104
return mDrawViewport;
105105
}
106106

107-
//The max preview size. Change it to 1920+ if you want to preview with 1080P
107+
//The max preview size. Make it greater if you want to preview with 2K/4K or more!
108108
void setMaxPreviewSize(int w, int h) {
109109
mMaxPreviewWidth = w;
110110
mMaxPreviewHeight = h;
@@ -143,6 +143,8 @@ public void presetRecordingSize(int width, int height) {
143143
height = (int) (height * scaling);
144144
}
145145

146+
Log.i(Common.LOG_TAG, "presetRecordingSize: " + width + "x" + height);
147+
146148
mRecordWidth = width;
147149
mRecordHeight = height;
148150
cameraInstance().setPreferPreviewSize(width, height);

0 commit comments

Comments
 (0)