Commit 59027733 authored by 马乐's avatar 马乐

完事关闭副屏

parent bde90caf
......@@ -299,6 +299,7 @@ class MainActivity : AppCompatActivity() {
}
} catch (e: CancellationException) {
LogUtils.e("${e.message}")
closeAuxiliaryPresentation()
avmLeftCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
avmFrontCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
avmRightCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
......@@ -309,8 +310,15 @@ class MainActivity : AppCompatActivity() {
}
}
binding.stopAvm.setOnClickListener {
avmPlayJob?.cancel(CancellationException("结束AVM实时渲染"))
closeAuxiliaryPresentation()
if (avmPlayJob?.isActive == true) {
avmPlayJob?.cancel(CancellationException("结束AVM实时渲染"))
} else {
closeAuxiliaryPresentation()
avmLeftCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
avmFrontCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
avmRightCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
avmBackCamera.stopPictureSequence(PictureSequenceSource.GENERAL_CAMERA)
}
}
}
......
......@@ -111,7 +111,7 @@ fun ArcVisDriveAVMEngine.initializeAvmParams(calibResultPath:File,lookupPath:Fil
carInfo.blinkAreaBack = 0
carInfo.blinkAreaLeft = 0
calibInfo.avmCarInfo = carInfo
calibInfo.viewPortType = ArcAVMViewPortType.SMALL.value
calibInfo.viewPortType = ArcAVMViewPortType.LARGE.value
avmInitInfo.avmCalibInfo = calibInfo
if (spUtils.getBoolean(CALIB_RESULT)) {
val avmCalibResult = ArcAVMCalibResult()
......@@ -154,10 +154,11 @@ fun ArcVisDriveAVMEngine.autoCalib(calibResultPath:File,lookupPath:File):Int{
} else {
spUtils.put(CALIB_RESULT,false)
spUtils.put(LOOKUP_TABLE,false)
LogUtils.e("autoCalibrate failed, chessPoints1:${chessInfoList[0].leftChessPoints[0].x}_${chessInfoList[0].leftChessPoints[0].y}," +
"chessPoints2:${chessInfoList[1].leftChessPoints[1].x}_${chessInfoList[1].leftChessPoints[1].y}," +
"chessPoints3:${chessInfoList[2].leftChessPoints[2].x}_${chessInfoList[2].leftChessPoints[2].y}," +
"chessPoints4:${chessInfoList[3].leftChessPoints[3].x}_${chessInfoList[3].leftChessPoints[3].y},")
LogUtils.e("autoCalibrate failed\n" +
"chessPoints1:${chessInfoList[0].leftChessPoints[0].x}_${chessInfoList[0].leftChessPoints[0].y}\n" +
"chessPoints2:${chessInfoList[1].leftChessPoints[1].x}_${chessInfoList[1].leftChessPoints[1].y}\n" +
"chessPoints3:${chessInfoList[2].leftChessPoints[2].x}_${chessInfoList[2].leftChessPoints[2].y}\n" +
"chessPoints4:${chessInfoList[3].leftChessPoints[3].x}_${chessInfoList[3].leftChessPoints[3].y}\n")
}
val getCalibInfo = ArcAVMCalibInfo()
val getCalibResult = ArcAVMCalibResult()
......
......@@ -41,7 +41,6 @@ private val serviceConnection: ServiceConnection = object : ServiceConnection {
override fun onServiceDisconnected(name: ComponentName?) {
LogUtils.d("停止副屏服务...")
multiScreenService?.dismissSecondPresentation()
//恢复置空
multiScreenService = null
}
......@@ -54,7 +53,12 @@ fun Context.openAuxiliaryPresentation(){
fun Context.closeAuxiliaryPresentation(){
LogUtils.i("解绑副屏服务")
unbindService(serviceConnection)
try {
multiScreenService?.dismissSecondPresentation()
unbindService(serviceConnection)
} catch (e: IllegalArgumentException) {
LogUtils.e("重复解绑副屏服务.${e.message}")
}
}
fun feedData(data: ByteArray){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment