Skip to content

Commit

Permalink
fix download common library failed, and use aar instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangdongguo committed Nov 17, 2021
1 parent 3fa7b62 commit 8edbe9b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 21 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ Step 1. Add the JitPack repository to your build file.Add it in your root build.
allprojects {
repositories {
...
maven { url 'http://raw.github.com/saki4510t/libcommon/master/repository/' }
maven { url 'https://jitpack.io' }

flatDir {
dirs 'libs', '../libusbcamera/libs'
}
}
}
```
Step 2. Add the dependency
```java
dependencies {
implementation 'com.github.jiangdongguo:AndroidUSBCamera:2.3.6'
implementation 'com.github.jiangdongguo:AndroidUSBCamera:2.3.7'
}
```
### 2. APIs Introduction
Expand Down Expand Up @@ -203,14 +206,17 @@ Please checking your preview format and change YUV to MJPEG or MJPEG to YUV,beca

1. fix pull out crash 2.

#### 2021.11.17 version 2.3.7

1. fix download common library failed, and use aar instead.

Download APK(2.3.4)
-----------------

 In order to display the functions, I develop a simple released apk,which is based on version 2.3.1,and the build version is 28.0.3.Here is my configs and if you have any questions please issues to me ,I will follow it do my best.
```
ext {
androidXVersion = '1.1.0' // variable that can be referenced to keep support libs consistent
commonLibVersion= '4.1.1'
versionCompiler = 28
versionTarget = 27 // versionTarget>27 android 10 may previewed failed.
// if hope supporting 4.4
Expand Down
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

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

flatDir {
dirs 'libs', '../libusbcamera/libs'
}
}
}

Expand All @@ -23,16 +26,15 @@ task clean(type: Delete) {
}

ext {
androidXVersion = '1.1.0' // variable that can be referenced to keep support libs consistent
commonLibVersion= '4.1.1'
androidXVersion = '1.1.0'
versionCompiler = 28
// when target=27, 9.0 is ok
versionTarget = 27
// if hope supporting 4.4
// please modify it to 16
minSdkVersion = 21
versionCode = 100
versionNameString = '2.3.5.20210316'
minSdkVersion = 16
versionCode = 101
versionNameString = '2.3.6.20211117'
javaSourceCompatibility = JavaVersion.VERSION_1_8
javaTargetCompatibility = JavaVersion.VERSION_1_8
}
12 changes: 7 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

org.gradle.jvmargs=-Xmx2048m -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
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jun 07 21:35:12 CST 2018
#Mon Mar 08 17:18:54 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
9 changes: 8 additions & 1 deletion libusbcamera/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ android {
sourceCompatibility rootProject.ext.javaSourceCompatibility
targetCompatibility rootProject.ext.javaTargetCompatibility
}

repositories {
flatDir {
dirs 'libs'
}
}
}


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation "androidx.appcompat:appcompat:${androidXVersion}"
api "com.serenegiant:common:${commonLibVersion}"

implementation(name: 'libusbcommon_v4.1.1', ext: 'aar')
}
Binary file added libusbcamera/libs/libusbcommon_v4.1.1.aar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* XXX it is better that can set the aspect ratio as xml property
*/
public class AspectRatioTextureView extends TextureView // API >= 14
implements IAspectRatioView {
implements IAspectRatioView2 {

private static final boolean DEBUG = true; // TODO set false on release
private static final String TAG = "AbstractCameraView";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
import android.view.Surface;

import com.serenegiant.usb.encoder.IVideoEncoder;
import com.serenegiant.widget.IAspectRatioView;

public interface CameraViewInterface extends IAspectRatioView {
public interface CameraViewInterface extends IAspectRatioView2 {
public interface Callback {
public void onSurfaceCreated(CameraViewInterface view, Surface surface);
public void onSurfaceChanged(CameraViewInterface view, Surface surface, int width, int height);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.serenegiant.usb.widget;

public interface IAspectRatioView2 {
void setAspectRatio(double var1);

void setAspectRatio(int var1, int var2);

double getAspectRatio();
}

0 comments on commit 8edbe9b

Please sign in to comment.