diff --git a/.idea/dictionaries/zhongchao.xml b/.idea/dictionaries/zhongchao.xml
index 8318e67..6d1b40d 100644
--- a/.idea/dictionaries/zhongchao.xml
+++ b/.idea/dictionaries/zhongchao.xml
@@ -5,6 +5,7 @@
coor
designative
mogo
+ tongchenfei
\ No newline at end of file
diff --git a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/LiveStreamManagerImpl.java b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/LiveStreamManagerImpl.java
index a5e1616..5368389 100644
--- a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/LiveStreamManagerImpl.java
+++ b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/LiveStreamManagerImpl.java
@@ -37,10 +37,8 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
private static final String C1 = "C_1"; //前置摄像头
private static final String C2 = "C_2"; //后置摄像头
private Handler mHandler; // 循环上报摄像头状态
- private SocketMsgUtils mSocketMsgUtils; // Socket 长链接
+ private final SocketMsgUtils mSocketMsgUtils; // Socket 长链接
private MoGoLiveManager mLivePusher; // 自研直播SDK
- private MoGoLivePushConfig mLivePushConfig;
-
public static LiveStreamManagerImpl getInstance(Application application, String devicesId) {
if (sInstance == null) {
@@ -87,7 +85,7 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
*/
private void initLivePush(String devicesId) {
// 初始化配置文件
- mLivePushConfig = MoGoLivePushConfig.getInstance();
+ MoGoLivePushConfig mLivePushConfig = MoGoLivePushConfig.getInstance();
mLivePushConfig.setWidth(1280);
mLivePushConfig.setHeight(720);
mLivePushConfig.setVideoBitrate(6000);
@@ -176,7 +174,7 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
/**
* 循环同步摄像头状态
*/
- private Runnable mCamStatusRun = () -> {
+ private final Runnable mCamStatusRun = () -> {
Logger.i(TAG, "循环同步摄像头状态");
uploadCamStatus(sCam1AvailableStatus, sCam2AvailableStatus);
restartCamStatusLoop();
diff --git a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java
index 565ee30..5bc7957 100644
--- a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java
+++ b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/MoGoLiveManager.java
@@ -92,15 +92,15 @@ public class MoGoLiveManager {
/**
* 直播进度回调用
*/
- private List mProgressListener = new ArrayList<>();
+ private final List mProgressListener = new ArrayList<>();
/**
* 直播房间连接状态
*/
- private List mRoomStatusListener = new ArrayList<>();
+ private final List mRoomStatusListener = new ArrayList<>();
/**
* 直播第二个房间连接状态
*/
- private List mMultiRoomStatusListener = new ArrayList<>();
+ private final List mMultiRoomStatusListener = new ArrayList<>();
/**
* 直播房间人员状态
*/
@@ -112,11 +112,11 @@ public class MoGoLiveManager {
/**
* 直播数据
*/
- private LiveStatusModel mLiveStatusModel;
+ private final LiveStatusModel mLiveStatusModel;
/**
* 房间配置
*/
- private ZegoRoomConfig zeGoRoomConfig;
+ private final ZegoRoomConfig zeGoRoomConfig;
private static final class Holder {
private static final MoGoLiveManager manager = new MoGoLiveManager();
@@ -173,10 +173,8 @@ public class MoGoLiveManager {
public void onDebugError(int errorCode, String funcName, String info) {
super.onDebugError(errorCode, funcName, info);
Logger.i(TAG, "调试错误信息回调 onDebugError errorCode : " + errorCode);
- if (mProgressListener != null) {
- for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
- iLiveProgressListener.onDebugError(errorCode, funcName, info);
- }
+ for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
+ iLiveProgressListener.onDebugError(errorCode, funcName, info);
}
// 停止推送数据
stopPublish();
@@ -187,15 +185,13 @@ public class MoGoLiveManager {
public void onEngineStateUpdate(ZegoEngineState state) {
super.onEngineStateUpdate(state);
Logger.i(TAG, "音视频引擎状态更新回调 onEngineStateUpdate state : " + state.name());
- if (mProgressListener != null) {
- if (state == ZegoEngineState.START) {
- for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
- iLiveProgressListener.onEngineStart();
- }
- } else {
- for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
- iLiveProgressListener.onEngineStop();
- }
+ if (state == ZegoEngineState.START) {
+ for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
+ iLiveProgressListener.onEngineStart();
+ }
+ } else {
+ for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
+ iLiveProgressListener.onEngineStop();
}
}
}
diff --git a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/socket/SocketMsgUtils.java b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/socket/SocketMsgUtils.java
index 3a388a1..be7b077 100644
--- a/foudations/mogo-live/src/main/java/com/mogo/cloud/live/socket/SocketMsgUtils.java
+++ b/foudations/mogo-live/src/main/java/com/mogo/cloud/live/socket/SocketMsgUtils.java
@@ -20,7 +20,7 @@ public class SocketMsgUtils implements IMogoCloudSocketMsgAckListener {
private static volatile SocketMsgUtils sInstance;
private SocketManager mSocketManager;
- private Context mContext;
+ private final Context mContext;
private IMogoCloudSocketOnMessageListener mMessageListener;
public static SocketMsgUtils getInstance(Context context, IMogoCloudSocketOnMessageListener listener) {
diff --git a/gradle.properties b/gradle.properties
index 764f453..96df4a8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -27,23 +27,23 @@ SNAPSHOT_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-snapshots/
USERNAME=xintai
PASSWORD=xintai2018
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
-RELEASE=false
+RELEASE=true
# AI CLOUD 云平台
# 工具类
-MOGO_UTILS_VERSION=1.0.60
+MOGO_UTILS_VERSION=1.0.61
# 网络请求
-MOGO_NETWORK_VERSION=1.0.60
+MOGO_NETWORK_VERSION=1.0.61
# 网络DNS
-MOGO_HTTPDNS_VERSION=1.0.60
+MOGO_HTTPDNS_VERSION=1.0.61
# 鉴权
-MOGO_PASSPORT_VERSION=1.0.60
+MOGO_PASSPORT_VERSION=1.0.61
# 常链接
-MOGO_SOCKET_VERSION=1.0.60
+MOGO_SOCKET_VERSION=1.0.61
# 数据采集
-MOGO_REALTIME_VERSION=1.0.60
+MOGO_REALTIME_VERSION=1.0.61
# 探路,道路事件发布,获取
-MOGO_TANLU_VERSION=1.0.60
+MOGO_TANLU_VERSION=1.0.61
# 直播推流
-MOGO_LIVE_VERSION=1.0.60
+MOGO_LIVE_VERSION=1.0.61
# 直播拉流
-MOGO_TRAFFICLIVE_VERSION=1.0.60
+MOGO_TRAFFICLIVE_VERSION=1.0.61
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java
index 0c1b82a..c307b2d 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoRoadSearchManager.java
@@ -60,7 +60,7 @@ public class MogoRoadSearchManager {
* 通过经纬度信息查询
*
* @param roadInfoRequest 道路查询入参
- * @param callback
+ * @param callback {@link IRoadInfoSearchCallback}
*/
public void queryRoadInfo(RoadInfoRequest roadInfoRequest, IRoadInfoSearchCallback callback) {
Map map = new HashMap<>();
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoUploadManager.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoUploadManager.java
index 3c50ed7..b258823 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoUploadManager.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/api/MogoUploadManager.java
@@ -2,8 +2,8 @@ package com.mogo.cloud.tanlu.api;
import android.content.Context;
-import com.mogo.cloud.tanlu.core.CosUpload;
import com.mogo.cloud.tanlu.bean.UploadInfo;
+import com.mogo.cloud.tanlu.core.CosUpload;
/**
* @author lixiaopeng
@@ -30,10 +30,10 @@ public class MogoUploadManager {
/**
+ * 首先,上传文件到cos,然后把文件在cos的路径和其他参数一起上报服务端
*
- * @brief 首先,上传文件到cos,然后把文件在cos的路径和其他参数一起上报服务端
- * @param info 上报入参
- * @param callback
+ * @param info 上报入参
+ * @param callback {@link ITanluUploadCallback}
*/
public void uploadInfo(UploadInfo info, ITanluUploadCallback callback) {
CosUpload.getInstance(mContext).init();
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java
index a4e39ec..2fea591 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/CosUpload.java
@@ -39,7 +39,7 @@ public class CosUpload implements CosStatusCallback {
private UploadInfo mUploadInfo;
private String mCosVideoUrl;
private String mCosPicUrl;
- private List filePath = new ArrayList<>();
+ private final List filePath = new ArrayList<>();
private String videoCoverImage;
private CosUpload(Context context) {
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/UploadManager.java b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/UploadManager.java
index 7adfd0b..ced6931 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/UploadManager.java
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/core/UploadManager.java
@@ -52,7 +52,6 @@ public class UploadManager {
.create(TanluApiService.class);
}
-
/**
* @param informationBody
* @param callback
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/utils/FileUtil.kt b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/utils/FileUtil.kt
index 03b2f15..09db220 100644
--- a/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/utils/FileUtil.kt
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/cloud/tanlu/utils/FileUtil.kt
@@ -15,12 +15,12 @@ import java.util.*
*/
@Keep
fun deletePicFile(filePath: String?): Boolean {
- var file = File(filePath)
+ val file = File(filePath)
if (file.exists()) {
//如果图片地址包含此路径则是C上面的拍照,需要再删除后摄图片
if (filePath!!.contains("usbotg-1-1.1")) {
//将地址替换成后摄图片地址
- var backFile =
+ val backFile =
File(filePath.replace("frontPic", "backPic").replace("PhotoFront", "PhotoBack"))
if (backFile.exists()) {
return backFile.delete()
@@ -56,7 +56,7 @@ fun deleteAllFile(file: File?) { //判断文件不为null或文件目录存在
//根据本地视频文件生成缩略图文件
fun getVideoThumbnail(filePath: String, picPath: String): Boolean {
var b: Bitmap? = null
- var retriever = MediaMetadataRetriever()
+ val retriever = MediaMetadataRetriever()
try {
retriever.setDataSource(filePath)
b = retriever.getFrameAtTime(0)
@@ -84,7 +84,7 @@ fun bitmapToFile(bitmap: Bitmap?, filePath: String): Boolean {
file.delete()
file.createNewFile()
val fos = FileOutputStream(file)
- var ins = ByteArrayInputStream(baos.toByteArray())
+ val ins = ByteArrayInputStream(baos.toByteArray())
var x = 0
val b = ByteArray(1024 * 100)
while ({ x = ins.read(b);x }() != -1) {