Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -91,6 +91,7 @@
|
|||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
<option name="useQualifiedModuleNames" value="true" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// mFromType
|
// mFromType
|
||||||
// )
|
// )
|
||||||
|
|
||||||
getInfo("", "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, CarCorderController.mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo("", mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 1, mFromType, CarCorderController.mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
|
|
||||||
//地图上打点
|
//地图上打点
|
||||||
taskAsync(3_000) {
|
taskAsync(3_000) {
|
||||||
@@ -213,7 +213,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// mFromType
|
// mFromType
|
||||||
// )
|
// )
|
||||||
|
|
||||||
getInfo("", "", mLongitude, mLatitude, mType, 1.0f, "", "", 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo("", mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// mLatitude, mSpeed)
|
// mLatitude, mSpeed)
|
||||||
|
|
||||||
if (photoPath != null) {
|
if (photoPath != null) {
|
||||||
getInfo(photoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo(photoPath, mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -283,7 +283,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// )
|
// )
|
||||||
|
|
||||||
if (photoPath != null) {
|
if (photoPath != null) {
|
||||||
getInfo(photoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo(photoPath, mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// )
|
// )
|
||||||
|
|
||||||
if (photoPath != null) {
|
if (photoPath != null) {
|
||||||
getInfo(photoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo(photoPath, mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 0, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -343,13 +343,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
|
|
||||||
entity?.let {
|
entity?.let {
|
||||||
if (it.isCustom) {
|
if (it.isCustom) {
|
||||||
// compressVideo(videoPath, thumbnailPath, it)
|
compressVideo(videoPath, thumbnailPath, it)
|
||||||
getInfo(videoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
|
||||||
|
|
||||||
} else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) {
|
} else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) {
|
||||||
// 属于策略上报
|
// 属于策略上报
|
||||||
// compressVideo(videoPath, thumbnailPath, it)
|
compressVideo(videoPath, thumbnailPath, it)
|
||||||
getInfo(videoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
@@ -360,16 +358,14 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
Log.d(TAG, "onTakeVideoSuccess 111 abs =" + (abs(minSpeedVideo) / 3.6f))
|
Log.d(TAG, "onTakeVideoSuccess 111 abs =" + (abs(minSpeedVideo) / 3.6f))
|
||||||
if (speed >= (abs(minSpeedVideo) / 3.6f)) {
|
if (speed >= (abs(minSpeedVideo) / 3.6f)) {
|
||||||
//获取视频以及缩略图成功,开始上报
|
//获取视频以及缩略图成功,开始上报
|
||||||
// compressVideo(videoPath, thumbnailPath, it)
|
compressVideo(videoPath, thumbnailPath, it)
|
||||||
getInfo(videoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minSpeedVideo > 0 && maxSpeedVideo > 0) {
|
if (minSpeedVideo > 0 && maxSpeedVideo > 0) {
|
||||||
Log.d(TAG, "onTakeVideoSuccess minSpeedVideo > 0 -- speed = $speed")
|
Log.d(TAG, "onTakeVideoSuccess minSpeedVideo > 0 -- speed = $speed")
|
||||||
if ((speed >= (minSpeedVideo / 3.6f)) && speed <= (maxSpeedVideo / 3.6f)) {
|
if ((speed >= (minSpeedVideo / 3.6f)) && speed <= (maxSpeedVideo / 3.6f)) {
|
||||||
// compressVideo(videoPath, thumbnailPath, it)
|
compressVideo(videoPath, thumbnailPath, it)
|
||||||
getInfo(videoPath, "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -414,7 +410,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// mFromType
|
// mFromType
|
||||||
// )
|
// )
|
||||||
|
|
||||||
getInfo("", "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo("", mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
|
|
||||||
//地图上打点
|
//地图上打点
|
||||||
taskAsync(3_000) {
|
taskAsync(3_000) {
|
||||||
@@ -429,24 +425,24 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
/**
|
/**
|
||||||
* 压缩视频并且上传
|
* 压缩视频并且上传
|
||||||
*/
|
*/
|
||||||
// private fun compressVideo(videoPath: String, thumbnailPath: String, entity: TakeEntity) {
|
private fun compressVideo(videoPath: String, thumbnailPath: String, entity: TakeEntity) {
|
||||||
// Log.d(
|
Log.d(
|
||||||
// TAG,
|
TAG,
|
||||||
// "outputVideoPath = " + outputVideoPath + ">> videoPath=" + videoPath + " isCustom = ${entity.isCustom}"
|
"outputVideoPath = " + outputVideoPath + ">> videoPath=" + videoPath + " isCustom = ${entity.isCustom}"
|
||||||
// )
|
)
|
||||||
// val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
// Thread(Runnable {
|
Thread(Runnable {
|
||||||
// try {
|
try {
|
||||||
// VideoProcessor.processor(AbsMogoApplication.getApp().applicationContext)
|
VideoProcessor.processor(AbsMogoApplication.getApp().applicationContext)
|
||||||
// .input(videoPath)
|
.input(videoPath)
|
||||||
// .output(outputVideoPath)
|
.output(outputVideoPath)
|
||||||
// .removeAudio(true)
|
.removeAudio(true)
|
||||||
// .outWidth(1920)
|
.outWidth(1920)
|
||||||
// .outHeight(1080)
|
.outHeight(1080)
|
||||||
// .bitrate(2000 * 1024)
|
.bitrate(2000 * 1024)
|
||||||
// .frameRate(25)
|
.frameRate(25)
|
||||||
// .process()
|
.process()
|
||||||
// Log.d(TAG, "compress cost time =" + (System.currentTimeMillis() - startTime))
|
Log.d(TAG, "compress cost time =" + (System.currentTimeMillis() - startTime))
|
||||||
// CosStatusController().uploadFile(
|
// CosStatusController().uploadFile(
|
||||||
// mutableListOf(outputVideoPath, thumbnailPath),
|
// mutableListOf(outputVideoPath, thumbnailPath),
|
||||||
// entity,
|
// entity,
|
||||||
@@ -457,17 +453,19 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// mLatitude,
|
// mLatitude,
|
||||||
// mSpeed
|
// mSpeed
|
||||||
// )
|
// )
|
||||||
//
|
|
||||||
// //删除压缩前的视频
|
getInfo(outputVideoPath, mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
// deletePicFile(videoPath)
|
|
||||||
// } catch (e: Exception) {
|
//删除压缩前的视频
|
||||||
// Log.e(TAG, "compressVideo e = $e")
|
deletePicFile(videoPath)
|
||||||
// //删除压缩前的视频
|
} catch (e: Exception) {
|
||||||
// deletePicFile(videoPath)
|
Log.e(TAG, "compressVideo e = $e")
|
||||||
// e.printStackTrace()
|
//删除压缩前的视频
|
||||||
// }
|
deletePicFile(videoPath)
|
||||||
// }).start()
|
e.printStackTrace()
|
||||||
// }
|
}
|
||||||
|
}).start()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上报路况的视频和图片
|
* 上报路况的视频和图片
|
||||||
@@ -475,7 +473,9 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
fun uploadRoadInfo(info: UploadInfo) {
|
fun uploadRoadInfo(info: UploadInfo) {
|
||||||
MogoUploadManager.getInstance(AbsMogoApplication.getApp().applicationContext).uploadInfo(info, object : ITanluUploadCallback {
|
MogoUploadManager.getInstance(AbsMogoApplication.getApp().applicationContext).uploadInfo(info, object : ITanluUploadCallback {
|
||||||
override fun onSuccess(result: BaseData<UploadResult>) {
|
override fun onSuccess(result: BaseData<UploadResult>) {
|
||||||
|
if (result != null) {
|
||||||
|
Log.d(TAG, "result =" + result.result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(code: Int) {
|
override fun onFailure(code: Int) {
|
||||||
@@ -531,7 +531,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
|||||||
// mFromType
|
// mFromType
|
||||||
// )
|
// )
|
||||||
|
|
||||||
getInfo("", "", mLongitude, mLatitude, mType, 1.0f, "", "", 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
getInfo("", mAddress, mLongitude, mLatitude, mType, mDirection, mAreaCode, mCityCode, 1, mFromType, mainInfoId)?.let { uploadRoadInfo(it) }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user