|
|
@@ -205,13 +205,15 @@ void CMediaControllerEntity::OnStarted()
|
|
|
{
|
|
|
if (Error == Error_EnvCamera)
|
|
|
{
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Load EnvCamera Config failed!");
|
|
|
SetCameraSysVar(CAMERA_ENV_ERROR);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Camera State to CAMERA_ENV_ERROR");
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Camera State to CAMERA_ENV_ERROR");
|
|
|
m_nCameraErrorCode = Error_EnvCamera;
|
|
|
GetFunction()->SetUserDefineState(USER_MEDIA_ENVERRROR);
|
|
|
}
|
|
|
else if (Error == Error_OptCamera)
|
|
|
{
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Load OptCamera Config failed!");
|
|
|
SetCameraSysVar(CAMERA_OPT_ERROR);
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Camera State to CAMERA_OPT_ERROR");
|
|
|
m_nCameraErrorCode = Error_OptCamera;
|
|
|
@@ -224,7 +226,7 @@ void CMediaControllerEntity::OnStarted()
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Load all camera Config failed!");
|
|
|
SetCameraSysVar(CAMERA_BOTH_ERROR);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Camera State to CAMERA_BOTH_ERROR");
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Camera State to CAMERA_BOTH_ERROR");
|
|
|
m_nCameraErrorCode = Error_AllCamera;
|
|
|
GetFunction()->SetUserDefineState(USER_MEDIA_ALLERROR);
|
|
|
}
|
|
|
@@ -232,8 +234,7 @@ void CMediaControllerEntity::OnStarted()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("capture_lib_init failed!");
|
|
|
}
|
|
|
|
|
|
@@ -356,9 +357,6 @@ DeviceTypeEnum CMediaControllerEntity::RvcGetDeviceType()
|
|
|
else if (_stricmp(stStaticinfo.strMachineType, "RPM.Stand1S") == 0) {
|
|
|
eType = eRpm1sType;
|
|
|
}
|
|
|
- else if (_stricmp(stStaticinfo.strMachineType, "RVC.Desk1S") == 0) {
|
|
|
- eType = eDesk1SType;
|
|
|
- }
|
|
|
else if (stricmp(stStaticinfo.strMachineType, "RVC.CardStore") == 0 || stricmp(stStaticinfo.strMachineType, "RVC.CardPrinter") == 0) {
|
|
|
eType = eCardStore;
|
|
|
}
|
|
|
@@ -566,12 +564,10 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
|
|
|
{
|
|
|
if (dwTimerID == 1) {
|
|
|
if (!m_capture) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_capture =Null");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!m_bStartCamera) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_bStartCamera =false");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -625,7 +621,6 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
|
|
|
capture_detect_camera_bug(m_capture, &env_n, &opt_n, bIsPadType);
|
|
|
|
|
|
-
|
|
|
capture_get_last_frametime(m_capture, &nLastEnvTime, &nLastOptTime, bIsPadType);
|
|
|
|
|
|
if (env_n == 0) {
|
|
|
@@ -639,7 +634,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
}
|
|
|
else {
|
|
|
if (m_iEnvEmptyTimes == CAMERA_BUG_THRESHOLD){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("env camera get right!");
|
|
|
+
|
|
|
}
|
|
|
m_iEnvEmptyTimes = 0;
|
|
|
}
|
|
|
@@ -670,7 +665,8 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
}
|
|
|
|
|
|
LogWarn(Severity_Middle, Error_Hardware, ERROR_MOD_MEDIACONTROLLER_ENVCAMERA_BUG, strInfo);
|
|
|
- if ((ePadtype == m_eDeviceType)||(eMobilePadType == m_eDeviceType)||(eDesk2SType == m_eDeviceType)||(eDesk1SType == m_eDeviceType)||(eDesk2SIntegratedType == m_eDeviceType))
|
|
|
+
|
|
|
+ if (eMobilePadType == m_eDeviceType)
|
|
|
{
|
|
|
m_nCameraErrorCode = Error_AllCamera;
|
|
|
ChangeSysvar(Error_EnvCamera);
|
|
|
@@ -697,7 +693,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
}
|
|
|
else if((m_iEnvEmptyTimes != CAMERA_BUG_THRESHOLD)&&!bEnvTimeout&&((m_nCameraErrorCode == Error_EnvCamera)||(m_nCameraErrorCode == Error_AllCamera)))
|
|
|
{
|
|
|
- if ((ePadtype == m_eDeviceType)||(eMobilePadType == m_eDeviceType)||(eDesk2SType == m_eDeviceType)||(eDesk1SType == m_eDeviceType)||(eDesk2SIntegratedType == m_eDeviceType))
|
|
|
+ if (eMobilePadType == m_eDeviceType)
|
|
|
{
|
|
|
m_nCameraErrorCode = Error_Succeed;
|
|
|
ChangeSysvar(m_nCameraErrorCode);
|
|
|
@@ -735,7 +731,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
{
|
|
|
if (m_iOptEmptyTimes == CAMERA_BUG_THRESHOLD)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("opt camera get right!");
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("opt camera get right!");
|
|
|
}
|
|
|
m_iOptEmptyTimes = 0;
|
|
|
}
|
|
|
@@ -751,10 +747,9 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
else if (((y2k_time_now()-nLastOptTime) < m_iCamTimeout)&&bOptTimeout)
|
|
|
{
|
|
|
bOptTimeout = false;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change opt camera from bOptTimeout to OK");
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change opt camera from bOptTimeout to OK");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//opt是否100S没有图像或者图像20秒没有更新
|
|
|
if(((m_iOptEmptyTimes == CAMERA_BUG_THRESHOLD)||bOptTimeout)&&(m_nCameraErrorCode!=Error_OptCamera)&&(m_nCameraErrorCode!=Error_AllCamera)&&(eStand2sType == m_eDeviceType))
|
|
|
{
|
|
|
@@ -972,7 +967,7 @@ void CMediaControllerEntity::SendCameraBright()
|
|
|
}
|
|
|
|
|
|
|
|
|
-ErrorCodeEnum CMediaControllerEntity::StartEnvCamera()
|
|
|
+ErrorCodeEnum CMediaControllerEntity::StartCameras()
|
|
|
{
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
if (FALSE == m_bStartCamera){
|
|
|
@@ -991,7 +986,7 @@ ErrorCodeEnum CMediaControllerEntity::StartEnvCamera()
|
|
|
}
|
|
|
|
|
|
|
|
|
-ErrorCodeEnum CMediaControllerEntity::StopEnvCamera()
|
|
|
+ErrorCodeEnum CMediaControllerEntity::StopCameras()
|
|
|
{
|
|
|
if (m_capture){
|
|
|
GetFunction()->KillTimer(1);
|
|
|
@@ -1005,6 +1000,25 @@ ErrorCodeEnum CMediaControllerEntity::StopEnvCamera()
|
|
|
}
|
|
|
|
|
|
|
|
|
+ErrorCodeEnum CMediaControllerEntity::StopCamerasAndRecord()
|
|
|
+{
|
|
|
+ LogEvent(Severity_Middle, EVENT_MOD_PAUSE_RECORD, "pause record.");
|
|
|
+
|
|
|
+ ErrorCodeEnum CamRet = StopCameras();
|
|
|
+
|
|
|
+ return CamRet;
|
|
|
+}
|
|
|
+
|
|
|
+ErrorCodeEnum CMediaControllerEntity::StartCamerasAndRecord()
|
|
|
+{
|
|
|
+ ErrorCodeEnum CamRet = StartCameras();
|
|
|
+
|
|
|
+ LogEvent(Severity_Middle, EVENT_MOD_CONTINUE_RECORD, "continue record.");
|
|
|
+
|
|
|
+ return CamRet;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
ErrorCodeEnum CMediaControllerEntity::LoadRunConfig(CSimpleStringA& frontcam, CSimpleStringA& rearcam)
|
|
|
{
|
|
|
CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
@@ -1329,7 +1343,7 @@ void CMediaControllerEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID
|
|
|
if (m_pMediaControllerChannel != NULL){
|
|
|
m_pMediaControllerChannel->GetFunction()->CloseSession();
|
|
|
m_pMediaControllerChannel = NULL;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
|
|
|
m_bConnectedAssist = FALSE;
|
|
|
}
|
|
|
|
|
|
@@ -1892,6 +1906,7 @@ ErrorCodeEnum CMediaControllerEntity::StopSpeakerAudioRender()
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
ErrorCodeEnum CMediaControllerEntity::SetSalesRecordAudioCaptureTransActionData(eRvcPCMTransType eType, void* pData)
|
|
|
{
|
|
|
auto rc = Error_Param;
|
|
|
@@ -1922,7 +1937,7 @@ ErrorCodeEnum CMediaControllerEntity::ConnectAssistChannel()
|
|
|
if (Error_Succeed == Error)
|
|
|
{
|
|
|
ChannelService_BeginState_Sub Sub;
|
|
|
- Error = m_pMediaControllerChannel->BeginState(Sub);
|
|
|
+ Error = (*m_pMediaControllerChannel)(EntityResource::getLink().upgradeLink())->BeginState(Sub);
|
|
|
if (Error != Error_Succeed) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("BeginState biz channel failed!");
|
|
|
m_pMediaControllerChannel->GetFunction()->CloseSession();
|
|
|
@@ -1935,7 +1950,7 @@ ErrorCodeEnum CMediaControllerEntity::ConnectAssistChannel()
|
|
|
{
|
|
|
ChannelService_BeginRecv_Sub Sub;
|
|
|
Sub.type = ACM_TYPE_DEVICE;
|
|
|
- Error = m_pMediaControllerChannel->BeginRecv(Sub);
|
|
|
+ Error = (*m_pMediaControllerChannel)(EntityResource::getLink().upgradeLink())->BeginRecv(Sub);
|
|
|
if (Error != Error_Succeed) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin BeginRecv ACM_TYPE_DEVICE failed!");
|
|
|
m_pMediaControllerChannel->GetFunction()->CloseSession();
|
|
|
@@ -2109,16 +2124,13 @@ void MediaServiceSession::Handle_StopCamera(SpOnewayCallContext<MediaService_Sto
|
|
|
void MediaServiceSession::Handle_StartEnvCamera(SpReqAnsContext<MediaService_StartEnvCamera_Req, MediaService_StartEnvCamera_Ans>::Pointer ctx)
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
- ErrorCodeEnum Error = m_pEntity->StartEnvCamera();
|
|
|
- ctx->Ans.returncod = Error;
|
|
|
- ctx->Answer(Error);
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|
|
|
|
|
|
void MediaServiceSession::Handle_StopEnvCamera(SpOnewayCallContext<MediaService_StopEnvCamera_Info>::Pointer ctx)
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
- m_pEntity->StopEnvCamera();
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2131,7 +2143,7 @@ void MediaServiceSession::Handle_StartSpeakerRender(SpOnewayCallContext<MediaSer
|
|
|
void MediaServiceSession::Handle_StopSpeakerRender(SpOnewayCallContext<MediaService_StopSpeakerRender_Info>::Pointer ctx)
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
- if (true == m_pEntity->m_bHasStartSpeakerRender) {
|
|
|
+ if (true == m_pEntity->m_bHasStartSpeakerRender){
|
|
|
m_pEntity->StopSpeakerAudioRender();
|
|
|
}
|
|
|
}
|
|
|
@@ -2182,6 +2194,28 @@ void MediaServiceSession::Handle_GetCameraInfos(SpReqAnsContext<MediaService_Get
|
|
|
}
|
|
|
|
|
|
|
|
|
+void MediaServiceSession::Handle_ManipulateCameras(SpReqAnsContext<MediaService_ManipulateCameras_Req, MediaService_ManipulateCameras_Ans>::Pointer ctx)
|
|
|
+{
|
|
|
+ DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
+ ErrorCodeEnum Error = Error_NotImpl;
|
|
|
+
|
|
|
+ DeviceTypeEnum eType = m_pEntity->RvcDeviceType();
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("rvc Device Type is %s, and cmdType is %d.", Device_Type_Table[eType], ctx->Req.cmdType);
|
|
|
+
|
|
|
+ if (ctx->Req.cmdType == 0) {
|
|
|
+ Error = m_pEntity->StopCamerasAndRecord();
|
|
|
+ Sleep(50);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Sleep(100);
|
|
|
+ Error = m_pEntity->StartCamerasAndRecord();
|
|
|
+ }
|
|
|
+
|
|
|
+ ctx->Ans.retCode = (int)Error;
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
SP_BEGIN_ENTITY_MAP()
|
|
|
SP_ENTITY(CMediaControllerEntity)
|
|
|
SP_END_ENTITY_MAP()
|