Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk
This commit is contained in:
@@ -155,21 +155,21 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.58
|
||||
MOGO_NETWORK_VERSION=1.0.61
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.58
|
||||
MOGO_PASSPORT_VERSION=1.0.61
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.58
|
||||
MOGO_SOCKET_VERSION=1.0.61
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.58
|
||||
MOGO_REALTIME_VERSION=1.0.61
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.58
|
||||
MOGO_TANLU_VERSION=1.0.61
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.58
|
||||
MOGO_LIVE_VERSION=1.0.61
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.58
|
||||
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
|
||||
|
||||
@@ -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<UploadResult>) {
|
||||
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"] = ""
|
||||
|
||||
@@ -89,7 +89,7 @@ class PushMessageAdapter : RecyclerView.Adapter<PushMessageAdapter.MessageViewHo
|
||||
pushDelete.setOnClickListener {
|
||||
deletePushBean.deleteBean(bean, false)
|
||||
}
|
||||
if (!bean.mainSchema.isNullOrEmpty()) {
|
||||
if (bean.mainSchema.isNotEmpty()) {
|
||||
pushClick.setOnClickListener {
|
||||
dealSchema(bean.mainSchema, itemView.context)
|
||||
deletePushBean.deleteBean(bean, true)
|
||||
@@ -100,11 +100,11 @@ class PushMessageAdapter : RecyclerView.Adapter<PushMessageAdapter.MessageViewHo
|
||||
// getApis(itemView.context).imageLoaderApi.displayImage(bean.appIcon, pushAppIcon)
|
||||
pushTitle.text = bean.title
|
||||
pushContent.text = bean.content
|
||||
pushContent.visibility = if (bean.content.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
if (bean.QRCode.isNullOrEmpty() && bean.imageUrl.isNotEmpty()) {
|
||||
pushContent.visibility = if (bean.content.isEmpty()) View.GONE else View.VISIBLE
|
||||
if (bean.QRCode.isEmpty() && bean.imageUrl.isNotEmpty()) {
|
||||
getApis(itemView.context).imageLoaderApi.displayImage(bean.imageUrl, pushImage)
|
||||
}
|
||||
if (!bean.QRCode.isNullOrEmpty()) {
|
||||
if (bean.QRCode.isNotEmpty()) {
|
||||
pushImage.setImageBitmap(
|
||||
stringConverterBitmap(
|
||||
bean.QRCode,
|
||||
|
||||
@@ -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<V2XPushMessageEntity> v2XMessageEntity = buildCallLiveParams(liveCarSn, null);
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = buildCallLiveParams(null, null);
|
||||
mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario();
|
||||
mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCallLiveCarWindow());
|
||||
mV2XVoiceCallLiveScenario.init(v2XMessageEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看前方路口摄像头直播,同方向角 1公里范围
|
||||
*/
|
||||
public void getOpenRoadCameraLive() {
|
||||
V2XRefreshModel.getInstance(mContext).queryCrossRoadsLive(new V2XRefreshCallback<V2XLiveCrossRoad>() {
|
||||
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<V2XPushMessageEntity> 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<V2XPushMessageEntity>}
|
||||
*/
|
||||
private V2XMessageEntity<V2XPushMessageEntity> buildCallLiveParams(String sn, String liveUrl) {
|
||||
V2XPushMessageEntity v2XPushMessageEntity = new V2XPushMessageEntity();
|
||||
v2XPushMessageEntity.setVideoSn(sn);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<V2XLiveCrossRoad>() {
|
||||
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, "获取路口实况失败");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user