[2.13.0-arch-opt] remove the check module and carcoder module
This commit is contained in:
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,65 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.coroutinescore
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation project(':libraries:map-usbcamera')
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
}else {
|
||||
implementation project(':libraries:map-usbcamera')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.eagle.core.function.impl
|
||||
POM_ARTIFACT_ID=carcorder
|
||||
VERSION_CODE=1
|
||||
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.function.carcorder">
|
||||
|
||||
<application>
|
||||
<service
|
||||
android:name=".service.CarcorderService"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:process=":uvcservice">
|
||||
<intent-filter>
|
||||
<action android:name="com.mogo.launcher.action.CARCORDER_SERVICE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,162 +0,0 @@
|
||||
package com.mogo.eagle.core.function.carcorder.service
|
||||
|
||||
import android.content.Intent
|
||||
import android.hardware.usb.UsbDevice
|
||||
import android.os.IBinder
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_CORDER
|
||||
import com.mogo.usbcamera.UVCCameraHelper
|
||||
import com.serenegiant.usb.IFrameCallback
|
||||
import com.serenegiant.usb.USBMonitor
|
||||
import com.serenegiant.usb.USBMonitor.OnDeviceConnectListener
|
||||
import com.serenegiant.usb.USBMonitor.UsbControlBlock
|
||||
import com.serenegiant.usb.UVCCamera
|
||||
import com.serenegiant.usb.common.BaseService
|
||||
import com.serenegiant.usb.encoder.MediaVideoBufferEncoder
|
||||
|
||||
/**
|
||||
* 行车记录仪服务
|
||||
* @author donghongyu
|
||||
*/
|
||||
class CarcorderService : BaseService() {
|
||||
private val DEBUG = true
|
||||
val TAG = CarcorderService::class.java.name
|
||||
|
||||
// 挂载的USB设备集合
|
||||
private var mDeviceList: List<UsbDevice>? = null
|
||||
|
||||
// USB 设备连接工具
|
||||
private var mUSBMonitor: USBMonitor? = null
|
||||
|
||||
// 用于接入UVC摄像机
|
||||
private var mUVCCamera: UVCCamera? = null
|
||||
|
||||
// 相机控制
|
||||
private var mCtrlBlock: UsbControlBlock? = null
|
||||
|
||||
/**
|
||||
* 配置相机基本按书
|
||||
*/
|
||||
private val previewWidth = 640
|
||||
private val previewHeight = 480
|
||||
|
||||
// Default using MJPEG
|
||||
// if your device is connected,but have no images
|
||||
// please try to change it to FRAME_FORMAT_YUYV
|
||||
val FRAME_FORMAT_MJPEG: Int = UVCCamera.FRAME_FORMAT_MJPEG
|
||||
val MODE_BRIGHTNESS = UVCCamera.PU_BRIGHTNESS
|
||||
val MODE_CONTRAST = UVCCamera.PU_CONTRAST
|
||||
private val mFrameFormat = UVCCameraHelper.FRAME_FORMAT_MJPEG
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (DEBUG) {
|
||||
CallerLogger.d("$M_CORDER$TAG", "onCreate……")
|
||||
}
|
||||
if (mUSBMonitor == null) {
|
||||
mUSBMonitor = USBMonitor(applicationContext, mOnDeviceConnectListener)
|
||||
mUSBMonitor!!.register()
|
||||
mDeviceList = mUSBMonitor!!.deviceList
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onDestroy:")
|
||||
if (mUSBMonitor != null) {
|
||||
mUSBMonitor!!.unregister()
|
||||
mUSBMonitor = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun onRebind(intent: Intent) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onRebind:$intent")
|
||||
}
|
||||
|
||||
|
||||
override fun onUnbind(intent: Intent): Boolean {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:$intent")
|
||||
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:finished")
|
||||
return true
|
||||
}
|
||||
|
||||
//**********************************************************************************************************************************
|
||||
private val mSync: Any = Any()
|
||||
|
||||
private val mVideoEncoder: MediaVideoBufferEncoder? = null
|
||||
|
||||
|
||||
/**
|
||||
* USB 设备连接监听
|
||||
*/
|
||||
private val mOnDeviceConnectListener: OnDeviceConnectListener = object : OnDeviceConnectListener {
|
||||
override fun onAttach(device: UsbDevice) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onAttach:${device.deviceName}---mDeviceList:${mDeviceList?.size}")
|
||||
mUSBMonitor!!.requestPermission(device)
|
||||
}
|
||||
|
||||
override fun onConnect(device: UsbDevice, ctrlBlock: UsbControlBlock, createNew: Boolean) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onConnect:${device.deviceName}")
|
||||
openCamera(device, ctrlBlock, createNew)
|
||||
}
|
||||
|
||||
override fun onDisconnect(device: UsbDevice, ctrlBlock: UsbControlBlock) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onDisconnect:${device.deviceName}")
|
||||
}
|
||||
|
||||
override fun onDettach(device: UsbDevice) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onDettach:${device.deviceName}")
|
||||
}
|
||||
|
||||
override fun onCancel(device: UsbDevice) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "OnDeviceConnectListener#onCancel:${device.deviceName}")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接相机
|
||||
*/
|
||||
private fun openCamera(device: UsbDevice, ctrlBlock: UsbControlBlock, createNew: Boolean) {
|
||||
if (mUVCCamera == null) {
|
||||
mUVCCamera = UVCCamera()
|
||||
mUVCCamera!!.open(ctrlBlock)
|
||||
mUVCCamera!!.setStatusCallback { statusClass, event, selector, statusAttribute, data ->
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "IStatusCallback#onStatus(statusClass=${statusClass},event=${event},selector=${selector},statusAttribute=${statusAttribute},data=${data})")
|
||||
}
|
||||
|
||||
try {
|
||||
mUVCCamera!!.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.FRAME_FORMAT_MJPEG)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
try {
|
||||
mUVCCamera!!.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.DEFAULT_PREVIEW_MODE)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
mUVCCamera!!.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
mUVCCamera!!.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_YUV420SP)
|
||||
mUVCCamera!!.startPreview()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频帧回掉
|
||||
*/
|
||||
private val mIFrameCallback = IFrameCallback { frame ->
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "IFrameCallback#onFrame:${frame}")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.mogo.eagle.core.function.carcorder.service
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_CORDER
|
||||
import com.serenegiant.usb.common.BaseService
|
||||
|
||||
/**
|
||||
* 行车记录仪服务
|
||||
* @author donghongyu
|
||||
*/
|
||||
class LivePushService : BaseService() {
|
||||
private val DEBUG = true
|
||||
val TAG = LivePushService::class.java.name
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (DEBUG) {
|
||||
CallerLogger.d("$M_CORDER$TAG", "onCreate……")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onDestroy:")
|
||||
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun onRebind(intent: Intent) {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onRebind:$intent")
|
||||
}
|
||||
|
||||
|
||||
override fun onUnbind(intent: Intent): Boolean {
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:$intent")
|
||||
|
||||
if (DEBUG) CallerLogger.d("$M_CORDER$TAG", "onUnbind:finished")
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user