|
@@ -1032,11 +1032,11 @@ ErrorCodeEnum CMediaControllerEntity::GetEnvCameraVideoCaptureInfo(CSimpleString
|
|
|
}
|
|
|
|
|
|
|
|
|
-ErrorCodeEnum CMediaControllerEntity::StartAllCameras()
|
|
|
+ErrorCodeEnum CMediaControllerEntity::StartAllCameras(bool bstartaudio)
|
|
|
{
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
if (false == m_bStartCamera){
|
|
|
- Error = StartCamera();
|
|
|
+ Error = StartCamera(bstartaudio);
|
|
|
SetCameraStateInfo(Error);
|
|
|
|
|
|
if (m_bStartCamera) {
|
|
@@ -1085,7 +1085,7 @@ ErrorCodeEnum CMediaControllerEntity::StopCamerasAndRecord()
|
|
|
|
|
|
ErrorCodeEnum CMediaControllerEntity::StartCamerasAndRecord()
|
|
|
{
|
|
|
- ErrorCodeEnum CamRet = StartAllCameras();
|
|
|
+ ErrorCodeEnum CamRet = StartAllCameras(true);
|
|
|
LogTransactionRecordCtrEvt(1);
|
|
|
|
|
|
return CamRet;
|
|
@@ -1746,7 +1746,7 @@ ErrorCodeEnum CMediaControllerEntity::StopSalesRecordAudioCapture()
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
|
-ErrorCodeEnum CMediaControllerEntity::StartCamera()
|
|
|
+ErrorCodeEnum CMediaControllerEntity::StartCamera(bool bstartaudio)
|
|
|
{
|
|
|
if (m_capture == NULL)
|
|
|
{
|
|
@@ -1761,7 +1761,7 @@ ErrorCodeEnum CMediaControllerEntity::StartCamera()
|
|
|
conf.envopt_mutex = &m_envopt_mutex;
|
|
|
#endif
|
|
|
conf.uintervaltime = m_interValTime;
|
|
|
- Error = (ErrorCodeEnum)capture_create(&conf, &m_capture);
|
|
|
+ Error = (ErrorCodeEnum)capture_create(&conf, &m_capture, bstartaudio);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
#ifdef RVC_OS_WIN
|
|
@@ -1774,7 +1774,7 @@ ErrorCodeEnum CMediaControllerEntity::StartCamera()
|
|
|
m_capture->config.strAudioState = strValue;
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Sound Card State is %s.", strValue.GetData());
|
|
|
|
|
|
- Error = capture_start(m_capture);
|
|
|
+ Error = capture_start(m_capture, bstartaudio);
|
|
|
if (Error != Error_Succeed)
|
|
|
{
|
|
|
if((Error == Error_AudioIN)||(Error == Error_AudioOut))
|
|
@@ -1867,7 +1867,7 @@ void CMediaControllerEntity::SetCameraStateInfo(ErrorCodeEnum errorcode)
|
|
|
void CMediaControllerEntity::StartCameraAndSetSysVar()
|
|
|
{
|
|
|
CheckAutoVideoConfig(&conf);
|
|
|
- ErrorCodeEnum Error = StartCamera();
|
|
|
+ ErrorCodeEnum Error = StartCamera(true);
|
|
|
SetCameraStateInfo(Error);
|
|
|
}
|
|
|
|
|
@@ -1888,11 +1888,11 @@ ErrorCodeEnum CMediaControllerEntity::ReStartCamera(int nCamera)
|
|
|
Error = capture_create(&conf, m_capture, nCamera);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- Error = capture_start(m_capture,nCamera);
|
|
|
+ Error = capture_start(m_capture, nCamera);
|
|
|
if (Error != Error_Succeed)
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReStartCamera %d,capture_start fail!", nCamera);
|
|
|
- capture_destroy(m_capture,nCamera);
|
|
|
+ capture_destroy(m_capture, nCamera);
|
|
|
return Error;
|
|
|
}
|
|
|
else
|
|
@@ -2515,7 +2515,13 @@ void MediaServiceSession::Handle_TurnOnCamera(SpReqAnsContext<MediaService_TurnO
|
|
|
{
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
|
|
|
- ErrorCodeEnum Error = m_pEntity->StartAllCameras();
|
|
|
+ DWORD warnCode = 0;
|
|
|
+
|
|
|
+ if (m_pEntity->m_bJsOccupyCamera) {
|
|
|
+ ctx->Answer(Error_DevNotAvailable, LOG_WARN_JSOCCUPYCAMERAING);
|
|
|
+ }
|
|
|
+
|
|
|
+ ErrorCodeEnum Error = m_pEntity->StartAllCameras(false);
|
|
|
#ifdef DEVOPS_ON_PRD
|
|
|
#else
|
|
|
#ifdef RVC_OS_WIN
|
|
@@ -2527,14 +2533,22 @@ void MediaServiceSession::Handle_TurnOnCamera(SpReqAnsContext<MediaService_TurnO
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
- if (Error_Succeed == Error) {
|
|
|
- ctx->Ans.result = 0;
|
|
|
+ if (Error != Error_AllCamera) {
|
|
|
+ if (Error_Succeed == Error) {
|
|
|
+ ctx->Ans.result = 0;
|
|
|
+ }
|
|
|
+ else if (Error_EnvCamera == Error) {
|
|
|
+ ctx->Ans.result = -1;
|
|
|
+ }
|
|
|
+ else if (Error_EnvCamera == Error) {
|
|
|
+ ctx->Ans.result = -2;
|
|
|
+ }
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
else {
|
|
|
- ctx->Ans.result = -1;
|
|
|
+ ctx->Ans.result = -3;
|
|
|
+ ctx->Answer(Error_AllCamera, LOG_WARN_ALLCAMERA_ERRORS);
|
|
|
}
|
|
|
-
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
|
|
|
void MediaServiceSession::Handle_TurnOffCamera(SpReqAnsContext<MediaService_TurnOffCamera_Req, MediaService_TurnOffCamera_Ans>::Pointer ctx)
|