From c80f12a77f6c6e3528765bb8268d69989134925f Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Thu, 1 Apr 2021 16:36:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89adas=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=95=99=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/service/impl/adas/MogoADASController.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java index 09e6cd756e..2fed26c73a 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java @@ -420,19 +420,8 @@ public class MogoADASController implements IMogoADASController { } } - private LogWriter logWriter; - @Override public void notifyOwnerCarRect( List< AdasAIDLOwnerCarRectModel > ownerCarStateRectList ) { - - if ( logWriter == null ) { - SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddhhmmss" ); - String date = sdf.format( new Date() ); - String path = context.getExternalCacheDir().getAbsolutePath() + "/adaslog/" + date + "/ownerCarStateInfo.txt"; - Logger.d( TAG, path ); - logWriter = new LogWriter( path ); - } - logWriter.write( ownerCarStateRectList ); // 物体识别返回 Logger.d( TAG, "ADAS-REC-received data: size = %s", ownerCarStateRectList == null ? 0 : ownerCarStateRectList.size() ); final long start = System.currentTimeMillis(); From 45ff90fcfbde154824bfbfc83370c7f007d195f1 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 1 Apr 2021 17:34:15 +0800 Subject: [PATCH 2/3] rebuild live func --- .idea/gradle.xml | 1 + gradle.properties | 14 ++--- .../scene/livecar/V2XVoiceCallLiveBiz.java | 43 +++++++------- .../livecar/V2XVoiceCallLiveCarWindow.java | 4 +- .../livecar/V2XVoiceCrossRoadLiveWindow.java | 1 - .../module/v2x/view/CarZegoLiveVideoView.java | 59 +++++++++---------- .../v2x/view/V2XCrossRoadVideoView.java | 37 ++++++------ 7 files changed, 78 insertions(+), 81 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 83405b8de1..4ff10f68a5 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -91,6 +91,7 @@ diff --git a/gradle.properties b/gradle.properties index eed4d7019d..a2007126a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -155,19 +155,19 @@ LOGLIB_VERSION = 1.0.4 ######## MogoAiCloudSDK Version # 网络请求 -MOGO_NETWORK_VERSION=1.0.58 +MOGO_NETWORK_VERSION=1.0.60 # 鉴权 -MOGO_PASSPORT_VERSION=1.0.58 +MOGO_PASSPORT_VERSION=1.0.60 # 常链接 -MOGO_SOCKET_VERSION=1.0.58 +MOGO_SOCKET_VERSION=1.0.60 # 数据采集 -MOGO_REALTIME_VERSION=1.0.58 +MOGO_REALTIME_VERSION=1.0.60 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.0.58 +MOGO_TANLU_VERSION=1.0.60 # 直播推流 -MOGO_LIVE_VERSION=1.0.58 +MOGO_LIVE_VERSION=1.0.60 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.0.58 +MOGO_TRAFFICLIVE_VERSION=1.0.60 ######## Foundation MogoAiCloud Module # mogoAiCloud apk services diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java index e4bef5a47e..9f59163b2a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java @@ -3,17 +3,14 @@ package com.mogo.module.v2x.scenario.scene.livecar; import android.content.Context; import android.text.TextUtils; +import com.mogo.cloud.trafficlive.api.ITrafficIntersectionLiveCallBack; +import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive; import com.mogo.commons.voice.AIAssist; +import com.mogo.map.location.MogoLocation; import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.common.entity.V2XPushMessageEntity; import com.mogo.module.v2x.R; -import com.mogo.module.v2x.V2XDemoManager; import com.mogo.module.v2x.V2XServiceManager; -import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes; -import com.mogo.module.v2x.entity.net.V2XLiveCrossRoad; -import com.mogo.module.v2x.network.V2XRefreshCallback; -import com.mogo.module.v2x.network.V2XRefreshModel; -import com.mogo.module.v2x.utils.ToastUtils; import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceManager; import com.mogo.service.statusmanager.StatusDescriptor; @@ -99,26 +96,25 @@ public class V2XVoiceCallLiveBiz { .unRegisterWakeCmd(COMMAND_ZHIDAO_V2X_AHEAD_LIVE).unRegisterWakeCmd(COMMAND_ZHIDAO_V2X_CROSSROADS_LIVE); } + /** + * 查看前方车辆直播,同方向角 200米范围 + */ public void getFrontCarLive() { -// V2XDemoUserInfoRes.ResultBean.UserListBean.UserInfoBean userInfoBean = V2XDemoManager.getInstance().getV2XDemoUserInfoEntity1().getUserInfo(); - String liveCarSn = "F803EB2046PZD00149"; - if (TextUtils.isEmpty(liveCarSn)) { - ToastUtils.showShort("附近没有可直播车机"); - Logger.d(MODULE_NAME, "getFrontCarLive : sn is null"); - return; - } - V2XMessageEntity v2XMessageEntity = buildCallLiveParams(liveCarSn, null); + V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, null); mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario(); mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCallLiveCarWindow()); mV2XVoiceCallLiveScenario.init(v2XMessageEntity); } + /** + * 查看前方路口摄像头直播,同方向角 1公里范围 + */ public void getOpenRoadCameraLive() { - V2XRefreshModel.getInstance(mContext).queryCrossRoadsLive(new V2XRefreshCallback() { + MogoLocation mogoLocation = V2XServiceManager.getMogoLocationClient().getLastKnowLocation(); + MoGoAiCloudTrafficLive.viewFrontIntersectionLive(mogoLocation.getLatitude(), mogoLocation.getLongitude(), ((int) mogoLocation.getBearing()), new ITrafficIntersectionLiveCallBack() { @Override - public void onSuccess(V2XLiveCrossRoad result) { - if (result != null && result.getResult().getUrl() != null) { - String liveUrl = result.getResult().getUrl(); + public void liveUrlResult(String liveUrl) { + if (!TextUtils.isEmpty(liveUrl)) { V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, liveUrl); mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario(); mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCrossRoadLiveWindow()); @@ -129,12 +125,19 @@ public class V2XVoiceCallLiveBiz { } @Override - public void onFail(String msg) { - Logger.d(MODULE_NAME, "getOpenRoadCameraLive : " + msg); + public void onError(String errorMsg) { + Logger.d(MODULE_NAME, "getOpenRoadCameraLive : " + errorMsg); } }); } + /** + * 构建直播参数 + * + * @param sn 直播车机sn + * @param liveUrl 直播Url + * @return {@link V2XMessageEntity} + */ private V2XMessageEntity buildCallLiveParams(String sn, String liveUrl) { V2XPushMessageEntity v2XPushMessageEntity = new V2XPushMessageEntity(); v2XPushMessageEntity.setVideoSn(sn); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java index 4fb9dcb7b1..c836ca0c47 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java @@ -4,6 +4,7 @@ import android.content.Context; import android.os.Handler; import android.util.AttributeSet; import android.view.LayoutInflater; +import android.view.SurfaceView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -50,7 +51,7 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow } private void initView(Context context) { - Logger.w(MODULE_NAME, "V2X===初始化语音呼叫直播视图"); //todo 更改样式 + Logger.w(MODULE_NAME, "V2X===初始化语音呼叫直播视图"); LayoutInflater.from(context).inflate(R.layout.window_see_carlive_video, this); mV2XCarLiveVideoView = findViewById(R.id.videoPlayer); tvCountDown = findViewById(R.id.tvCountDown); @@ -75,7 +76,6 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow carLiveInfo.setVideoSn(entity.getVideoSn()); carLiveInfo.setVideoUrl(entity.getVideoUrl()); Logger.w(MODULE_NAME, "更新直播信息 END"); - mV2XCarLiveVideoView.setCarLiveInfo(carLiveInfo); if (isVideoPlay) { startCountDown(); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCrossRoadLiveWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCrossRoadLiveWindow.java index 13d371f793..19d783ecde 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCrossRoadLiveWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCrossRoadLiveWindow.java @@ -6,7 +6,6 @@ import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; -import android.widget.RelativeLayout; import android.widget.TextView; import com.mogo.module.common.entity.MarkerCarInfo; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/CarZegoLiveVideoView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/CarZegoLiveVideoView.java index 6713581655..b861da543a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/CarZegoLiveVideoView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/CarZegoLiveVideoView.java @@ -3,6 +3,7 @@ package com.mogo.module.v2x.view; import android.content.Context; import android.content.Intent; import android.graphics.PorterDuff; +import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.SurfaceView; @@ -12,11 +13,11 @@ import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.ContextCompat; -import com.mogo.cloud.trafficlive.api.ITrafficLiveCallBack; +import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack; import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.voice.AIAssist; -import com.mogo.module.common.entity.MarkerCarInfo; +import com.mogo.map.location.MogoLocation; import com.mogo.module.v2x.R; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.utils.V2XUtils; @@ -36,17 +37,15 @@ public class CarZegoLiveVideoView extends RoundLayout { private ProgressBar mLoading; private ConstraintLayout mClLoadError; private TextView mTvRefreshButton; + private String liveSn; - private MarkerCarInfo.CarLiveInfo mCarLiveInfo; // 重新刷新直播流 private final V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() { @Override public void onCallback(String command, Intent intent) { mLoading.setVisibility(VISIBLE); mClLoadError.setVisibility(GONE); - if (mCarLiveInfo != null) { - startLive(mCarLiveInfo); - } + startLive(); } }; @@ -76,26 +75,17 @@ public class CarZegoLiveVideoView extends RoundLayout { mTvRefreshButton.setOnClickListener(v -> { mLoading.setVisibility(VISIBLE); mClLoadError.setVisibility(GONE); - if (mCarLiveInfo != null) { - startLive(mCarLiveInfo); - } + startLive(); }); } - /** - * 设置直播信息 - */ - public void setCarLiveInfo(MarkerCarInfo.CarLiveInfo carLiveInfo) { - mCarLiveInfo = carLiveInfo; - } - /** * 开始直播 */ - public void startLive(MarkerCarInfo.CarLiveInfo carLiveInfo) { - if (mSurfaceView != null && carLiveInfo != null) { + public void startLive() { + if (mSurfaceView != null) { AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice(AbsMogoApplication.getApp().getString(R.string.v2x_voice_see_front_car_live)); - playLiveVideo(carLiveInfo); + playLiveVideo(); mClLoadError.setVisibility(GONE); Logger.d(TAG, "startLive"); @@ -110,12 +100,16 @@ public class CarZegoLiveVideoView extends RoundLayout { /** * 播放直播流 */ - private void playLiveVideo(MarkerCarInfo.CarLiveInfo carLiveInfo) { + private void playLiveVideo() { if (mSurfaceView != null) { - MoGoAiCloudTrafficLive.viewVehicleHeadLive(AbsMogoApplication.getApp(), carLiveInfo.getVideoSn(), mSurfaceView, new ITrafficLiveCallBack() { + MogoLocation mogoLocation = V2XServiceManager.getMogoLocationClient().getLastKnowLocation(); + MoGoAiCloudTrafficLive.viewFrontVehicleLive(mogoLocation.getLatitude(), mogoLocation.getLongitude(), ((int) mogoLocation.getBearing()), mSurfaceView, new ITrafficCarLiveCallBack() { @Override - public void onLive() { + public void onLive(String liveSn) { Logger.d(TAG, "onLive"); + if (!TextUtils.isEmpty(liveSn)) { + CarZegoLiveVideoView.this.liveSn = liveSn; + } mLoading.setVisibility(VISIBLE); mClLoadError.setVisibility(GONE); refreshStatusToListener(true); @@ -132,7 +126,7 @@ public class CarZegoLiveVideoView extends RoundLayout { public void onError(String errorMsg) { refreshStatusToListener(false); AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("直播获取识败,可以对我说重试", null); - stopLive(mCarLiveInfo); + stopLive(); mLoading.setVisibility(GONE); mClLoadError.setVisibility(VISIBLE); // 注册语音交互 @@ -146,11 +140,14 @@ public class CarZegoLiveVideoView extends RoundLayout { } } - public void stopLive(MarkerCarInfo.CarLiveInfo carLiveInfo) { + public void stopLive() { try { Logger.w(TAG, "心跳:关闭直播..."); - // 暂停 - MoGoAiCloudTrafficLive.stopLive(carLiveInfo.getVideoSn()); + if (!TextUtils.isEmpty(liveSn)) { + MoGoAiCloudTrafficLive.stopCarLive(liveSn); + } else { + Logger.e(TAG, "直播 liveSn is null"); + } } catch (Exception e) { e.printStackTrace(); } @@ -159,14 +156,12 @@ public class CarZegoLiveVideoView extends RoundLayout { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); - if (mCarLiveInfo != null) { - startLive(mCarLiveInfo); - } + startLive(); } @Override protected void onDetachedFromWindow() { - stopLive(mCarLiveInfo); + stopLive(); mLoading.setVisibility(VISIBLE); // 反注册语音交互 V2XVoiceManager.INSTANCE @@ -181,9 +176,9 @@ public class CarZegoLiveVideoView extends RoundLayout { } } - private V2XCarLiveVideoView.OnVideoStatusChange onVideoStatusChange; + private OnVideoStatusChange onVideoStatusChange; - public void addOnVideoStatusChangeListener(V2XCarLiveVideoView.OnVideoStatusChange onVideoStatusChange) { + public void addOnVideoStatusChangeListener(OnVideoStatusChange onVideoStatusChange) { this.onVideoStatusChange = onVideoStatusChange; } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java index 42feccd095..ecd7605263 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java @@ -12,13 +12,13 @@ import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.ContextCompat; -import com.mogo.commons.AbsMogoApplication; +import com.mogo.cloud.trafficlive.api.ITrafficIntersectionLiveCallBack; +import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive; import com.mogo.commons.voice.AIAssist; +import com.mogo.map.location.MogoLocation; import com.mogo.module.common.entity.MarkerCarInfo; import com.mogo.module.v2x.R; -import com.mogo.module.v2x.entity.net.V2XLiveCrossRoad; -import com.mogo.module.v2x.network.V2XRefreshCallback; -import com.mogo.module.v2x.network.V2XRefreshModel; +import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceConstants; @@ -43,10 +43,10 @@ import static com.mogo.module.v2x.view.SimpleLiveVideoPlayer.PLAY_EVT_PLAY_BEGIN import static com.mogo.module.v2x.view.SimpleLiveVideoPlayer.PLAY_EVT_PLAY_LOADING; /** - * author : donghongyu + * author : donghongyu EmArrow * e-mail : 1358506549@qq.com - * date : 2020-02-0623:07 - * desc : + * date : 2020-02-06 23:07 + * update : 2021-04-01 17:30 * version: 1.0 */ public class V2XCrossRoadVideoView extends RoundLayout { @@ -54,7 +54,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { private static final String TAG = "CrossRoadVideo"; private SimpleLiveVideoPlayer mTxcVideoView; - private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder(); + private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder(); private ProgressBar mLoading; private ConstraintLayout mClLoadError; private TextView mTvRefreshButton; @@ -62,7 +62,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { private MarkerCarInfo.CarLiveInfo mCarLiveInfo; // 重新刷新直播流 - private V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() { + private final V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() { @Override public void onCallback(String command, Intent intent) { mLoading.setVisibility(VISIBLE); @@ -87,7 +87,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { } private void initView(Context context) { - if(init){ + if (init) { return; } Logger.d("V2XCrossRoadVideoView", "V2X===初始化语音呼叫路口直播视图"); @@ -129,9 +129,9 @@ public class V2XCrossRoadVideoView extends RoundLayout { list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "flush_packets", 1)); list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "dns_cache_clear", 1)); list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "dns_cache_timeout", -1)); - list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "analyzeduration",1)); + list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "analyzeduration", 1)); list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "packet-buffering", 0)); - list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "reconnect",10)); + list.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "reconnect", 10)); GSYVideoManager.instance().setOptionModelList(list); GSYVideoType.enableMediaCodec(); @@ -149,7 +149,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { /** * 开始直播 * - * @param carLiveInfo 要直播的车机,如果没有直播的地址需要重新获取最新的直播地址 + * @param carLiveInfo 要直播的设备信息,如果没有直播的地址需要重新获取最新的直播地址 */ public void startLive(MarkerCarInfo.CarLiveInfo carLiveInfo) { initView(this.getContext()); @@ -162,11 +162,11 @@ public class V2XCrossRoadVideoView extends RoundLayout { } //重新获取直播流地址 else { - V2XRefreshModel.getInstance(AbsMogoApplication.getApp()).queryCrossRoadsLive(new V2XRefreshCallback() { + MogoLocation mogoLocation = V2XServiceManager.getMogoLocationClient().getLastKnowLocation(); + MoGoAiCloudTrafficLive.viewFrontIntersectionLive(mogoLocation.getLatitude(), mogoLocation.getLongitude(), ((int) mogoLocation.getBearing()), new ITrafficIntersectionLiveCallBack() { @Override - public void onSuccess(V2XLiveCrossRoad result) { - if (result != null && result.getResult().getUrl() != null) { - String liveUrl = result.getResult().getUrl(); + public void liveUrlResult(String liveUrl) { + if (!TextUtils.isEmpty(liveUrl)) { MarkerCarInfo.CarLiveInfo carLiveInfo = new MarkerCarInfo.CarLiveInfo(); carLiveInfo.setVideoUrl(liveUrl); setCarLiveInfo(carLiveInfo); @@ -177,8 +177,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { } @Override - public void onFail(String msg) { - //获取路口实况失败 + public void onError(String errorMsg) { Logger.d(MODULE_NAME, "获取路口实况失败"); } }); From 3b798b30c64ae8a819b81b924a96033637e98902 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 1 Apr 2021 18:05:48 +0800 Subject: [PATCH 3/3] .. --- gradle.properties | 16 ++++++++-------- .../roadcondition/service/CarCorderController.kt | 10 ++-------- .../module/push/adapter/PushMessageAdapter.kt | 8 ++++---- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/gradle.properties b/gradle.properties index a2007126a0..73f8f9dadb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -155,21 +155,21 @@ LOGLIB_VERSION = 1.0.4 ######## MogoAiCloudSDK Version # 网络请求 -MOGO_NETWORK_VERSION=1.0.60 +MOGO_NETWORK_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 -######## Foundation MogoAiCloud Module +######## Foundation MogoAiCloud Moduletruetr # mogoAiCloud apk services MOGO_AICLOUD_SERVICES_APK_VERSION=1.0.0-SNAPSHOT # mogoAiCloud sdk services diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt index c64ffaec9a..faee34d0e5 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt @@ -18,8 +18,6 @@ import com.zhidao.auto.carcorder.controller.ZdCarCoderController import com.zhidao.roadcondition.constant.STRATEGY_UPLOAD_TYPE_ARRAY import com.zhidao.roadcondition.event.GetImageSuccessEvent import com.zhidao.roadcondition.event.LatLngStickyEventBus -import com.zhidao.roadcondition.model.proxy.INFO_TYPE_IMG -import com.zhidao.roadcondition.model.proxy.INFO_TYPE_VIDEO import com.zhidao.roadcondition.util.* import com.zhidao.roadcondition.util.StrategyPreferenceUtil.Companion.getStrategyMaxSpeed import com.zhidao.roadcondition.util.StrategyPreferenceUtil.Companion.getStrategyMinSpeed @@ -154,7 +152,6 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { // TipToast.shortTip("分享失败,请检查网络") // } else { //失败了,传空地址,发起请求 - val entity = TakeEntity(isCustom, id, fromType) // videoAndThumbMap["video"] = "" // videoAndThumbMap["thumb"] = "" @@ -197,7 +194,6 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { it.onTakePhotoFail(photoType, camera) } val isCustom = CustomStatusHandler.pollPhotoStatus() - val entity = TakeEntity(isCustom, 0L) Log.e(TAG, "onTakePhotoFail -----mType = $mType --- isCustom = $isCustom") //获取图片失败也上报,图片不打点 if (isCustom) { @@ -224,7 +220,6 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { trackGetPhoto(2) Log.d(TAG, "onTakePhotoSuccess -----mType = $mType --- mainInfoId = $mainInfoId") val isCustom = CustomStatusHandler.pollPhotoStatus() - val entity = TakeEntity(isCustom, 0L) if (!isCustom) { trackNormalEvent(CarNet_auto_upload, null) @@ -470,10 +465,10 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { /** * 上报路况的视频和图片 */ - fun uploadRoadInfo(info: UploadInfo) { + private fun uploadRoadInfo(info: UploadInfo) { MogoUploadManager.getInstance(AbsMogoApplication.getApp().applicationContext).uploadInfo(info, object : ITanluUploadCallback { override fun onSuccess(result: BaseData) { - if (result != null) { + if (result.result != null) { Log.d(TAG, "result =" + result.result); } } @@ -514,7 +509,6 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { override fun onTakeVideoCancel(camera: Int) { Log.d(TAG, "onTakeVideoCancel -----camera = $camera") - val entity = CustomStatusHandler.pollVideoStatus() //失败了,传空地址,发起请求 videoAndThumbMap["video"] = "" videoAndThumbMap["thumb"] = "" diff --git a/modules/mogo-module-push/src/main/java/com/mogo/module/push/adapter/PushMessageAdapter.kt b/modules/mogo-module-push/src/main/java/com/mogo/module/push/adapter/PushMessageAdapter.kt index 25f45bd3c3..b920fedc77 100644 --- a/modules/mogo-module-push/src/main/java/com/mogo/module/push/adapter/PushMessageAdapter.kt +++ b/modules/mogo-module-push/src/main/java/com/mogo/module/push/adapter/PushMessageAdapter.kt @@ -89,7 +89,7 @@ class PushMessageAdapter : RecyclerView.Adapter