|
@@ -12,6 +12,7 @@
|
|
|
#include "audio_session.h"
|
|
|
#include "video_session.h"
|
|
|
#include "../mod_counterconnector/Event.h"
|
|
|
+#include "../mod_evtconverter/Event.h"
|
|
|
|
|
|
#define EVT_CONVERTER "EventConverter"
|
|
|
|
|
@@ -384,14 +385,6 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
- case LOG_EVT_RELEASELIVEDETECTION:
|
|
|
- {
|
|
|
- m_stVideoParam.bActiveInspect = 0;
|
|
|
- m_stVideoParam.bShowActiveImg = 0;
|
|
|
- m_stVideoParam.iCameraSwitch = CAMERA_TYPE_ENV;
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
case LOG_EVT_UI_HIDEONLINEVIDEO:
|
|
|
{
|
|
|
m_stVideoParam.nWindowState = 2;
|
|
@@ -419,15 +412,14 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
- case LOG_EVT_UI_STOPRECORD:
|
|
|
case LOG_EVT_UI_STOPREMOTERECORD:
|
|
|
{
|
|
|
if (m_stVideoParam.bShowRecordArea){
|
|
|
m_stVideoParam.bShowRecordArea = 0;
|
|
|
}
|
|
|
- #ifdef RVC_OS_LINUX
|
|
|
+ #ifdef RVC_OS_LINUX
|
|
|
rvc_stop_video_render(m_render);
|
|
|
- #endif
|
|
|
+ #endif
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -442,9 +434,9 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
if (m_stVideoParam.nWindowState == 4)
|
|
|
{
|
|
|
m_stVideoParam.nWindowState = 3;
|
|
|
- #ifdef RVC_OS_LINUX
|
|
|
+ #ifdef RVC_OS_LINUX
|
|
|
ShowLocalVideo();
|
|
|
- #endif
|
|
|
+ #endif
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -452,9 +444,9 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
case LOG_EVT_UI_HIDELOCALVIDEO:
|
|
|
{
|
|
|
m_stVideoParam.nWindowState = 4;
|
|
|
- #ifdef RVC_OS_LINUX
|
|
|
+ #ifdef RVC_OS_LINUX
|
|
|
HideLocalVideo();
|
|
|
- #endif
|
|
|
+ #endif
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -470,6 +462,29 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
+ case LOG_EVT_UI_STARTCAMERACAPTURE:
|
|
|
+ {
|
|
|
+ #ifdef RVC_OS_WIN
|
|
|
+ #else
|
|
|
+ int local_view_x = 0;
|
|
|
+ int local_view_y = 0;
|
|
|
+ int local_view_cx = 0;
|
|
|
+ int local_view_cy = 0;
|
|
|
+ char str[256] = {0};
|
|
|
+ int isecond = 0;
|
|
|
+ sscanf(pszMessage, "%d@%d@%d@%d@%d@%s", &local_view_x, &local_view_y, &local_view_cx, &local_view_cy, &isecond, str);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local_view_x = %d, local_view_y = %d, local_view_cx = %d, local_view_cy = %d.", local_view_x, local_view_y, local_view_cx, local_view_cy);
|
|
|
+ StartCameraRender(local_view_x, local_view_y, local_view_cx, local_view_cy);
|
|
|
+ #endif
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case LOG_EVT_UI_STOPCAMERACAPTURE:
|
|
|
+ {
|
|
|
+ StopCameraRender();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown dwUserCode = 0x%08x.",dwUserCode);
|
|
@@ -958,7 +973,7 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
|
CUUID id;
|
|
|
int i = 0;
|
|
|
- m_arrListener.Init(26);
|
|
|
+ m_arrListener.Init(25);
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANDFREE_TO_PICKUP, EVT_CONVERTER);
|
|
|
m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_PICKUP_TO_HANDFREE, EVT_CONVERTER);
|
|
@@ -979,16 +994,10 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_EXIT_ACM_FLOW,NULL,false);
|
|
|
m_arrListener[i++] = id;
|
|
|
- Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_RELEASELIVEDETECTION,NULL,false);
|
|
|
- m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_HIDEONLINEVIDEO,NULL,false);
|
|
|
m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_SHOWONLINEVIDEO,NULL,false);
|
|
|
m_arrListener[i++] = id;
|
|
|
- Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTRECORD,NULL,false);
|
|
|
- m_arrListener[i++] = id;
|
|
|
- Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPRECORD,NULL,false);
|
|
|
- m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_RETURNMENU,NULL,false);
|
|
|
m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_HIDELOCALVIDEO,NULL,false);
|
|
@@ -1011,6 +1020,10 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
m_arrListener[i++] = id;
|
|
|
Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_PICKUP_MODE_REMOTE_CALL,NULL,false);
|
|
|
m_arrListener[i++] = id;
|
|
|
+ Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTCAMERACAPTURE, NULL, false);
|
|
|
+ m_arrListener[i++] = id;
|
|
|
+ Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPCAMERACAPTURE, NULL, false);
|
|
|
+ m_arrListener[i++] = id;
|
|
|
}
|
|
|
|
|
|
{
|
|
@@ -2415,6 +2428,67 @@ CSimpleStringA CSIPEntity::GetAudioDeviceJsonInfos(bool bmicro)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
+ErrorCodeEnum CSIPEntity::StartCameraRender(int ivideoview_x, int ivideoview_y, int ivideoview_cx, int ivideoview_cy)
|
|
|
+{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+#else
|
|
|
+ m_render = new rvc_video_render_t();
|
|
|
+ videorender_callback_t t_callback = { 0 };
|
|
|
+ t_callback.debug = &__video_render_log;
|
|
|
+ rvc_video_render_params_t render_param = { 0 };
|
|
|
+ render_param.ilocal_view_cx = ivideoview_cx;
|
|
|
+ render_param.ilocal_view_cy = ivideoview_cy;
|
|
|
+ render_param.ilocal_view_x = ivideoview_x;
|
|
|
+ render_param.ilocal_view_y = ivideoview_y;
|
|
|
+ render_param.ilocal_render_queue = 1;
|
|
|
+
|
|
|
+ m_render->plocal_render = CreateVideoRenderObj(&t_callback);
|
|
|
+ LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_CREATE, "local video render create.");
|
|
|
+
|
|
|
+ memcpy(&m_render->render_param, &render_param, sizeof(rvc_video_render_params_t));
|
|
|
+ m_render->local_render_threadid = 0;
|
|
|
+ m_render->remote_render_threadid = 0;
|
|
|
+
|
|
|
+ rvc_video_box_move_callback_t t_render_callback = { 0 };
|
|
|
+ t_render_callback.on_video_box_move = &__on_video_box_move;
|
|
|
+ t_render_callback.user_data = this;
|
|
|
+
|
|
|
+ rvc_video_render_window_type_callback_t t_window_type_callback = { 0 };
|
|
|
+ t_window_type_callback.on_window_type = &__on_window_type_callback;
|
|
|
+ t_window_type_callback.user_data = this;
|
|
|
+ memcpy(&m_render->cb, &t_window_type_callback, sizeof(rvc_video_render_window_type_callback_t));
|
|
|
+ m_stVideoParam.bShowPersonArea = 0;
|
|
|
+
|
|
|
+ if (Error_Succeed == rvc_start_video_render(m_render, false, &t_render_callback)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start video render success.");
|
|
|
+ }
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+ return Error_Succeed;
|
|
|
+}
|
|
|
+
|
|
|
+ErrorCodeEnum CSIPEntity::StopCameraRender()
|
|
|
+{
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+#else
|
|
|
+ if (Error_Succeed == rvc_stop_video_render(m_render)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop video render success.");
|
|
|
+ }
|
|
|
+ if (NULL!= m_render->plocal_render) {
|
|
|
+ DestroyVideoRenderObj(m_render->plocal_render);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (NULL != &m_render->local_render_stop_sem) {
|
|
|
+ sem_destroy(&m_render->local_render_stop_sem);
|
|
|
+ }
|
|
|
+
|
|
|
+ delete(m_render);
|
|
|
+ m_render = NULL;
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
+ return Error_Succeed;
|
|
|
+}
|
|
|
+
|
|
|
//
|
|
|
// CSIPPhoneSession
|
|
|
//
|
|
@@ -2951,7 +3025,7 @@ void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
|
|
|
}
|
|
|
|
|
|
#else
|
|
|
-void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
|
|
|
+void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd)
|
|
|
{
|
|
|
if (m_pCall)
|
|
|
{
|
|
@@ -3084,6 +3158,15 @@ int CSIPPhoneSession::stop_video_render()
|
|
|
}
|
|
|
DestroyVideoRenderObj(m_pEntity->m_render->plocal_render);
|
|
|
DestroyVideoRenderObj(m_pEntity->m_render->premote_render);
|
|
|
+
|
|
|
+ if (NULL != &m_pEntity->m_render->local_render_stop_sem) {
|
|
|
+ sem_destroy(&m_pEntity->m_render->local_render_stop_sem);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (NULL != &m_pEntity->m_render->remote_render_stop_sem) {
|
|
|
+ sem_destroy(&m_pEntity->m_render->remote_render_stop_sem);
|
|
|
+ }
|
|
|
+
|
|
|
delete(m_pEntity->m_render);
|
|
|
m_pEntity->m_render = NULL;
|
|
|
|