Skip to content

Commit

Permalink
Merge pull request #24 from vshcryabets/fix/cleanup-code-remove-lame
Browse files Browse the repository at this point in the history
Remove LAME dependency
  • Loading branch information
vshcryabets committed Jul 24, 2024
2 parents 904d815 + f12e1f3 commit c897721
Show file tree
Hide file tree
Showing 1,131 changed files with 36 additions and 27,893 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ dependencies {
implementation(libs.androidx.foundation)
implementation(libs.androidx.activity.compose)
implementation(project(":libausbc"))
implementation(project(":libuvc"))
}
8 changes: 1 addition & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>

<!--bugly permission need-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<application
android:name="com.jiangdg.demo.DemoApplication"
android:allowBackup="true"
Expand All @@ -35,8 +30,7 @@

<activity
android:name="com.jiangdg.demo.MainActivity"
android:theme="@style/Theme.ClinkCameraDemo.NoActionBar"
android:screenOrientation="fullSensor">
android:theme="@style/Theme.ClinkCameraDemo.NoActionBar" >
</activity>

</application>
Expand Down
12 changes: 6 additions & 6 deletions libuvc/CMakeLists.txt → libausbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ set(ENABLE_STATIC TRUE)

add_compile_definitions(LIBUVC_HAS_JPEG)

include(./src/main/jni/libjpeg-turbo-1.5.0/android/CMakeLists.txt)
include(./src/main/jni/hacks/CMakeLists.txt)
include(./src/main/jni/common/CMakeLists.txt)
include(./src/main/jni/libusb/android/jni/CMakeLists.txt)
include(./src/main/jni/libuvc/android/jni/CMakeLists.txt)
include(./src/main/jni/UVCCamera/CMakeLists.txt)
include(../libausbc/src/main/jni/libjpeg-turbo-1.5.0/android/CMakeLists.txt)
include(../libausbc/src/main/jni/hacks/CMakeLists.txt)
include(../libausbc/src/main/jni/common/CMakeLists.txt)
include(../libausbc/src/main/jni/libusb/android/jni/CMakeLists.txt)
include(../libausbc/src/main/jni/libuvc/android/jni/CMakeLists.txt)
include(../libausbc/src/main/jni/UVCCamera/CMakeLists.txt)

add_library(native SHARED ${SOURCES})

Expand Down
8 changes: 6 additions & 2 deletions libausbc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ android {
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
ndk.abiFilters.addAll(listOf("armeabi-v7a","arm64-v8a")) // x86, x86_64 still in progress
}

buildTypes {
Expand All @@ -26,13 +27,16 @@ android {
kotlinOptions {
jvmTarget = libs.versions.jvmTarget.get()
}
externalNativeBuild {
cmake {
path = File(projectDir, "CMakeLists.txt")
}
}
}

dependencies {
implementation(libs.androidx.appcompat)
implementation(libs.androidx.constraintlayout)
implementation(libs.material)
implementation(libs.timber)
implementation(project(":libuvc"))
api(project(":libnative"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jiangdg.natives
package com.jiangdg

/** YUV format transform
*
Expand Down
50 changes: 0 additions & 50 deletions libausbc/src/main/java/com/jiangdg/ausbc/MultiCameraClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -486,56 +486,6 @@ class MultiCameraClient(ctx: Context, callback: IDeviceConnectCallBack?) {
mVideoProcess?.putRawData(RawData(data, data.size))
}

/**
* Start rec mp3
*
* @param mp3Path mp3 save path
* @param callBack record status, see [ICaptureCallBack]
*/
fun captureAudioStart(callBack: ICaptureCallBack, mp3Path: String?=null) {
if (! CameraUtils.hasAudioPermission(mContext)) {
callBack.onError("Has no audio permission")
return
}
if (! CameraUtils.hasStoragePermission(mContext)) {
callBack.onError("Has no storage permission")
return
}
val path = if (mp3Path.isNullOrEmpty()) {
"${mContext.getExternalFilesDir(null)?.path}/${System.currentTimeMillis()}.mp3"
} else {
mp3Path
}
(mAudioProcess as? AACEncodeProcessor)?.recordMp3Start(path, callBack)
}

/**
* Stop rec mp3
*/
fun captureAudioStop() {
(mAudioProcess as? AACEncodeProcessor)?.recordMp3Stop()
}

/**
* Start play mic
*
* @param callBack play mic status in real-time, see [IPlayCallBack]
*/
fun startPlayMic(callBack: IPlayCallBack?) {
if (! CameraUtils.hasAudioPermission(mContext)) {
callBack?.onError("Has no audio permission")
return
}
(mAudioProcess as? AACEncodeProcessor)?.playAudioStart(callBack)
}

/**
* Stop play mic
*/
fun stopPlayMic() {
(mAudioProcess as? AACEncodeProcessor)?.playAudioStop()
}

/**
* Rotate camera render angle
*
Expand Down
52 changes: 0 additions & 52 deletions libausbc/src/main/java/com/jiangdg/ausbc/base/CameraFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import com.jiangdg.ausbc.callback.ICameraStateCallBack
import com.jiangdg.ausbc.callback.ICaptureCallBack
import com.jiangdg.ausbc.callback.IDeviceConnectCallBack
import com.jiangdg.ausbc.callback.IEncodeDataCallBack
import com.jiangdg.ausbc.callback.IPlayCallBack
import com.jiangdg.ausbc.callback.IPreviewDataCallBack
import com.jiangdg.ausbc.camera.CameraUVC
import com.jiangdg.ausbc.camera.bean.CameraRequest
Expand Down Expand Up @@ -378,57 +377,6 @@ abstract class CameraFragment : BaseFragment(), ICameraStateCallBack {
getCurrentCamera()?.removePreviewDataCallBack(callBack)
}

/**
* Capture video start
*
* @param callBack capture status, see [ICaptureCallBack]
* @param path custom save path
* @param durationInSec divided record duration time in seconds
*/
protected fun captureVideoStart(callBack: ICaptureCallBack, path: String? = null, durationInSec: Long = 0L) {
getCurrentCamera()?.captureVideoStart(callBack, path, durationInSec)
}

/**
* Capture video stop
*/
protected fun captureVideoStop() {
getCurrentCamera()?.captureVideoStop()
}

/**
* Capture audio start
*
* @param callBack capture status, see [ICaptureCallBack]
* @param path custom save path
*/
protected fun captureAudioStart(callBack: ICaptureCallBack, path: String? = null) {
getCurrentCamera()?.captureAudioStart(callBack, path)
}

/**
* Capture audio stop
*/
protected fun captureAudioStop() {
getCurrentCamera()?.captureAudioStop()
}

/**
* Start play mic
*
* @param callBack play mic in real-time, see [IPlayCallBack]
*/
protected fun startPlayMic(callBack: IPlayCallBack? = null) {
getCurrentCamera()?.startPlayMic(callBack)
}

/**
* Stop play mic
*/
protected fun stopPlayMic() {
getCurrentCamera()?.stopPlayMic()
}

/**
* Get current preview size
*
Expand Down
26 changes: 0 additions & 26 deletions libausbc/src/main/java/com/jiangdg/ausbc/callback/IPlayCallBack.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ class CameraUVC(ctx: Context, device: UsbDevice) : MultiCameraClient.ICamera(ctx
Logger.e(TAG, "open camera failed, preview size($previewSize) unsupported-> ${mUvcCamera?.supportedSizeList2}")
return
}
initEncodeProcessor(previewSize.width, previewSize.height)
// if give custom minFps or maxFps or unsupported preview size
// this method will fail
mUvcCamera?.setPreviewSize(
Expand Down
Loading

0 comments on commit c897721

Please sign in to comment.