Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/fix UVCCamera to support minSdkVersion=30 targetSdkVersion=34 #709

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9801dbd
add arm64-v8a to APP_ABI to support arm64
hthetiot Sep 14, 2024
7b9bba4
remove '-XX:MaxPermSize=512m' from gradle.properties that can cause e…
hthetiot Sep 14, 2024
aa5efa3
migrate to gradlew 7.2.1
hthetiot Sep 14, 2024
c14656a
fix ndk error for armeabi, mips and x86
hthetiot Sep 14, 2024
dd3068d
fix libuvccamera/src/main/AndroidManifest.xml
hthetiot Sep 14, 2024
5b26a6d
add '.DS_Store' to .gitignore
hthetiot Sep 14, 2024
6bb4719
add '.DS_Store' to .gitignore
hthetiot Sep 14, 2024
4a8e271
add Github build
hthetiot Sep 14, 2024
6c80fe4
upgrade to SDKVersion 34 and minSDKVersion 30
hthetiot Sep 14, 2024
0a14e52
ignore MissingPermission on AudioRecord cause requested by app
hthetiot Sep 14, 2024
4560fda
fix usbCameraCommon loadShutterSound
hthetiot Sep 14, 2024
0cf9b92
fix loadShutterSound CameraServer
hthetiot Sep 14, 2024
9edf8bc
fix missing res/values/dimens.xml entry
hthetiot Sep 14, 2024
56a3dde
update .idea
hthetiot Sep 14, 2024
c7e557e
add gradle/wrapper/gradle-wrapper.jar
hthetiot Sep 14, 2024
25d40cf
fix indent to tab instead of space
hthetiot Sep 14, 2024
d33bc27
fix checkPermissionWriteExternalStorage on android 30+
hthetiot Sep 14, 2024
68bedab
fix possible missing local.properties file for libuvccamera ndkBuildPath
hthetiot Sep 14, 2024
204dccf
fix libuvccamera/build.gradle getNdkBuildPath
hthetiot Sep 14, 2024
e8fe7a2
remove CI 'List APK files'
hthetiot Sep 14, 2024
051f213
fix Handle segfault in handle_iso_completion (c8ff2c603c16de2cc75481f…
hthetiot Sep 14, 2024
ca35f0f
fix Fix stopPreview() crash (de019b7fa50f7fa2a92866a1fd0286182b8d1491…
hthetiot Sep 14, 2024
79e6228
Revert "fix Handle segfault in handle_iso_completion (c8ff2c603c16de2…
hthetiot Sep 14, 2024
c7f043f
Update android_usbfs.c
plenalam Dec 16, 2020
ff6fe3b
Update android_usbfs.c
plenalam Dec 23, 2020
463c51d
Update README.md
harshitsaxenainit Aug 28, 2020
2a7fcbd
fix registerReceiver RECEIVER_NOT_EXPORTED
hthetiot Sep 14, 2024
7eb8cbb
fix indentation to tab libuvccamera/src/main/jni/libusb/libusb/os/and…
hthetiot Sep 14, 2024
a417bba
fix com.serenegiant.usbcameratest2
hthetiot Sep 14, 2024
e3088d9
fix com.serenegiant.usbcameratest SimpleUVCCameraTextureView
hthetiot Sep 14, 2024
9e4ea6a
fix usbdevice.getSerialNumber on > 28
hthetiot Sep 14, 2024
aec108e
update .idea
hthetiot Sep 14, 2024
618233f
git ignore .idea/modules*
hthetiot Sep 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Gradle Build on PRs
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.4.2

- uses: nttld/setup-ndk@v1
with:
ndk-version: r21e

- name: Execute Gradle Build Release
run: ./gradlew clean build assembleRelease --parallel -x lint

- name: Upload
if: github.ref_name == 'release'
uses: actions/upload-artifact@v4
with:
name: Build Artifacts (${{ matrix.os }})
path: app/build/outputs/apk/release/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bin/classes
bin/res
bin/jarlist.cache
*.cache
.DS_Store

# Local configuration file (sdk path, etc)
local.properties
Expand Down Expand Up @@ -55,6 +56,8 @@ build
!.idea/fileColors.xml
!.idea/encodings.xml
!.idea/gradle.xml
!.idea/modules.xml
!.idea/modules/*.xml
!.idea/runConfigurations/*.xml

!.idea/inspectionProfiles/*.xml
Expand Down
18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If you want to use Android Studio(unfortunately NDK supporting on Android Studio
5. Android Studio raise some errors but just ignore now. Android Studio generate `local.properties` file. Please open `local.properties` and add `ndk.dir` key to the end of the file. The contents of the file looks like this.
```
sdk.dir={path to Android SDK on your storage}
ndk.dir={path to Android SDK on your storage}
ndk.dir={path to Android NDK on your storage}
```
Please replace actual path to SDK and NDK on your storage.
Of course you can make `local.properties` by manually instead of using automatically generated ones by Android Studio.
Expand Down
15 changes: 4 additions & 11 deletions UVCCamera.iml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="UVCCamera" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<module external.linked.project.id="UVCCamera" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
30 changes: 14 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
// google()
maven { url 'https://maven.google.com' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
}
}

allprojects {
repositories {
// google()
maven { url 'https://maven.google.com' }
repositories {
maven { url 'https://raw.github.com/saki4510t/libcommon/master/repository/' }
jcenter()
maven { url 'http://raw.github.com/saki4510t/libcommon/master/repository/' }
}
google()
}
}

task clean(type: Delete) {
Expand All @@ -26,9 +24,9 @@ task clean(type: Delete) {
ext {
supportLibVersion = '27.1.1' // variable that can be referenced to keep support libs consistent
commonLibVersion= '2.12.4'
versionBuildTool = '27.0.3'
versionCompiler = 27
versionTarget = 27
versionCompiler = 34
versionTarget = 34
minTargetVersion = 30
versionNameString = '1.0.0'
javaSourceCompatibility = JavaVersion.VERSION_1_8
javaTargetCompatibility = JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Oct 02 16:16:11 JST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
10 changes: 3 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ case "`uname`" in
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
Expand All @@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

Expand Down Expand Up @@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down
19 changes: 10 additions & 9 deletions libuvccamera/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ apply plugin: 'com.android.library'
import org.apache.tools.ant.taskdefs.condition.Os

android {
compileSdkVersion versionCompiler
buildToolsVersion versionBuildTool
compileSdk versionCompiler

compileOptions {
sourceCompatibility javaSourceCompatibility
targetCompatibility javaTargetCompatibility
}

defaultConfig {
minSdkVersion 14
minSdkVersion minTargetVersion
targetSdkVersion versionTarget
}

Expand All @@ -58,13 +57,16 @@ tasks.withType(JavaCompile) {

String getNdkBuildPath() {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def ndkBuildingDir = properties.getProperty("ndk.dir")
def ndkBuildPath = ndkBuildingDir
def ndkBuildPath = "";
def ndkBuildingDir = "";
if (project.rootProject.file("local.properties").exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
ndkBuildingDir = properties.getProperty("ndk.dir") + '/'
}
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
ndkBuildPath = ndkBuildingDir + '/ndk-build.cmd'
ndkBuildPath = ndkBuildingDir + 'ndk-build.cmd'
} else {
ndkBuildPath = ndkBuildingDir + '/ndk-build'
ndkBuildPath = ndkBuildingDir + 'ndk-build'
}
return ndkBuildPath
}
Expand All @@ -86,7 +88,6 @@ clean.dependsOn 'ndkClean'
dependencies {
implementation fileTree(dir: new File(buildDir, 'libs'), include: '*.jar')

implementation "com.android.support:support-v4:${supportLibVersion}"
implementation "com.android.support:support-annotations:${supportLibVersion}"

implementation("com.serenegiant:common:${commonLibVersion}") {
Expand Down
4 changes: 0 additions & 4 deletions libuvccamera/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
android:versionCode="2"
android:versionName="1.1" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="22" />

</manifest>
Loading